cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject git commit: updated refs/heads/master to 46a6530
Date Thu, 21 Jul 2016 15:05:39 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 9be93c6e9 -> 46a6530e7


Revert "Merge pull request #1594 from nvazquez/vmnetworkmapissue"

This reverts commit 9be93c6e9022f35a2cd3dab6a099d69a77dd72ff, reversing
changes made to 8d45d711bff631efb45954631c123dcb2beffb3c.


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

Branch: refs/heads/master
Commit: 46a6530e7059aded3c061c2609a15c947d9a75d3
Parents: 9be93c6
Author: Will Stevens <williamstevens@gmail.com>
Authored: Thu Jul 21 11:04:10 2016 -0400
Committer: Will Stevens <williamstevens@gmail.com>
Committed: Thu Jul 21 11:04:10 2016 -0400

----------------------------------------------------------------------
 .../com/cloud/vm/VirtualMachineManagerImpl.java | 16 +++++++---------
 server/src/com/cloud/vm/UserVmManagerImpl.java  | 20 --------------------
 2 files changed, 7 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/46a6530e/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index a1cf766..9523b92 100644
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -1428,15 +1428,6 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
         advanceStop(vm, cleanUpEvenIfUnableToStop);
     }
 
-    /**
-     * Send StopCommand to stop vm.<br/>
-     * <strong>Not releasing network resources until expunge command is sent</strong>
-     * @param vm virtual machine
-     * @param cleanUpEvenIfUnableToStop if true -> cleanup even if vm cannot be stopped.
if false -> not cleaning up if vm cannot be stopped.
-     * @throws AgentUnavailableException
-     * @throws OperationTimedoutException
-     * @throws ConcurrentOperationException
-     */
     private void advanceStop(final VMInstanceVO vm, final boolean cleanUpEvenIfUnableToStop)
throws AgentUnavailableException, OperationTimedoutException,
     ConcurrentOperationException {
         final State state = vm.getState();
@@ -1586,6 +1577,13 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
         }
 
         try {
+            _networkMgr.release(profile, cleanUpEvenIfUnableToStop);
+            s_logger.debug("Successfully released network resources for the vm " + vm);
+        } catch (final Exception e) {
+            s_logger.warn("Unable to release some network resources.", e);
+        }
+
+        try {
             if (vm.getHypervisorType() != HypervisorType.BareMetal) {
                 volumeMgr.release(profile);
                 s_logger.debug("Successfully released storage resources for the vm " + vm);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/46a6530e/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 dd7e817..9eddf6d 100644
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2046,9 +2046,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
             return false;
         }
         try {
-
-            releaseNetworkResourcesOnExpunge(vm.getId());
-
             List<VolumeVO> rootVol = _volsDao.findByInstanceAndType(vm.getId(), Volume.Type.ROOT);
             // expunge the vm
             _itMgr.advanceExpunge(vm.getUuid());
@@ -2089,23 +2086,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
         }
     }
 
-    /**
-     * Release network resources, it was done on vm stop previously.
-     * @param id vm id
-     * @throws ConcurrentOperationException
-     * @throws ResourceUnavailableException
-     */
-    private void releaseNetworkResourcesOnExpunge(long id) throws ConcurrentOperationException,
ResourceUnavailableException {
-        final VMInstanceVO vmInstance = _vmDao.findById(id);
-        if (vmInstance != null){
-            final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vmInstance);
-            _networkMgr.release(profile, false);
-        }
-        else {
-            s_logger.error("Couldn't find vm with id = " + id + ", unable to release network
resources");
-        }
-    }
-
     private boolean cleanupVmResources(long vmId) {
         boolean success = true;
         // Remove vm from security groups


Mime
View raw message