mirror of https://github.com/apache/cloudstack.git
don't put cpu/mem into reserved capacity if failed to start/stop vm
This commit is contained in:
parent
0826066f7f
commit
ccdfe240bd
|
|
@ -622,7 +622,7 @@ public class CapacityManagerImpl implements CapacityManager, StateListener<State
|
|||
} else if (event == Event.OperationRetry) {
|
||||
releaseVmCapacity(vm, false, false, oldHostId);
|
||||
} else if (event == Event.AgentReportStopped) {
|
||||
releaseVmCapacity(vm, false, true, oldHostId);
|
||||
releaseVmCapacity(vm, false, false, oldHostId);
|
||||
} else if(event == Event.AgentReportMigrated) {
|
||||
releaseVmCapacity(vm, false, false, oldHostId);
|
||||
}
|
||||
|
|
@ -636,7 +636,7 @@ public class CapacityManagerImpl implements CapacityManager, StateListener<State
|
|||
if (event == Event.AgentReportStopped) {
|
||||
/* Release capacity from original host */
|
||||
releaseVmCapacity(vm, false, false, vm.getLastHostId());
|
||||
releaseVmCapacity(vm, false, true, oldHostId);
|
||||
releaseVmCapacity(vm, false, false, oldHostId);
|
||||
} else if (event == Event.OperationFailed) {
|
||||
/* Release from dest host */
|
||||
releaseVmCapacity(vm, false, false, oldHostId);
|
||||
|
|
@ -644,8 +644,10 @@ public class CapacityManagerImpl implements CapacityManager, StateListener<State
|
|||
releaseVmCapacity(vm, false, false, vm.getLastHostId());
|
||||
}
|
||||
} else if (oldState == State.Stopping) {
|
||||
if (event == Event.AgentReportStopped || event == Event.OperationSucceeded) {
|
||||
if (event == Event.OperationSucceeded) {
|
||||
releaseVmCapacity(vm, false, true, oldHostId);
|
||||
} else if (event == Event.AgentReportStopped) {
|
||||
releaseVmCapacity(vm, false, false, oldHostId);
|
||||
} else if(event == Event.AgentReportMigrated) {
|
||||
releaseVmCapacity(vm, false, false, oldHostId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue