[
https://issues.apache.org/jira/browse/CLOUDSTACK-8704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14653290#comment-14653290
]
ASF GitHub Bot commented on CLOUDSTACK-8704:
--------------------------------------------
Github user koushik-das commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/656#discussion_r36168376
--- 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 --
@DaanHoogland The host check you are referring to existed even before this
PR. One reason for the check is to ensure that the VM has not moved to another
host since the time it was fetched using listByHostId(). If it has moved to
another host (and vmsync has updated the host id) then no need to perform
restart/HA.
> Schedule restart of router VMs ahead of user VMs as part of HA
> --------------------------------------------------------------
>
> Key: CLOUDSTACK-8704
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8704
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Management Server
> Affects Versions: 4.5.0
> Reporter: Koushik Das
> Assignee: Koushik Das
> Fix For: 4.6.0
>
>
> When a host is detected as Down, HA-enabled VMs running on it are scheduled
> for restart. There may be scenarios where both user VM and corresponding VR
> is on the same host and scheduled for restart. In such cases user VM restart
> will fail in initial attempts until VR is restarted. One way to reduce these
> occurrences is to schedule VR restart ahead of user VMs.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)