Commit 26d113b3 by tarokkk

defining virtual machine operations

parent c4776f8e
...@@ -408,20 +408,36 @@ class Instance(BaseResourceConfigModel, TimeStampedModel): ...@@ -408,20 +408,36 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
tasks.create.apply_async(instance, queue=self.node + ".vm").get() tasks.create.apply_async(instance, queue=self.node + ".vm").get()
def stop(self): def stop(self):
# TODO implement ''' Suspend the machine and save it's memory onto disk
pass TODO: where to save?
'''
manager.stop.apply_async(self)
def resume(self): def resume(self):
# TODO implement ''' Resume suspended/stopped machine.
pass '''
manager.resume.apply_async(self)
def poweroff(self): def poweroff(self):
# TODO implement ''' Power off virtual machine
pass '''
manager.poweroff.apply_async(self)
def recreate(self):
''' Recreate the virtual machine from scratch.
No reschedule.
'''
manager.recreate.apply_async(self)
def resubmit(self):
''' Resubmit the virtual machine and reschedule it.
'''
manager.resubmit.apply_async(self)
def restart(self): def restart(self):
# TODO implement ''' Restart virtual machine with reset signal.
pass '''
manager.restart.apply_async(self)
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