mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-9626: Instance fails to start after unsuccesful compute
offering upgrade.
This commit is contained in:
parent
f231c8cd98
commit
542a2112ba
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in New Issue