Today we'll try to cover another objective from The Professional vSphere 6.7 Exam 2019 (2V0-21.19) which leads to VMware Certified Professional – Data Center Virtualization 2019 certification. This post's name is VCP6.7-DCV Objective 7.13 – Identify and interpret affinity/anti-affinity rules.
The original VMware blueprint to pass the Professional vSphere 6.7 Exam 2019 can be found here – ( PDF Online at VMware 2V0-21.19). I highly recommend getting all the documentation set for studying, other study guides might exist as well.
VCP6.7-DCV Objective 7.13 – Identify and interpret affinity/anti-affinity rules, let's get started.
DRS in fully automated mode can misplace some VMs which admin would not like to. You can configure the VM placement using affinity and anti-affinity rules. If you create a DRS affinity rule for your cluster, you can specify how vSphere HA applies that rule during a virtual machine failover.
For example, you have a tier 3 application composed of multiple VMs ( web frontend, application server, database backend). As usually with tier 3 apps, those “talk” heavily with each other. As such, the backend traffic would be quite significant if you leave to run those VMs on different hosts. The best would be to keep them together on the same host.
The two types of rules for which you can specify vSphere HA failover behavior are the following:
- VM Affinity/anti-affinity rules force specified virtual machines to remain together (or apart) during failover actions.
- VM-Host affinity rules place specified virtual machines on a particular host or a member of a defined group of hosts during failover actions.
When you edit a DRS affinity rule, you must use vSphere HA advanced options to enforce the desired failover behavior for vSphere HA.
HA must respect VM anti-affinity rules during failover – When the advanced option for VM anti-affinity rules is set, vSphere HA does not fail over a virtual machine if doing so violates a rule. Instead, vSphere HA issues an event reporting there are insufficient resources to perform the failover.
Shop for vSphere licenses at VMware Store:
- vSphere Essentials Plus – vMotion, HA… 3 Hosts, vCenter
- vSphere Essentials – 3 Hosts, vCenter
- vSphere Standard – Per Physical CPU license
HA should respect VM to Host affinity rules during failover – vSphere HA attempts to place VMs with this rule on the specified hosts if at all possible.
This guide is available as Free PDF!
Free Download at Nakivo – VCP6.7-DCV Study Guide.
VM-VM Affinity Rule
You can create VM-Host affinity rules to specify whether or not the members of a selected virtual machine DRS group can run on the members of a specific host DRS group. When set to fully automated mode DRS migrates the VMs to bring them together on the next run of DRS.
A partially automated DRS mode will display the migration recommendation and perform the initial placement when powering on the VM.
VM-VM Anti-Affinity rule
Let's say that we need to keep two VMs apart on different hosts. There you might have an SQL cluster for high availability or perhaps a web server farm that is composed of multiple VMs. If you have let's say two SQL servers on the same physical host and the host has a hardware problem, you will lose VMs the time HA restarts those VMs on another host. As such, you'll most likely have an interruption of service. It is perhaps a good idea to prevent somehow that DRS places those VMs on the same physical host.
A VM-Host affinity rule specifies whether or not the members of a selected virtual machine DRS group can run on the members of a specific host DRS group.
Unlike a VM-VM affinity rule, which specifies an affinity (or anti-affinity) between individual virtual machines, a VM-Host affinity rule specifies an affinity relationship between a group of virtual machines and a group of hosts. There are ‘required' rules (designated by “must”) and ‘preferential' rules (designated by “should”.)
A VM-Host affinity rule includes the following components.
- One virtual machine DRS group.
- One host DRS group.
- A designation of whether the rule is a requirement (“must”) or a preference (“should”) and whether it is affinity (“run on”) or anti-affinity (“not run on”).
You use a VM-Host affinity rule to specify an affinity relationship between a group of virtual machines and a group of hosts.
VM-VM Affinity Rule Conflicts
If you create multiple VM-VM affinity rules, those can be in conflict sometimes, depending on the situation.
If two VM-VM affinity rules are in conflict, you cannot enable both. For example, if one rule keeps two virtual machines together and another rule keeps the same two virtual machines apart, you cannot enable both rules.
You must select one of the rules to apply and you have to disable or remove the other, conflicting rule.
When two VM-VM affinity rules conflict, the older one takes precedence and the newer rule is disabled. DRS only tries to satisfy enabled rules and disabled rules are ignored. DRS gives higher precedence to preventing violations of anti-affinity rules than violations of affinity rules.
Stay consistent with the study. Use our study guide but not only. The more you'll read the better. Don't use a single source for the study, but rather multiple sources at the same time. We try to give as many details as possible, with screenshots, but we are not able to cover everything.
Follow the progress of the VCP6.7-DCV Study Guide page for further updates.
Well, this is it for today.
More from ESX Virtualization
- What is Host Guardian Service?
- What is vCenter Embedded Linked Mode in vSphere 6.7?
- What is VMware Snapshot?
- VMware Tools Offline VIB for ESXi Host – Bundle Download and Install
- How to Patch VMware vCenter Server Appliance (VCSA) 6.7 Offline