From 137e0d7458ff786aad339aac3f0021ee337d5290 Mon Sep 17 00:00:00 2001 From: Andrew Laski Date: Thu, 15 Nov 2012 14:51:12 -0500 Subject: Issue a hard shutdown if clean fails on resize up In the xenapi driver, a clean shutdown is attempted during a resize up. 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. The resize up case was overlooked in I458931a19dd2375ad7142d60cb8b6ed274de9483 so this adds it for consistency and error handling. Change-Id: Idf4a20433b9d5726db4e54d5cf61a93db57d4cc9 --- nova/virt/xenapi/vmops.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index b8f167105..cdfa3685f 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -743,7 +743,10 @@ class VMOps(object): total_steps=RESIZE_TOTAL_STEPS) # 3. Now power down the instance - 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=3, total_steps=RESIZE_TOTAL_STEPS) -- cgit