cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlsoren...@apache.org
Subject git commit: updated refs/heads/master to f429c66
Date Fri, 26 Apr 2013 04:37:19 GMT
Updated Branches:
  refs/heads/master efb4471dc -> f429c6687


Don't allow success to be reported when we fail to stop vm due to no agent
connection

BUG-ID: CLOUDSTACK-2195
Bugfix-for: 4.2
Reviewed-by: Edison Su
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1366950954 -0600


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

Branch: refs/heads/master
Commit: f429c6687b713cbbe1ca7f78bbf4869a32fe39f4
Parents: efb4471
Author: Marcus Sorensen <marcus@betterservers.com>
Authored: Thu Apr 25 22:35:54 2013 -0600
Committer: Marcus Sorensen <marcus@betterservers.com>
Committed: Thu Apr 25 22:35:54 2013 -0600

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java     |   11 +++++++----
 .../com/cloud/vm/VirtualMachineManagerImpl.java    |    2 ++
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f429c668/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index ebc5757..f58d6be 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2902,10 +2902,15 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
         }
 
         UserVO user = _userDao.findById(userId);
-
+        boolean status = false;
         try {
             VirtualMachineEntity vmEntity = _orchSrvc.getVirtualMachine(vm.getUuid());
-            vmEntity.stop(new Long(userId).toString());
+            status = vmEntity.stop(new Long(userId).toString());
+            if (status) {
+               return _vmDao.findById(vmId);
+            } else {
+               return null;
+            }
         } catch (ResourceUnavailableException e) {
             throw new CloudRuntimeException(
                     "Unable to contact the agent to stop the virtual machine "
@@ -2915,8 +2920,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
                     "Unable to contact the agent to stop the virtual machine "
                             + vm, e);
         }
-
-        return _vmDao.findById(vmId);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f429c668/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 252fc99..b0d6378 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -1136,7 +1136,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
             vmGuru.finalizeStop(profile, answer);
 
         } catch (AgentUnavailableException e) {
+            s_logger.warn("Unable to stop vm, agent unavailable: " + e.toString());
         } catch (OperationTimedoutException e) {
+            s_logger.warn("Unable to stop vm, operation timed out: " + e.toString());
         } finally {
             if (!stopped) {
                 if (!forced) {


Mime
View raw message