Commit 511666cb by Guba Sándor

vm: addign remove() method

parent 516a0b21
...@@ -625,6 +625,30 @@ class Instance(BaseResourceConfigModel, TimeStampedModel): ...@@ -625,6 +625,30 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
local_tasks.save_as.apply_async(args=[self, user], local_tasks.save_as.apply_async(args=[self, user],
queue="") queue="")
def remove(self, user=None, task_uuid=None):
""" Remove Instance with its networks.
act = InstanceActivity(activity_code='vm.Instance.remove')
act.instance = self
act.user = user
act.started =
act.task_uuid = task_uuid
queue_name = + ".vm"
# Delete instance
# Delete networks
for net in self.interface_set.all():
def remove_async(self, user=None):
""" Asyncron remove()
local_tasks.delete.apply_async(args=[self, user],
def renew(self, which='both'): def renew(self, which='both'):
"""Renew virtual machine instance leases. """Renew virtual machine instance leases.
""" """
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