vSphere HA Fails to Restart VMs in a Cluster Due to Anti-Affinity Rules
search cancel

vSphere HA Fails to Restart VMs in a Cluster Due to Anti-Affinity Rules

book

Article ID: 439262

calendar_today

Updated On:

Products

VMware vCenter Server 8.0 VMware vSphere ESXi 8.0

Issue/Introduction

  • When a host failure occurs in a vSphere cluster, Virtual Machines (VMs) residing on the failed host do not automatically restart on the remaining healthy hosts via vSphere High Availability (HA). This issue specifically impacts VMs that are part of a configured VM-VM Anti-Affinity (Separate Virtual Machines) rule.
  • The vSphere Client displays the following symptoms:

    • Errors indicating: "Insufficient resources to satisfy HA" or "vSphere HA failover operation in progress: 0 VMs being restarted."

    • The Tasks and Events tab logs the following alerts:

      • Alert vSphere HA virtual machine failover failed

      • Alarm 'vSphere HA virtual machine failover failed' changed from Gray to Red

      • Not enough resources to failover this virtual machine

  • The /var/log/fdm.log on the host acting as the HA primary reveals that no compatible host could be found for VM placement

    YYYY-MM-DDTHH:MM:SS  verbose fdm[4747570] [Originator@6876 sub=Placement opID=45####5b] Setting insufficient resource timeout to 60 seconds and retrying placement for vm /vmfs/volumes/4fbf41e5-########-####-##########60/vm/vm.vmx
    YYYY-MM-DDTHH:MM:SS  verbose fdm[4747570] [Originator@6876 sub=Placement opID=45####5b] Reset the placement status of vm /4fbf41e5-########-####-##########60.vmx to 0, vim.fault.RuleViolation (vim.fault.RuleViolation)
    YYYY-MM-DDTHH:MM:SS  verbose fdm[4747570] [Originator@6876 sub=Placement opID=45####5b] Vm /vmfs/volumes/4fbf41e5-########-####-##########60/vm/vm.vmx failed placement with fault [N3Vim5Fault13RuleViolationE:0x0000####13884e0]
    YYYY-MM-DDTHH:MM:SS  verbose fdm[4747570] [Originator@6876 sub=Placement opID=45####5b] Setting insufficient resource timeout to 60 seconds and retrying placement for vm vmfs/volumes/4fbf41e5-########-####-##########60/vm/vm.vmx
    YYYY-MM-DDTHH:MM:SS  verbose fdm[4747570] [Originator@6876 sub=Placement opID=45####5b] Reset the placement status of vm /vmfs/volumes/4fbf41e5-########-####-##########60/vm/vm.vmx to 0, vim.fault.RuleViolation (vim.fault.RuleViolation)
    YYYY-MM-DDTHH:MM:SS  verbose fdm[4747564] [Originator@6876 sub=Placement opID=45####5b-SWI-67eb1254] Post resource request event to VC for Vm /vmfs/volumes/4fbf41e5-########-####-##########60/vm/vm.vmx     (reason=vim.fault.RuleViolation)
    YYYY-MM-DDTHH:MM:SS  verbose fdm[4747469] [Originator@6876 sub=FDM opID=SWI-7###7e18] New event: Event=vim.event.NotEnoughResourcesToStartVmEvent vm=/vmfs/volumes/4fbf41e5-########-####-##########60/vm/vm.vmx host=host-#### tag=host-###:-196#####9:9
    YYYY-MM-DDTHH:MM:SS  verbose fdm[4747562] [Originator@6876 sub=Placement] Failover operation in progress on ## Vms: ## VMs being restarted, # VMs waiting for a retry, 0 VMs waiting for resources, 0 inaccessible VMs.
    YYYY-MM-DDTHH:MM:SS  verbose 'Placement' opID=SWI-7###7e18] [PlacementManagerImpl::PlacementUpdateCb] No recommendation is generated
    YYYY-MM-DDTHH:MM:SS  verbose 'Placement' opID=SWI-7###7e18] [PlacementManagerImpl::HandleNotPlacedVms] Reset Vm /vmfs/volumes/4fbf41e5-########-####-##########60/vm/vm.vmx, vim.fault.NoCompatibleHost

Cause

By default, vSphere HA strictly respects VM-VM Anti-Affinity rules. In a cluster with a limited number of hosts, if one host fails, the remaining healthy hosts may already be running VMs that belong to the same anti-affinity group.

Because HA treats these rules as a "hard" constraint during a failover event, it will not restart the failed VM if it means placing two VMs from the same group on a single host. HA prioritizes strict compliance with the "Separate Virtual Machines" rule over VM availability, preferring to keep the VM powered off rather than violating the rule.

Resolution

To prioritize VM uptime while maintaining operational separation during normal conditions, HA must be configured to treat anti-affinity rules as "soft" constraints during a failover event.

Configure HA Advanced Settings:

  1. In the vSphere Client, navigate to the target Cluster.

  2. Select the Configure tab and click vSphere Availability under Services.

  3. Click Edit and navigate to the Advanced Options tab.

  4. Add the following parameter and value:

    • Option: das.respectvmvmantiaffinityrules

    • Value: false

  5. Click OK to apply the configuration.

Note: By setting this parameter to false, HA will temporarily bypass the anti-affinity rule specifically during a failover event to ensure the VMs are successfully powered on. Once the failed host is restored and rejoins the cluster, vSphere Distributed Resource Scheduler (DRS) will automatically migrate the VMs to re-satisfy the original anti-affinity rule.

Additional Information

Using Affinity Rules without vSphere DRS

vSphere HA Advanced Options