Using DRS, you can set affinity and anti-affinity rules as a preference or as a necessity.
In this first example, you tell DRS that you prefer the virtual machines in group A to run on the "Blade Chassis A" host group.
For group B virtual machines, they will need to run on the "Blade Chassis B" host group.
This means that in the event of a failure of the hosts in the "Blade Chassis A" host group, the virtual machines can be restarted on another host group to ensure the availability of the services hosted by these virtual machines.
In this 2nd example, you tell DRS that virtual machines in group A should run only on the "ISV-Licensed" host group.
In case the hosts in the "ISV-Licensed" group fail, the virtual machines in group A cannot be restarted on other host groups.
The services hosted on the virtual machines in this group A will therefore no longer be available.
This type of rule (necessity) is therefore used mainly to avoid licensing problems.
Indeed, some manufacturers are intransigent in respecting licenses. In the event that the VM is migrated to another group of hosts, the license conditions of the solution you use in one of your VMs may no longer be respected.
As explained previously, rules are applied using groups of VMs and groups of hosts.
To get started, select your cluster and go to: Configure -> Configuration -> VM/Host Groups.
Then, click: Add.
In the "Create VM/Host Group" window that appears, provide a name for this VM group and select "VM Group" as the type.
Then, click: Add.
Select the virtual machines you want to add to this group and click OK.
In our case, our virtual machines running Windows 10.
Click OK.
The added VM group appears in the "VM/Host Groups" list.
Now, click again: Add.
In the "Create VM/Host Group" window that appears, provide a name for this host group and this time select "Host Group" as the type.
Then click: Add.
For this example, we will only select one host, as we only have 2 for this tutorial.
Once you have selected the desired host(s), click OK.
Click OK.
The added host group appears.
In the "VM/Host Rules" section, click: Add.
In the "Create VM/Host Rule" window that appears, provide a name for this rule and check the "Enable rule" box.
For the type of rule, you will have the choice between:
In our case, we will create a "Virtual Machines to Hosts" type rule.
Sources :
In this case, you will need to select:
In our case, we want our Windows 10 virtual machines to run preferably on our "esxi1" host which is part of our "ESXi 1 host" host group.
The added VM/host rule appears
If you select it, you will be able to see the virtual machines and hosts affected by this rule, as well as a description of what this rule entails.
Important : if DRS detects conflicts between different VM/host rules, you will see the number in the "Conflicts" column increase.
On the other hand, also be aware that the rules only apply when the virtual machines are powered on (started).
In other words, a conflict occurs between 2 VM/host rules, but the virtual machines affected by these rules are turned off, the conflict will not be detected.
The conflict will only appear when the virtual machines concerned are powered on.
Now that you know what the different options are and how to set up your own DRS rules, here is a small example.
In a previous tutorial, we deployed the StarWind Virtual SAN solution on VMware vSphere.
Which involved deploying 2 StarWindVSA vSphere virtual machines. One virtual machine per host.
In fact, these are storage servers accessible via iSCSI, whose data is replicated from one virtual machine to another.
In other words, StarWind Virtual SAN shared storage accessible via the iSCSI protocol is available via any of these 2 virtual machines.
In this case, you will easily understand that it is imperative to signal DRS to always separate these virtual machines on different hosts in your cluster.
So, if one host goes down, the other "StarWind VSA vSphere" virtual machine is still functional and the shared storage remains available as if nothing had happened.
Which would not be the case if the 2 StarWind VSA vSphere virtual machines ended up on the same host by accident. (A migration of a StarWind VM would be necessary at least for a StarWindVSA vSphere virtual machine to be functional again.)
To ensure that StarWind Virtual SAN storage is always available, even if one of our hosts fails, we select our VMware vSphere cluster and go to: Configure -> Configuration -> VM/Host Rules.
Then we click on: Add.
In the "Create VM/Host Rule" window that appears, we specify:
As you can see, VMware tells you that the virtual machines listed must run on different hosts.
We click OK.
The new rule created appears.
VMware 3/8/2024
VMware 10/12/2022
VMware 8/19/2022
VMware 6/26/2024
Pinned content
Contact
® InformatiWeb-Pro.net - InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.
Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.
No comment