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.
- Navigate to your Cluster and select the Configure tab.
- Under Configuration, select VM Overrides and click Add.
- Select the specific VM(s) you want to exclude from failover.
- 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.
- 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.