X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/951ff47a4c46a212194a763496145fbafb7ba471..89e13567a64d63163ca622fb8e45be5f3ca6d443:/code/controls.py diff --git a/code/controls.py b/code/controls.py index 4cd0e9c..911c41a 100644 --- a/code/controls.py +++ b/code/controls.py @@ -96,7 +96,7 @@ def createVm(username, state, owner, contact, name, description, memory, disksiz session.save_or_update(machine) disk = Disk(machine=machine, guest_device_name='hda', size=disksize) - nic = NIC.query().filter_by(machine_id=None).first() + 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)