Commit 62228069 by Dudás Ádám

vm: 'shutdown' method for network interfaces

Instead of 'delete_host' parameter for 'destroy'.
parent 1d35cf35
......@@ -945,7 +945,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
# Destroy networks
with act.sub_activity('destroying_net'):
for net in self.interface_set.all():
net.destroy(delete_host=False)
net.shutdown()
# Suspend vm
with act.sub_activity('suspending'):
......@@ -1075,7 +1075,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
# Destroy networks
with act.sub_activity('destroying_net'):
for net in self.interface_set.all():
net.destroy(delete_host=False)
net.shutdown()
with act.sub_activity('migrate_vm'):
queue_name = self.get_remote_queue_name('vm')
......
......@@ -142,11 +142,14 @@ class Interface(Model):
args=[self.get_vmnetwork_desc()],
queue=self.instance.get_remote_queue_name('net'))
def destroy(self, delete_host=True, user=None, task_uuid=None):
def shutdown(self, user=None, task_uuid=None):
net_tasks.destroy.apply_async(
args=[self.get_vmnetwork_desc()],
queue=self.instance.get_remote_queue_name('net'))
if delete_host and self.host is not None:
def destroy(self, user=None, task_uuid=None):
self.shutdown(user, task_uuid)
if self.host is not None:
self.host.delete()
def save_as_template(self, instance_template):
......
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