Skip to content

Commit 223a373

Browse files
resmorohityadavcloud
authored andcommitted
orchestration: Fixes #2845 PowerReportMissing for new VRs (#2846)
Fixes #2845
1 parent 8aff96c commit 223a373

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,12 @@ private void processReport(long hostId, Map<Long, VirtualMachine.PowerState> tra
123123

124124
Date vmStateUpdateTime = instance.getPowerStateUpdateTime();
125125
if (vmStateUpdateTime == null) {
126-
s_logger.warn("VM state was updated but update time is null?! vm id: " + instance.getId());
127-
vmStateUpdateTime = currentTime;
126+
s_logger.warn("VM power state update time is null, falling back to update time for vm id: " + instance.getId());
127+
vmStateUpdateTime = instance.getUpdateTime();
128+
if (vmStateUpdateTime == null) {
129+
s_logger.warn("VM update time is null, falling back to creation time for vm id: " + instance.getId());
130+
vmStateUpdateTime = instance.getCreated();
131+
}
128132
}
129133

130134
if (s_logger.isDebugEnabled())

0 commit comments

Comments
 (0)