You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ko...@apache.org on 2014/12/10 05:49:47 UTC

git commit: updated refs/heads/master to f6854bc

Repository: cloudstack
Updated Branches:
  refs/heads/master f00a62879 -> f6854bc98


CLOUDSTACK-8054: No event generated on host maintenance mode is completed
Added events for host maintenance start and completion


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

Branch: refs/heads/master
Commit: f6854bc9844ce94815b99032d508bda43ac1a0c1
Parents: f00a628
Author: Koushik Das <ko...@apache.org>
Authored: Wed Dec 10 10:18:34 2014 +0530
Committer: Koushik Das <ko...@apache.org>
Committed: Wed Dec 10 10:18:34 2014 +0530

----------------------------------------------------------------------
 server/src/com/cloud/resource/ResourceManagerImpl.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f6854bc9/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 5cbb7f3..b0215e7 100644
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -32,6 +32,7 @@ import javax.naming.ConfigurationException;
 
 import com.cloud.capacity.CapacityState;
 import com.cloud.vm.VirtualMachine;
+
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
 import org.apache.cloudstack.api.command.admin.cluster.DeleteClusterCmd;
@@ -93,7 +94,9 @@ import com.cloud.dc.dao.HostPodDao;
 import com.cloud.deploy.PlannerHostReservationVO;
 import com.cloud.deploy.dao.PlannerHostReservationDao;
 import com.cloud.event.ActionEvent;
+import com.cloud.event.ActionEventUtils;
 import com.cloud.event.EventTypes;
+import com.cloud.event.EventVO;
 import com.cloud.exception.AgentUnavailableException;
 import com.cloud.exception.DiscoveryException;
 import com.cloud.exception.InvalidParameterValueException;
@@ -1181,6 +1184,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
             throw new CloudRuntimeException(err + e.getMessage());
         }
 
+        ActionEventUtils.onStartedActionEvent(CallContext.current().getCallingUserId(), CallContext.current().getCallingAccountId(), EventTypes.EVENT_MAINTENANCE_PREPARE, "starting maintenance for host " + hostId, true, 0);
         _agentMgr.pullAgentToMaintenance(hostId);
 
         /* TODO: move below to listener */
@@ -1263,6 +1267,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
                 if (vos.isEmpty() && vosMigrating.isEmpty()) {
                     resourceStateTransitTo(host, ResourceState.Event.InternalEnterMaintenance, _nodeId);
                     hostInMaintenance = true;
+                    ActionEventUtils.onCompletedActionEvent(CallContext.current().getCallingUserId(), CallContext.current().getCallingAccountId(), EventVO.LEVEL_INFO, EventTypes.EVENT_MAINTENANCE_PREPARE, "completed maintenance for host " + hostId, 0);
                 }
             }
         } catch (NoTransitionException e) {