Comment 2 for bug 1276154

Revision history for this message
Loganathan Parthipan (parthipan) wrote :

Also as part of this we should make sure that on resume nova sets vm_state to the correct state based on the power_state. Right now it assumes a successful resume to result in ACTIVE. But if it was suspended from PAUSED, at least as far as libvirt/kvm is concerned it will come back to 'paused' instead of 'running'. So we might need to do something like

+++ b/nova/compute/manager.py

         instance.power_state = self._get_power_state(context, instance)
- instance.vm_state = vm_states.ACTIVE
+
+ if instance.power_state == power_state.PAUSED:
+ instance.vm_state = vm_states.PAUSED
+ else:
+ instance.vm_state = vm_states.ACTIVE
         instance.task_state = None