diff options
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 52d935fa4..3e2f3527b 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -1079,7 +1079,10 @@ class VMOps(object): def _shutdown_rescue(self, rescue_vm_ref): """Shutdown a rescue instance.""" - self._session.call_xenapi("VM.hard_shutdown", rescue_vm_ref) + vm_rec = self._session.call_xenapi("VM.get_record", rescue_vm_ref) + state = VMHelper.compile_info(vm_rec)['state'] + if state != power_state.SHUTDOWN: + self._session.call_xenapi("VM.hard_shutdown", rescue_vm_ref) def _destroy_vdis(self, instance, vm_ref): """Destroys all VDIs associated with a VM.""" |
