incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject git commit: CLOUDSTACK-118 Status of host resorce stuck in ErrorInMaintenance
Date Mon, 08 Oct 2012 06:17:37 GMT
Updated Branches:
  refs/heads/master a964d7859 -> a5bca0999


CLOUDSTACK-118 Status of host resorce stuck in ErrorInMaintenance


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/a5bca099
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/a5bca099
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/a5bca099

Branch: refs/heads/master
Commit: a5bca0999aa010252b1390c4db6dc5023967ab06
Parents: a964d78
Author: Mice Xia <mice_xia@tcloudcomputing.com>
Authored: Mon Oct 8 14:05:05 2012 +0800
Committer: Mice Xia <mice_xia@tcloudcomputing.com>
Committed: Mon Oct 8 14:05:05 2012 +0800

----------------------------------------------------------------------
 api/src/com/cloud/resource/ResourceState.java      |    1 +
 .../com/cloud/vm/VirtualMachineManagerImpl.java    |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a5bca099/api/src/com/cloud/resource/ResourceState.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/resource/ResourceState.java b/api/src/com/cloud/resource/ResourceState.java
index bb4c7e9..6e0afa6 100755
--- a/api/src/com/cloud/resource/ResourceState.java
+++ b/api/src/com/cloud/resource/ResourceState.java
@@ -113,6 +113,7 @@ public enum ResourceState {
         s_fsm.addTransition(ResourceState.ErrorInMaintenance, Event.Disable, ResourceState.Disabled);
         s_fsm.addTransition(ResourceState.ErrorInMaintenance, Event.DeleteHost, ResourceState.Disabled);
         s_fsm.addTransition(ResourceState.ErrorInMaintenance, Event.InternalEnterMaintenance,
ResourceState.Maintenance);
+        s_fsm.addTransition(ResourceState.ErrorInMaintenance, Event.AdminCancelMaintenance,
ResourceState.Enabled);
         s_fsm.addTransition(ResourceState.Error, Event.InternalCreated, ResourceState.Error);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a5bca099/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
index b208177..9230f4a 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -1995,7 +1995,10 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager,
Listene
             }
             if (vm.getHostId() == null || hostId != vm.getHostId()) {
                 try {
-                    stateTransitTo(vm, VirtualMachine.Event.AgentReportMigrated, hostId);
+                    ItWorkVO workItem = _workDao.findByOutstandingWork(vm.getId(), State.Migrating);
+                    if(workItem == null){
+                        stateTransitTo(vm, VirtualMachine.Event.AgentReportMigrated, hostId);
+                    }
                 } catch (NoTransitionException e) {
                 }
             }


Mime
View raw message