How to configure affinity and Anti-affinity rules for VMWare DRS
In this article, we’ll learn the steps to configure affinity and anti-affinity rules for VMWare DRS (Distributed Resource Scheduler). DRS Affinity Rules are used to define the placement of Virtual Machines on Host within a cluster. If you want a particular guest machine to run on selected Host machine then it can be configured by using VMWare DRS affinity rules. However, you can also define the placement of specified virtual machines apart so that if one host crashed, you would not lose all the Virtual Machines. In the old post, we have already learned about Distributed Resource Scheduler and High Availability.
Affinity rules – VM to VM
This rule is used to host Virtual Machines on the same VMWare ESXi Host. It is used for the scenarios where if one Virtual Machine is vMotion to another ESXi hos then another Virtual Machine would also be vMotion to the same host. These kind of rules are primarily used for the scenarios where you want your fronted and backed servers to be hosted on the same VMWare ESXi Host.
Affinity rules – VM to Host
These kind of rules are primarily required for the scenarios where you want particular Virtual Machine to run on identified VMWare ESXi Host. By using this rule you are restricting the VM to host only on identified host and not vMotion to any other VMWare ESXi Server. Most importantly, these kind of rules can also result in outages.
Anti-affinity rules VM to VM
These kind of rules are primarily used for the scenarios where you don’t want two or more VMs to run on the same VMWare ESXi Servers. Take an example of Domain Controllers, if you have two Domain Controllers in your environment and they both are running on the same host. If that host goes down, it would result in outage therefore it is recommended to have these kind of servers to run on different host machines. It would prevent outages and even performance would be better.