Commit cd43c8bd by Guba Sándor

instance/node: fixed monitoring for missin vms

parent e056cb01
......@@ -286,8 +286,13 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
def vm_state_changed(self, new_state):
act = InstanceActivity.create(code_suffix='vm_state_changed',
act = InstanceActivity.create(
code_suffix='monitor_event_%s' % new_state,
if new_state == "STOPPED":
self.vnc_port = None
self.node = None
except ActivityInProgressError:
pass # discard state change if another activity is in progress.
......@@ -194,6 +194,8 @@ class Node(TimeStampedModel):
except KeyError:'Node %s update: instance %s missing from '
'libvirt', self, i['id'])
# Set state to STOPPED when instance is missing
if d != i['state']:'Node %s update: instance %s state changed '
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