Commit 8c7219d6 by Guba Sándor

vm: fixing Instance create_from_template

parent cb9a7a5b
...@@ -358,11 +358,14 @@ class Instance(BaseResourceConfigModel, TimeStampedModel): ...@@ -358,11 +358,14 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
inst.disks.add(disk.get_exclusive()) inst.disks.add(disk.get_exclusive())
# create related entities # create related entities
for iftmpl in template.interface_set.all(): for iftmpl in template.interface_set.all():
i = Interface.create_from_template(instance=inst, template=iftmpl) i = Interface.create_from_template(instance=inst,
template=iftmpl,
owner=owner)
if i.host: if i.host:
i.host.enable_net() i.host.enable_net()
port, proto = ACCESS_PROTOCOLS[i.access_method][1:3] port, proto = ACCESS_PROTOCOLS[i.instance.access_method][1:3]
i.host.add_port(proto, i.get_port(), port) # TODO fix this port fw
i.host.add_port(proto, private=port)
return inst return inst
......
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