Skip to content

Commit c4657a9

Browse files
committed
engine/orchestration: fix missing vm powerstate update vm state
Fixes #10406 VMs were not moving to Stopped state when PowerReportMissing is processed. Signed-off-by: Abhishek Kumar <[email protected]>
1 parent 789f94b commit c4657a9

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
@@ -83,13 +83,13 @@ private void updateAndPublishVmPowerStates(long hostId, Map<Long, VirtualMachine
8383
return;
8484
}
8585
Set<Long> vmIds = instancePowerStates.keySet();
86-
Map<Long, VirtualMachine.PowerState> notUpdated = _instanceDao.updatePowerState(instancePowerStates, hostId,
87-
updateTime);
86+
Map<Long, VirtualMachine.PowerState> notUpdated =
87+
_instanceDao.updatePowerState(instancePowerStates, hostId, updateTime);
8888
if (notUpdated.size() > vmIds.size()) {
8989
return;
9090
}
9191
for (Long vmId : vmIds) {
92-
if (!notUpdated.isEmpty() && !notUpdated.containsKey(vmId)) {
92+
if (!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,

0 commit comments

Comments
 (0)