We can create rules that will determine the VM Host DRS placement rules. This is done by creating VMs to the host's affinity rules. The rules determine if a group of VMs can run on a group of chosen ESXi hosts. For instance, VMs in the VMs Group - B can not only be configured to have a placement affinity (must run or should run) with Host Group B, but also have an anti-affinity towards Host Group A. This scenario has been depicted in the following diagram:
The creation of VMs to hosts' affinity rules requires DRS hosts/VMs groups to be created. The DRS groups should list both the Host and VM groups that have been created.
For instructions on how to create DRS Hosts and VM groups, read the recipes Creating DRS host groups and Creating DRS VM groups in this chapter.