Commit 8807a828 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Support many NICs when creating vms

Support arbitraty number of NICs when creating Ganeti instances.
parent bc4f2915
......@@ -482,7 +482,7 @@ def create_instance_diagnostic(vm, message, source, level="DEBUG", etime=None,
details=details)
def create_instance(vm, public_nic, flavor, image):
def create_instance(vm, nics, flavor, image):
"""`image` is a dictionary which should contain the keys:
'backend_id', 'format' and 'metadata'
......@@ -507,7 +507,7 @@ def create_instance(vm, public_nic, flavor, image):
kw['disks'][0]['provider'] = provider
kw['disks'][0]['origin'] = flavor.disk_origin
kw['nics'] = [public_nic]
kw['nics'] = nics
if vm.backend.use_hotplug():
kw['hotplug'] = True
# Defined in settings.GANETI_CREATEINSTANCE_KWARGS
......
......@@ -205,7 +205,7 @@ def create(userid, name, password, flavor, image, metadata={},
transaction.commit()
try:
jobID = backend.create_instance(vm, nic, flavor, image)
jobID = backend.create_instance(vm, [nic], flavor, image)
# At this point the job is enqueued in the Ganeti backend
vm.backendjobid = jobID
vm.task = "BUILD"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment