Making the Case for 'Must' Affinity Rules
Examining the differences between "must" and "should."
In VMware, VM-VM affinity rules are designed to ensure that groups of virtual machines (VMs) always reside on a common host. Similarly, VM-Host affinity rules can be used to ensure that a group of VMs runs on the hosts within a designated host group. While these concepts seems really straight forward (and they are), the administrator actually has some control over how strictly affinity rules are enforced. VM-Host Affinity rules, for example, can be designated as must (or mandatory) or should (preferential). In other words, administrators can determine whether the VMs within a VM group must run within a specific host group, or should run within a specific host group.
I have on occasion heard VMware administrators state that VM-Host affinity rules should always be preferential rather than mandatory. The reason for this is simple. Suppose that one of the hosts within a host group fails, or is taken offline for maintenance, and the remaining hosts within the host group do not have sufficient resources available to fully absorb the VMs running on the host now offline. If the VM-Host Affinity rule mandated that those VMs run only on hosts within the designated host group, the rule will prevent at least some of the VMs from running, even if hardware resources are available in other host groups.
The logic behind creating preferential VM-Host affinity rules is that in situations in which the required hardware resources are not available within a host group, it is better to run VMs in a different host group than to experience an outage.
While I do not dispute the logic behind this idea, there are situations in which it makes sense to use mandatory VM-Host affinity rules. For example, a multi-tenant environment may have a contractual obligation to keep certain tenants’ resources separated from one another. If for instance, a hosting provider was hosting VMs for both Coke and Pepsi, then those VMs would likely have to be kept in different host groups to keep them from ever being hosted on a common VMware host.
The use of mandatory affinity rules can also sometimes help to control licensing costs. There are application vendors that use a host level licensing model requiring any host server that could potentially host the application to be licensed. Hence, creating a small host group and configuring an affinity rule so that the application server could only run on the hosts within that group would help the organization to avoid the expense of licensing additional hosts to run the application.
Brien Posey is a 16-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site at.