release capacity if current state is in starting and not transit to running

This commit is contained in:
Edison Su 2011-08-04 14:26:14 -07:00
parent e5478457ee
commit c37d75fc00
1 changed files with 1 additions and 7 deletions

View File

@ -535,13 +535,7 @@ public class CapacityManagerImpl implements CapacityManager, StateListener<State
+ vm.getLastHostId() + " new host id: " + vm.getHostId() + " host id before state transition: " + oldHostId);
if (oldState == State.Starting) {
if (event == Event.OperationFailed) {
releaseVmCapacity(vm, false, false, oldHostId);
} else if (event == Event.OperationRetry) {
releaseVmCapacity(vm, false, false, oldHostId);
} else if (event == Event.AgentReportStopped) {
releaseVmCapacity(vm, false, false, oldHostId);
} else if(event == Event.AgentReportMigrated) {
if(newState != State.Running) {
releaseVmCapacity(vm, false, false, oldHostId);
}
} else if (oldState == State.Running) {