From 1dc0611bcd356afdb8339777ba2d44e61d44af67 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ritschard Date: Mon, 16 Feb 2015 17:30:51 +0100 Subject: [PATCH] ensure agent reconciliation triggers events (cherry picked from commit 0ba75bcebde4e8a4773c7b31e5d8b88bf748a131) Signed-off-by: Rohit Yadav --- api/src/com/cloud/vm/VirtualMachine.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/com/cloud/vm/VirtualMachine.java b/api/src/com/cloud/vm/VirtualMachine.java index 2a6039fac36..b45ac7c9be9 100644 --- a/api/src/com/cloud/vm/VirtualMachine.java +++ b/api/src/com/cloud/vm/VirtualMachine.java @@ -145,7 +145,10 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I } public static boolean isVmStopped(State oldState, Event e, State newState) { - if (oldState == State.Stopping && newState == State.Stopped) { + if ((oldState == State.Stopping && newState == State.Stopped) || + (oldState == State.Running && + newState == State.Stopped && + e == Event.FollowAgentPowerOffReport)) { return true; } return false;