Steps to prevent vSphere HA from failing over a virtual machine (VM) or VM group to another host
search cancel

Steps to prevent vSphere HA from failing over a virtual machine (VM) or VM group to another host

book

Article ID: 426278

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

- You want vSphere HA failover not move and restart a particular VM or VM group from a Host to other when the original ESXi host fails (crashes or becomes network-isolated) and can't heartbeat

Environment

vSphere ESXi 

Resolution

To prevent vSphere HA from failing over a virtual machine (VM) or VM group to another host, you must use VM-Host "Must" affinity rules or VM Overrides.
 
1. Configure VM-Host "Must" Affinity Rules 
This is the most effective method for ensuring a VM stays on a specific host or group of hosts. vSphere HA respects "Must" rules and will not restart a VM if it would violate them. 
  • Create a Host Group: In the vSphere Client, go to your Cluster > Configure > Configuration > VM/Host Groups. Click Add, name the group, select Host Group as the type, and add the specific host(s).
  • Create a VM Group: In the same menu, click Add, name the group, select VM Group as the type, and add the VM(s) you wish to restrict.
  • Create the "Must" Rule: Go to VM/Host Rules and click Add.
    • Type: Select "Virtual Machines to Hosts".
    • Selection: Map your VM Group to your Host Group.
    • Constraint: Select "Must run on hosts in group".
    • Note: If the designated host fails, the VM will remain powered off because it is forbidden from running elsewhere. 

2. Disable HA for Specific VMs (VM Overrides) 
You can selectively disable the restart functionality for individual VMs while keeping HA active for the rest of the cluster. 
  1. Navigate to your Cluster and select the Configure tab.
  2. Under Configuration, select VM Overrides and click Add.
  3. Select the specific VM(s) you want to exclude from failover.
  4. Under the vSphere HA settings section:
    • VM Restart Priority: Set this to Disabled.
    • Host Isolation Response: Set to Disabled or Leave powered on to ensure the VM does not shut down or move if the host loses network connectivity.
  5. Click OK to apply. 
 
3. Disable DRS Migration (Optional) 
If you also want to prevent the VM from moving during normal operations (e.g., load balancing), you should disable DRS for that specific VM within the same VM Overrides menu by setting the DRS Automation Level to Disabled. 

Additional Information

Reference KB: Best practices and advanced features for vSphere High Availability