diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java index 251f3380281..0d41bc1b3bf 100755 --- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -1469,8 +1469,16 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl status_logger.debug("Ping timeout but host " + agentId + " is in resource state of " + resourceState + ", so no investigation"); disconnectWithoutInvestigation(agentId, Event.ShutdownRequested); } else { - status_logger.debug("Ping timeout for host " + agentId + ", do invstigation"); - disconnectWithInvestigation(agentId, Event.PingTimeout); + HostVO host = _hostDao.findById(agentId); + if (host != null && (host.getType() == Host.Type.ConsoleProxy || host.getType() == Host.Type.SecondaryStorageVM + || host.getType() == Host.Type.SecondaryStorageCmdExecutor)) { + + s_logger.warn("Disconnect agent for CPVM/SSVM due to physical connection close. host: " + host.getId()); + disconnectWithoutInvestigation(agentId, Event.ShutdownRequested); + } else { + status_logger.debug("Ping timeout for host " + agentId + ", do invstigation"); + disconnectWithInvestigation(agentId, Event.PingTimeout); + } } } } diff --git a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java index ef002d0f3eb..354da4b1c48 100755 --- a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java +++ b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java @@ -182,7 +182,7 @@ public class DirectAgentAttache extends AgentAttache { Command[] cmds = _req.getCommands(); ArrayList answers = new ArrayList(cmds.length); for (Command cmd : cmds) { - Answer answer = new Answer(cmd, false, "Bailed out as maximum oustanding task limit reached"); + Answer answer = new Answer(cmd, false, "Bailed out as maximum outstanding task limit reached"); answers.add(answer); } Response resp = new Response(_req, answers.toArray(new Answer[answers.size()])); diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java index 4a24d63c2ce..b7d5be8b237 100755 --- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java +++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java @@ -63,7 +63,6 @@ import com.cloud.host.dao.HostDao; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.resource.ResourceManager; import com.cloud.server.ManagementServer; -import com.cloud.service.ServiceOfferingVO; import com.cloud.service.dao.ServiceOfferingDao; import com.cloud.storage.StorageManager; import com.cloud.storage.dao.GuestOSCategoryDao; @@ -952,13 +951,8 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai @Override public boolean postStateTransitionEvent(State oldState, VirtualMachine.Event event, State newState, VirtualMachine vo, boolean status, Object opaque) { if (oldState == State.Running && event == VirtualMachine.Event.FollowAgentPowerOffReport && newState == State.Stopped) { - long serviceOfferingId = vo.getServiceOfferingId(); - - ServiceOfferingVO serviceOffering = _serviceOfferingDao.findById(serviceOfferingId); - if (serviceOffering != null && serviceOffering.getOfferHA()) { - - VMInstanceVO vm = _instanceDao.findById(vo.getId()); - + VMInstanceVO vm = _instanceDao.findById(vo.getId()); + if (vm.isHaEnabled()) { s_logger.info("Detected out-of-band stop of a HA enabled VM " + vm.getInstanceName() + ", will schedule restart"); scheduleRestart(vm, true); }