Pragrammatically Answer HA question posted in vCenter since it will block CloudStack from continuously operating on the VM

This commit is contained in:
Kelven Yang 2014-01-28 17:16:04 -08:00
parent fa7d9ad1a8
commit 6987f23380
1 changed files with 6 additions and 11 deletions

View File

@ -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;