rhtyd closed pull request #2846: Fix PowerReportMissing for new VRs
URL: https://github.com/apache/cloudstack/pull/2846
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java
b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java
index 60c0a994b4d..f8aad26b58c 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<Long,
VirtualMachine.PowerState> 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())
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services