Skip to content

Commit 90262a8

Browse files
committed
Do not do investigation for SSVM/CPVM agent host upon disconnect.
1 parent 0c48f70 commit 90262a8

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,8 +1469,16 @@ protected void runInContext() {
14691469
status_logger.debug("Ping timeout but host " + agentId + " is in resource state of " + resourceState + ", so no investigation");
14701470
disconnectWithoutInvestigation(agentId, Event.ShutdownRequested);
14711471
} else {
1472-
status_logger.debug("Ping timeout for host " + agentId + ", do invstigation");
1473-
disconnectWithInvestigation(agentId, Event.PingTimeout);
1472+
HostVO host = _hostDao.findById(agentId);
1473+
if (host != null && (host.getType() == Host.Type.ConsoleProxy || host.getType() == Host.Type.SecondaryStorageVM
1474+
|| host.getType() == Host.Type.SecondaryStorageCmdExecutor)) {
1475+
1476+
s_logger.warn("Disconnect agent for CPVM/SSVM due to physical connection close. host: " + host.getId());
1477+
disconnectWithoutInvestigation(agentId, Event.ShutdownRequested);
1478+
} else {
1479+
status_logger.debug("Ping timeout for host " + agentId + ", do invstigation");
1480+
disconnectWithInvestigation(agentId, Event.PingTimeout);
1481+
}
14741482
}
14751483
}
14761484
}

engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private void bailout() {
182182
Command[] cmds = _req.getCommands();
183183
ArrayList<Answer> answers = new ArrayList<Answer>(cmds.length);
184184
for (Command cmd : cmds) {
185-
Answer answer = new Answer(cmd, false, "Bailed out as maximum oustanding task limit reached");
185+
Answer answer = new Answer(cmd, false, "Bailed out as maximum outstanding task limit reached");
186186
answers.add(answer);
187187
}
188188
Response resp = new Response(_req, answers.toArray(new Answer[answers.size()]));

server/src/com/cloud/ha/HighAvailabilityManagerImpl.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
import com.cloud.hypervisor.Hypervisor.HypervisorType;
6464
import com.cloud.resource.ResourceManager;
6565
import com.cloud.server.ManagementServer;
66-
import com.cloud.service.ServiceOfferingVO;
6766
import com.cloud.service.dao.ServiceOfferingDao;
6867
import com.cloud.storage.StorageManager;
6968
import com.cloud.storage.dao.GuestOSCategoryDao;
@@ -952,13 +951,8 @@ public boolean preStateTransitionEvent(State oldState, VirtualMachine.Event even
952951
@Override
953952
public boolean postStateTransitionEvent(State oldState, VirtualMachine.Event event, State newState, VirtualMachine vo, boolean status, Object opaque) {
954953
if (oldState == State.Running && event == VirtualMachine.Event.FollowAgentPowerOffReport && newState == State.Stopped) {
955-
long serviceOfferingId = vo.getServiceOfferingId();
956-
957-
ServiceOfferingVO serviceOffering = _serviceOfferingDao.findById(serviceOfferingId);
958-
if (serviceOffering != null && serviceOffering.getOfferHA()) {
959-
960-
VMInstanceVO vm = _instanceDao.findById(vo.getId());
961-
954+
VMInstanceVO vm = _instanceDao.findById(vo.getId());
955+
if (vm.isHaEnabled()) {
962956
s_logger.info("Detected out-of-band stop of a HA enabled VM " + vm.getInstanceName() + ", will schedule restart");
963957
scheduleRestart(vm, true);
964958
}

0 commit comments

Comments
 (0)