ensure agent reconciliation triggers events (cherry picked from commit 0ba75bcebde4e8a4773c7b31e5d8b88bf748a131) Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1dc0611b Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1dc0611b Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1dc0611b Branch: refs/heads/hotfix/scp-exception Commit: 1dc0611bcd356afdb8339777ba2d44e61d44af67 Parents: 9bf2626 Author: Pierre-Yves Ritschard <p...@spootnik.org> Authored: Mon Feb 16 17:30:51 2015 +0100 Committer: Rohit Yadav <rohit.ya...@shapeblue.com> Committed: Wed Feb 18 11:15:44 2015 +0530 ---------------------------------------------------------------------- api/src/com/cloud/vm/VirtualMachine.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1dc0611b/api/src/com/cloud/vm/VirtualMachine.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/vm/VirtualMachine.java b/api/src/com/cloud/vm/VirtualMachine.java index 2a6039f..b45ac7c 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;