From 6766c01fc67d322d9c80461bbf84290bfcd5b6e7 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Wed, 7 Aug 2013 14:41:36 -0700 Subject: [PATCH] CLOUDSTACK-3535: still maintain stop agent wont trigger HA --- client/tomcatconf/nonossComponentContext.xml.in | 1 + .../hypervisors/kvm/src/com/cloud/ha/KVMInvestigator.java | 2 ++ server/src/com/cloud/agent/manager/AgentManagerImpl.java | 6 +----- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in index 6fd51ef0f0a..e9290dbf123 100644 --- a/client/tomcatconf/nonossComponentContext.xml.in +++ b/client/tomcatconf/nonossComponentContext.xml.in @@ -271,6 +271,7 @@ + diff --git a/plugins/hypervisors/kvm/src/com/cloud/ha/KVMInvestigator.java b/plugins/hypervisors/kvm/src/com/cloud/ha/KVMInvestigator.java index d0016a194f1..1ec48e624d8 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/ha/KVMInvestigator.java +++ b/plugins/hypervisors/kvm/src/com/cloud/ha/KVMInvestigator.java @@ -31,9 +31,11 @@ import com.cloud.utils.component.AdapterBase; import com.cloud.vm.VMInstanceVO; import org.apache.log4j.Logger; +import javax.ejb.Local; import javax.inject.Inject; import java.util.List; +@Local(value=Investigator.class) public class KVMInvestigator extends AdapterBase implements Investigator { private final static Logger s_logger = Logger.getLogger(KVMInvestigator.class); @Inject diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java index 519b3cf5228..572f78b86b6 100755 --- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -850,11 +850,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl s_logger.debug("Deregistering link for " + hostId + " with state " + nextStatus); } - //For KVM, if removeagent is false, don't remove the agent in agentmap, pingtimeout will pick it up. - if (host.getHypervisorType() != HypervisorType.KVM || removeAgent) { - removeAgent(attache, nextStatus); - } - + removeAgent(attache, nextStatus); //update the DB if (host != null && transitState) { disconnectAgent(host, event, _nodeId);