cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject [13/33] git commit: updated refs/heads/master to 90262a8
Date Fri, 28 Feb 2014 23:37:33 GMT
Pragrammatically Answer HA question posted in vCenter since it will block CloudStack from continuously
operating on the VM


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4a414d39
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4a414d39
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4a414d39

Branch: refs/heads/master
Commit: 4a414d399004aa9f848ccdd428f64496a0176596
Parents: 85adaf8
Author: Kelven Yang <kelveny@gmail.com>
Authored: Tue Jan 28 17:16:04 2014 -0800
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Fri Feb 28 15:35:58 2014 -0800

----------------------------------------------------------------------
 .../hypervisor/vmware/mo/VirtualMachineMO.java  | 23 ++++++++------------
 1 file changed, 9 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4a414d39/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
----------------------------------------------------------------------
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 3e83bb6..663adbf 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
@@ -190,10 +190,10 @@ public class VirtualMachineMO extends BaseMO {
     }
 
     public boolean powerOn() throws Exception {
-        if(getResetSafePowerState() == VirtualMachinePowerState.POWERED_ON)
-                return true;
+        if (getResetSafePowerState() == VirtualMachinePowerState.POWERED_ON)
+            return true;
 
-                ManagedObjectReference morTask = _context.getService().powerOnVMTask(_mor,
null);
+        ManagedObjectReference morTask = _context.getService().powerOnVMTask(_mor, null);
         // Monitor VM questions
         final Boolean[] flags = {false};
         final VirtualMachineMO vmMo = this;
@@ -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;


Mime
View raw message