cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [2/6] git commit: updated refs/heads/master to 17653a8
Date Fri, 09 Dec 2016 20:01:50 GMT
CLOUDSTACK-9626: Instance fails to start after unsuccesful compute
offering  upgrade.


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

Branch: refs/heads/master
Commit: 542a2112ba0315420486c975a7323c4a0aae1d53
Parents: f231c8c
Author: Sudhansu <sudhansu.sahu@accelerite.com>
Authored: Tue Nov 29 10:48:04 2016 +0530
Committer: Sudhansu <sudhansu.sahu@accelerite.com>
Committed: Fri Dec 9 17:06:13 2016 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/542a2112/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 a93b41b..29a6bbc 100644
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -1759,13 +1759,15 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
                 } finally {
                     if (!success) {
                         _itMgr.upgradeVmDb(vmId, currentServiceOffering.getId()); // rollback
-                        if (newServiceOffering.isDynamic()) {
-                            removeCustomOfferingDetails(vmId);
-                        }
+
                         // Decrement CPU and Memory count accordingly.
                         if (newCpu > currentCpu) {
                             _resourceLimitMgr.decrementResourceCount(caller.getAccountId(),
ResourceType.cpu, new Long(newCpu - currentCpu));
                         }
+                        //restoring old service offering will take care of removing new SO.
+                        if(currentServiceOffering.isDynamic()){
+                            saveCustomOfferingDetails(vmId, currentServiceOffering);
+                        }
 
                         if (memoryDiff > 0) {
                             _resourceLimitMgr.decrementResourceCount(caller.getAccountId(),
ResourceType.memory, new Long(memoryDiff));


Mime
View raw message