Skip to content

Commit fce69fb

Browse files
authored
VM Power state optimization (#12463)
* Publish VM Power state optimization (PowerReportMissing) * Fix logging
1 parent ff0cfc9 commit fce69fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

engine/orchestration/src/main/java/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected void updateAndPublishVmPowerStates(long hostId, Map<Long, VirtualMachi
8989
return;
9090
}
9191
for (Long vmId : vmIds) {
92-
if (!notUpdated.containsKey(vmId)) {
92+
if (MapUtils.isEmpty(notUpdated) || !notUpdated.containsKey(vmId)) {
9393
logger.debug("VM state report is updated. {}, {}, power state: {}",
9494
() -> hostCache.get(hostId), () -> vmCache.get(vmId), () -> instancePowerStates.get(vmId));
9595
_messageBus.publish(null, VirtualMachineManager.Topics.VM_POWER_STATE,
@@ -158,8 +158,8 @@ private void processMissingVmReport(long hostId, Set<Long> vmIds, boolean force)
158158
// an update might have occurred that we should not override in case of out of band migration
159159
instancePowerStates.put(instance.getId(), VirtualMachine.PowerState.PowerReportMissing);
160160
} else {
161-
logger.debug("vm id: {} - time since last state update({} ms) has not passed graceful period yet",
162-
instance.getId(), milliSecondsSinceLastStateUpdate);
161+
logger.debug("vm id: {} - time since last state update({} ms) has not passed graceful period ({} ms) yet",
162+
instance.getId(), milliSecondsSinceLastStateUpdate, milliSecondsGracefulPeriod);
163163
}
164164
}
165165
updateAndPublishVmPowerStates(hostId, instancePowerStates, startTime);

0 commit comments

Comments
 (0)