From b279261a67b95d0466b5833893e8906fb5658668 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Mon, 17 Sep 2018 17:30:47 +0200 Subject: [PATCH] Fix PowerReportMissing for new VRs --- .../com/cloud/vm/VirtualMachinePowerStateSyncImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java index 60c0a994b4df..f8aad26b58c1 100644 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java @@ -123,8 +123,12 @@ private void processReport(long hostId, Map tra 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())