Skip to content

Commit 11c1c2a

Browse files
Pearl1594Pearl Dsilva
authored andcommitted
Remove redundant metrics calaculation (#30)
Co-authored-by: Pearl Dsilva <[email protected]>
1 parent e7030a7 commit 11c1c2a

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

server/src/com/cloud/capacity/CapacityManagerImpl.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
245245

246246
s_logger.debug("release mem from host: " + hostId + ", old used: " + usedMem + ",reserved: " + reservedMem + ", total: " + totalMem + "; new used: " +
247247
capacityMemory.getUsedCapacity() + ",reserved:" + capacityMemory.getReservedCapacity() + "; movedfromreserved: " + moveFromReserved +
248-
",moveToReservered" + moveToReservered);
248+
"; moveToReservered: " + moveToReservered);
249249

250250
_capacityDao.update(capacityCpu.getId(), capacityCpu);
251251
_capacityDao.update(capacityMemory.getId(), capacityMemory);
@@ -811,7 +811,6 @@ public boolean postStateTransitionEvent(StateMachine2.Transition<State, Event> t
811811
@SuppressWarnings("unchecked")
812812
Pair<Long, Long> hosts = (Pair<Long, Long>)opaque;
813813
Long oldHostId = hosts.first();
814-
815814
State oldState = transition.getCurrentState();
816815
State newState = transition.getToState();
817816
Event event = transition.getEvent();
@@ -864,15 +863,6 @@ public boolean postStateTransitionEvent(StateMachine2.Transition<State, Event> t
864863
allocateVmCapacity(vm, fromLastHost);
865864
}
866865

867-
if (oldState == State.Migrating && newState == State.Running) {
868-
boolean fromLastHost = false;
869-
if (vm.getHostId().equals(vm.getLastHostId())) {
870-
s_logger.debug("VM starting again on the last host it was stopped on");
871-
fromLastHost = true;
872-
}
873-
allocateVmCapacity(vm, fromLastHost);
874-
}
875-
876866
if (newState == State.Stopped) {
877867
if (vm.getType() == VirtualMachine.Type.User) {
878868

0 commit comments

Comments
 (0)