From 6987f23380c23aaf38856367f2acb4bf40fb7dd5 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Tue, 28 Jan 2014 17:16:04 -0800 Subject: [PATCH] Pragrammatically Answer HA question posted in vCenter since it will block CloudStack from continuously operating on the VM --- .../hypervisor/vmware/mo/VirtualMachineMO.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java index 263c656868e..663adbff9cd 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java @@ -248,17 +248,12 @@ public class VirtualMachineMO extends BaseMO { } }); - try { - boolean result = _context.getVimClient().waitForTask(morTask); - if (result) { - _context.waitForTaskProgressDone(morTask); - return true; - } else { - s_logger.error("VMware powerOnVM_Task failed due to " + TaskMO.getTaskFailureInfo(_context, morTask)); - } - } finally { - // make sure to let VM question monitor exit - flags[0] = true; + boolean result = _context.getVimClient().waitForTask(morTask); + if (result) { + _context.waitForTaskProgressDone(morTask); + return true; + } else { + s_logger.error("VMware powerOnVM_Task failed due to " + TaskMO.getTaskFailureInfo(_context, morTask)); } return false;