mirror of
https://github.com/apache/cloudstack
synced 2026-08-08 23:55:51 +00:00
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
Block a user