Do not do investigation for SSVM/CPVM agent host upon disconnect.

This commit is contained in:
Kelven Yang 2014-02-26 17:33:09 -08:00
parent 0c48f70762
commit 90262a81ec
3 changed files with 13 additions and 11 deletions

View File

@ -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);
}
}
}
}

View File

@ -182,7 +182,7 @@ public class DirectAgentAttache extends AgentAttache {
Command[] cmds = _req.getCommands();
ArrayList<Answer> answers = new ArrayList<Answer>(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()]));

View File

@ -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);
}