From c4d6f9b7a87d8549bcc7efc2c8e529636d0a1d86 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Tue, 15 Sep 2015 12:48:56 +0200 Subject: [PATCH] CLOUDSTACK-8848: extra state to handle; no power report from host --- .../cloud/vm/VirtualMachineManagerImpl.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index 9dea90a41d15..e14f8b0f4f78 100644 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -3699,9 +3699,11 @@ private void HandlePowerStateReport(final String subject, final String senderAdd break; case PowerOff: - case PowerReportMissing: handlePowerOffReportWithNoPendingJobsOnVM(vm); break; + case PowerReportMissing: + handlePowerReportMissingWithNoPendingJobsOnVM(vm); + break; // PowerUnknown shouldn't be reported, it is a derived // VM power state from host state (host un-reachable) @@ -3852,6 +3854,32 @@ private void handlePowerOffReportWithNoPendingJobsOnVM(final VMInstanceVO vm) { } } + private void handlePowerReportMissingWithNoPendingJobsOnVM(VMInstanceVO vm) { + switch (vm.getState()) { + case Starting: + case Stopping: + case Migrating: + s_logger.info("VM " + vm.getInstanceName() + " is believed to be at " + vm.getState() + " but a power-report is missing for this VM"); + // investigative action?? + break; + + case Running: + case Stopped: + s_logger.info("VM " + vm.getInstanceName() + " is believed to be at " + vm.getState() + " but a power-report is missing for this VM"); + // corrective action? + break; + + case Destroyed: + case Expunging: + break; + + case Error: + default: + break; + } + } + + private void scanStalledVMInTransitionStateOnUpHost(final long hostId) { // // Check VM that is stuck in Starting, Stopping, Migrating states, we won't check