Commit 6fe3ab17 by Bach Dániel

vm: don't delete firewall host in migrate()

parent 2d9ec16f
......@@ -924,7 +924,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
# Destroy networks
with act.sub_activity('destroying_net'):
for net in self.interface_set.all():
net.destroy()
net.destroy(delete_host=False)
with act.sub_activity('migrate_vm'):
queue_name = self.get_remote_queue_name('vm')
......
......@@ -97,11 +97,11 @@ class Interface(Model):
args=[self.get_vmnetwork_desc()],
queue=self.instance.get_remote_queue_name('net'))
def destroy(self, user=None, task_uuid=None):
def destroy(self, delete_host=True, user=None, task_uuid=None):
net_tasks.destroy.apply_async(
args=[self.get_vmnetwork_desc()],
queue=self.instance.get_remote_queue_name('net'))
if self.host is not None:
if delete_host and self.host is not None:
self.host.delete()
@classmethod
......
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