We can create DRS affinity rules that will affect the VM migration or initial placement recommendations based on the virtual machine's affinity or anti-affinity relationship with a group of ESXi hosts.
The VM to Host affinity rules is generally used to meet specific requirements, such as licensing and access to hardware resources. For instance, let's say you have a set of VMs that need access to a directly attached tape library. Here, you can create a Must Rule to ensure that the VMs are always placed on the hosts that have access to the tape library.