mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Bug 9273: resource cont going -ve
adding addtional check that ensure we decrease the count in advanceStart only on new vm creation.
This commit is contained in:
parent
3b75abbde7
commit
435c20c0cc
@ -738,7 +738,8 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
||||
}
|
||||
} finally {
|
||||
if (startedVm == null) {
|
||||
if (vm.getType().equals(VirtualMachine.Type.User)) {
|
||||
// decrement only for user VM's and newly created VM
|
||||
if (vm.getType().equals(VirtualMachine.Type.User) && (vm.getLastHostId() == null)) {
|
||||
_accountMgr.decrementResourceCount(vm.getAccountId(), ResourceType.user_vm);
|
||||
}
|
||||
changeState(vm, Event.OperationFailed, null, work, Step.Done);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user