Commit c157fbd5 by Dudás Ádám

vm: destory attached disks of VM

parent 8b6005ff
......@@ -593,6 +593,11 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
vm_tasks.destroy.apply_async(args=[self.vm_name],
queue=queue_name).get()
# Destroy disks
act.update_state('DESTROYING DISKS')
for disk in self.disks.all():
disk.destroy()
act.finish(result="SUCCESS")
def destroy_async(self, user=None):
......
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