The Distributed Resource Scheduler (DRS) allows vSphere Administrators to use rules to enforce virtual machine placement on cluster nodes. An example of such a rule is in the image below with a rule to reparate two domain controllers so that they won't run on the same vSphere host.
Using this rule works well in a larger cluster, but in a small cluster this might cause an issue. If there are only two nodes in the cluster then when placing a host in maintenance mode that process stalls because it would violate the DRS rule, as you can see in the next image.
An administrator can manually migrate the conflicting virtual machine to another host. But would it not be much nicer if DRS would be able to perform this automatically?
A solution to this problem is to use the VM to Host affinity rules with a Should Run-rule. In the image below you see an example for a two node cluster where there are two host groups, each containing one ESXi-host and two virtual machine groups, each also containing one VM.
With the rule in the following image we tell DRS to run the VMs on the designated hosts if it can, but if for any reason, such as going into maintenance mode, it is necessary to run the VM on another host it will still do that and migrate the VM to the other host.
Especially in a two node vSAN cluster this approach might be a better solution than the traditional method of using anti-affinity rules.