summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Laski <andrew.laski@rackspace.com>2012-11-12 17:06:05 -0500
committerAndrew Laski <andrew.laski@rackspace.com>2012-11-13 11:34:52 -0500
commit2f82f39ed7b10f052f686310a9e7e4d6d2a6ae58 (patch)
treecdd9ec05b8f541c12065cfc5d5685fcf60251cde
parentfe12b264fdcb1084934b3ec69c7e3fa78522356f (diff)
Try hard shutdown if clean fails on resize down
In the xenapi driver, a clean shutdown is attempted before a resize down. If the Xenapi raises an exception it is logged and ignored and the resize will fail later in the process. This adds a hard shutdown attempt if the clean shutdown fails. Change-Id: I458931a19dd2375ad7142d60cb8b6ed274de9483
-rw-r--r--nova/virt/xenapi/vmops.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 19077c7df..11ee7b04b 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -692,7 +692,10 @@ class VMOps(object):
instance=instance)
# 2. Power down the instance before resizing
- vm_utils.clean_shutdown_vm(self._session, instance, vm_ref)
+ if not vm_utils.clean_shutdown_vm(self._session, instance, vm_ref):
+ LOG.debug(_("Clean shutdown did not complete successfully, "
+ "trying hard shutdown."), instance=instance)
+ vm_utils.hard_shutdown_vm(self._session, instance, vm_ref)
self._update_instance_progress(context, instance,
step=2,
total_steps=RESIZE_TOTAL_STEPS)