X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/fdda3852e46b9fb9bde623d6dbd4d55752fcbf74..e277c0f673ccb26f9b75c36ef03ac3c5d0dacaf8:/code/controls.py?ds=sidebyside diff --git a/code/controls.py b/code/controls.py index 2a86a89..6346002 100644 --- a/code/controls.py +++ b/code/controls.py @@ -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""" @@ -112,7 +116,7 @@ def createVm(username, state, owner, contact, name, description, memory, disksiz nic = NIC.query().filter_by(machine_id=None).filter_by(reusable=True).first() if not nic: #No IPs left! raise CodeError("No IP addresses left! " - "Contact %s." % config.web.errormail) + "Contact %s." % config.contact) nic.machine = machine nic.hostname = name session.save_or_update(nic)