Github user DaanHoogland commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/656#discussion_r36167770 --- Diff: server/src/com/cloud/ha/HighAvailabilityManagerImpl.java --- @@ -261,25 +264,21 @@ public void scheduleRestartForVmsOnHost(final HostVO host, boolean investigate) // send an email alert that the host is down, include VMs HostPodVO podVO = _podDao.findById(host.getPodId()); String hostDesc = "name: " + host.getName() + " (id:" + host.getId() + "), availability zone: " + dcVO.getName() + ", pod: " + podVO.getName(); + _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, host.getDataCenterId(), host.getPodId(), "Host is down, " + hostDesc, + "Host [" + hostDesc + "] is down." + ((sb != null) ? sb.toString() : "")); - _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, host.getDataCenterId(), host.getPodId(), "Host is down, " + hostDesc, "Host [" + hostDesc + - "] is down." + - ((sb != null) ? sb.toString() : "")); - - if (vms != null) { - for (VMInstanceVO vm : vms) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Notifying HA Mgr of to restart vm " + vm.getId() + "-" + vm.getInstanceName()); - } - vm = _instanceDao.findByUuid(vm.getUuid()); - Long hostId = vm.getHostId(); - if (hostId != null && !hostId.equals(host.getId())) { - s_logger.debug("VM " + vm.getInstanceName() + " is not on down host " + host.getId() + " it is on other host " - + hostId + " VM HA is done"); - continue; - } - scheduleRestart(vm, investigate); + for (VMInstanceVO vm : reorderedVMList) { + if (s_logger.isDebugEnabled()) { + s_logger.debug("Notifying HA Mgr of to restart vm " + vm.getId() + "-" + vm.getInstanceName()); + } + vm = _instanceDao.findByUuid(vm.getUuid()); + Long hostId = vm.getHostId(); + if (hostId != null && !hostId.equals(host.getId())) { --- End diff -- no biggy for this PR, but why is this chack needed? The vms are retrieved by the host id of the host being down in the first place (see line 240).
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---