Commit dd6a8445 by Bach Dániel

vm: review resultant state

Closes #382
parent e5276242
...@@ -377,7 +377,12 @@ class DeployOperation(InstanceOperation): ...@@ -377,7 +377,12 @@ class DeployOperation(InstanceOperation):
self.instance.allocate_node() self.instance.allocate_node()
# Deploy virtual images # Deploy virtual images
try:
self.instance._deploy_disks(parent_activity=activity) self.instance._deploy_disks(parent_activity=activity)
except:
self.instance.yield_node()
self.instance.yield_vnc_port()
raise
# Deploy VM on remote machine # Deploy VM on remote machine
if self.instance.state not in ['PAUSED']: if self.instance.state not in ['PAUSED']:
...@@ -452,6 +457,9 @@ class DestroyOperation(InstanceOperation): ...@@ -452,6 +457,9 @@ class DestroyOperation(InstanceOperation):
required_perms = () required_perms = ()
resultant_state = 'DESTROYED' resultant_state = 'DESTROYED'
def on_abort(self, activity, error):
activity.resultant_state = None
def _operation(self, activity, system): def _operation(self, activity, system):
# Destroy networks # Destroy networks
with activity.sub_activity( with activity.sub_activity(
......
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