From d879dc9e0d28aa203426729c6cfea48bdbfa3cfd Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Wed, 9 May 2012 16:33:57 -0400 Subject: Avoid unnecessary inst lookup in vmops _shutdown. Updates the XenServer vmops.py _shutdown function so that it avoids calling get_info/_get_vm_opaque_ref with the instance name. Since _shutdown already has the vm_ref there is no need to make this call. This fixes an issue where 'RESIZE' was broken when resizing to the same host. Fixes LP Bug #997313. Change-Id: Ic5a1a0f92df9a2b809aef20a250843bf48402d75 --- nova/virt/xenapi/vmops.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 6cc0e2554..c60a32461 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -991,7 +991,8 @@ class VMOps(object): def _shutdown(self, instance, vm_ref, hard=True): """Shutdown an instance.""" - state = self.get_info(instance)['state'] + vm_rec = self._session.call_xenapi("VM.get_record", vm_ref) + state = VMHelper.compile_info(vm_rec)['state'] if state == power_state.SHUTDOWN: LOG.warn(_("VM already halted, skipping shutdown..."), instance=instance) -- cgit