From 2f82f39ed7b10f052f686310a9e7e4d6d2a6ae58 Mon Sep 17 00:00:00 2001 From: Andrew Laski Date: Mon, 12 Nov 2012 17:06:05 -0500 Subject: 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 --- 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 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) -- cgit