orchestration: Fixes #2845 PowerReportMissing for new VRs (#2846)

Fixes #2845
This commit is contained in:
René Moser 2018-09-18 08:04:31 +02:00 committed by Rohit Yadav
parent 8aff96cfc5
commit 223a373e53
1 changed files with 6 additions and 2 deletions

View File

@ -123,8 +123,12 @@ public class VirtualMachinePowerStateSyncImpl implements VirtualMachinePowerStat
Date vmStateUpdateTime = instance.getPowerStateUpdateTime();
if (vmStateUpdateTime == null) {
s_logger.warn("VM state was updated but update time is null?! vm id: " + instance.getId());
vmStateUpdateTime = currentTime;
s_logger.warn("VM power state update time is null, falling back to update time for vm id: " + instance.getId());
vmStateUpdateTime = instance.getUpdateTime();
if (vmStateUpdateTime == null) {
s_logger.warn("VM update time is null, falling back to creation time for vm id: " + instance.getId());
vmStateUpdateTime = instance.getCreated();
}
}
if (s_logger.isDebugEnabled())