Skip to content

Commit a22747d

Browse files
committed
Fix HA bug when VMs are stopped on agent disconnect (apache#26)
When an agent is disconnected due to a network issue, the HA work kicks in and stops some VMs. This is a quick fix to avoid restarting any VMs until the bug is found and fixed.
1 parent 56a3526 commit a22747d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public void scheduleRestartForVmsOnHost(final HostVO host, boolean investigate)
273273
continue;
274274
}
275275
if (s_logger.isDebugEnabled()) {
276-
s_logger.debug("Notifying HA Mgr of to restart vm " + vm.getId() + "-" + vm.getInstanceName());
276+
s_logger.debug("Notifying HA Mgr of to restart vm " + vm.getId() + "-" + vm.getInstanceName() + " with investigate=" + investigate);
277277
}
278278
vm = _instanceDao.findByUuid(vm.getUuid());
279279
Long hostId = vm.getHostId();
@@ -282,7 +282,9 @@ public void scheduleRestartForVmsOnHost(final HostVO host, boolean investigate)
282282
+ hostId + " VM HA is done");
283283
continue;
284284
}
285-
scheduleRestart(vm, investigate);
285+
if (vm.isHaEnabled()) {
286+
scheduleRestart(vm, investigate);
287+
}
286288
}
287289
}
288290

@@ -497,7 +499,7 @@ protected Long restart(final HaWorkVO work) {
497499

498500
boolean fenced = false;
499501
if (alive == null) {
500-
s_logger.debug("Fencing off VM that we don't know the state of");
502+
s_logger.debug("Fencing off VM " + vm + " that we don't know the state of");
501503
for (FenceBuilder fb : fenceBuilders) {
502504
Boolean result = fb.fenceOff(vm, host);
503505
s_logger.info("Fencer " + fb.getName() + " returned " + result);

0 commit comments

Comments
 (0)