Commit 12846245 by Dudás Ádám

vm: allow disks to be overridden from kwargs when creating VM from template

parent 2143ee09
...@@ -366,7 +366,8 @@ class Instance(VirtualMachineDescModel, TimeStampedModel): ...@@ -366,7 +366,8 @@ class Instance(VirtualMachineDescModel, TimeStampedModel):
# save instance # save instance
# create related entities # create related entities
for disk in template.disks.all(): disks = kwargs.get('disks', default=template.disks.all())
for disk in disks:
inst.disks.add(disk.get_exclusive()) inst.disks.add(disk.get_exclusive())
for iftmpl in template.interface_set.all(): for iftmpl in template.interface_set.all():
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 sign in to comment