diff options
| author | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2012-03-21 18:59:57 +0000 |
|---|---|---|
| committer | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2012-03-21 19:07:28 +0000 |
| commit | 4944a612e0926cfe542e0cb146cc9fabf70256f6 (patch) | |
| tree | 54c9a4d65e9e8f5de20c3bff981e55ee3e44e974 | |
| parent | f934beea9f22d8320d9b5ba9eb7051050c649122 (diff) | |
Only shutdown rescue instance if it's not already shutdown
Fixes bug 961507
Change-Id: Ib48d6ea3ad7c89e922cde8e0c0952d1bee2ca7bf
| -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.""" |
