Show historical domain CPU usage if available.
[invirt/packages/invirt-web.git] / code / controls.py
index 2a86a89..d04b2f5 100644 (file)
@@ -47,12 +47,16 @@ def lvinstall(machine, autoinstall):
     memsize = machine.memory
     swapsize = getswap(disksize, memsize)
     imagesize = disksize - swapsize
-    ip = machine.nics[0].ip
-    remctl('control', machine.name, 'install', 
-           'dist=%s' % autoinstall.distribution,
-           'mirror=%s' % autoinstall.mirror,
-           'arch=%s' % autoinstall.arch,
-           'imagesize=%s' % imagesize)
+
+    installer_options = ['dist=%s' % autoinstall.distribution,
+                         'mirror=%s' % autoinstall.mirror,
+                         'arch=%s' % autoinstall.arch,
+                         'imagesize=%s' % imagesize]
+    if autoinstall.preseed:
+        installer_options += ['preseed=http://'+config.web.hostname+'/static/preseed/'+autoinstall.autoinstall_id+'.preseed']
+
+    remctl('control', machine.name, 'install',
+           *installer_options)
 
 def lvcopy(machine_orig_name, machine, rootpw):
     """Copy a golden image onto a machine's disk"""