Create DRS anti-affinity rule

DRS anti-affinity rules are used in DRS clusters to keep certain VMs on separate ESXi hosts. You can create them using vSphere Web Client:

1. Select the cluster from the inventory, go to Manage > Settings > DRS Rules, and click the Add button:

add drs rules

2. The Create DRS Rule window opens. Enter the name for the rule and choose the rule type. In this example, we will create a rule that will keep two VMs on separate hosts. Click Add to add the VMs:

drs anti affinity rule

3. Select the VMs you would like to run on different hosts and click OK:

vms for drs rule

4. Click OK to create the rule.

To test the rule, select your DRS cluster from the inventory and go to Monitor > vSphere DRS. Because the VMs we’ve selected during the rule creation are running on the same ESXi host, DRS recommends to run them on different hosts:

drs apply anti affinity rule

Geek University 2022