In this lab we will cover;

  1. Create a load imbalance
  2. Create a vSphere DRS Cluster
  3. Verify proper vSphere DRS Cluster Functionality
  4. Create, Test, and Disable a VM-VM Affinity Rule
  5. Create, Test, and Disable an Anti-Affinity Rule
  6. Create, Test, and Disable a VM-Host Affinity Rule

Task 1: Create a Load Imbalance 

To do this we need to run cpubusy on every VM, this will put the hosts under heavy load, which makes me think maybe only one should be under load so the migration works. But for now, I will follow the lab.

To make my life getting cpubusy on all the VMs I just made a network share with cpubusy in it.

So now I will start each VM and run the script.

This is taking nearly an hour for each VM to power up and actually function enough for me to run the script… joys of VMs inside of VMs… Having three VMs at full load for some reason is causing an absolute slow down on my main client, so I am just going to run three VMs with cpubusy.

Well, the share is taking forever to load so I just made it again.

Task 2: create a vSphere DRS Cluster

Now going into the Lab Cluster settings we can setup DRS.

This slideshow requires JavaScript.

Task 3: Verify Proper vSphere DRS Cluster Functionality 

Now in Lab Cluster, we can Run the vSphere DRS.

Now looking in summary we can see if I did indeed make an imbalance, which I did.

Now going back into monitor we can click DRS and then select CPU utilization.

Here we can see it’s only just imbalanced but the VMs are running so slow it makes it hard to do anything without wasting time.

Now going into recommendations I don’t actually have any so maybe I will have to put it under some more load.. the screenshot in the book also shows them using one Host not two… so I’m going to put them over to Host one and tilt the system that way.

Actually, it looked like vMotion moved three VMs to my Host 2 and Host 1 is only holding one, so that also explains the resources. So when three VMs are on host 1 running CPU busy it should work then.

So I now have three VMs on Host 1

and the CPU util is

I now have a recommendation! Whoop!

So now we can click Apply recommendation.

And then we can monitor the move in the Task tab.

And wait for it to complete.

Now we need to go back to DRS and run it again.

Question: Are there any recommendations shown? No nothing is shown.

Now going into the summary tab.

Question: Dors the DRS pane show balanced? No, it does not but this is because one of the VMs is actually installing Windows 8 and doing not a whole lot so this is understandable.

Now we can look at the CPU Util.

So this backs up my answer, that Host 1 has two full VMs running under full load while Host 2 has 1 under full load and another installing Windows 8.

Now we need to stop the cpubusy scripts.

Task 4: Create, Test, and Disable a VM-VM Affinity Rule

Now going into VMs tab inside of Lab Cluster, and then selecting Show/Hide Columns.

Which allows us to select Host.

Now we can easily see the hosts that handle each VM.

My VMs are kinda mixed but there is still two on each which is fine.

Now going into the settings of Lab Cluster and going to VM/Host Rules

Now we can click add.

Now I have made my rule saying any VM that is NW01-## make sure they stick togeather, I can now go to my DRS Recommendations and see if there is anything there.

There are two recommendations, one is a rule which is what I made, and then another to then balance the load.

Now I can apply these recommendations, and we can see the VMs moving to their rightful parents.

And now to confirm everything is where they should be.

Now going into VM/Host Rules again and editing our rule, we need to deselect the enable rule check box.

Task 5: Create, Test, and Disable an Anti-Affinity Rule

Now we create another rule, this time to separate our VMs

And then apply the recommendations.

and then once again we wait for the migrate to complete.

Now we can see the VMs are split NW01 and NW02 are together now, kind of like an arranged marriage.

Now we need to disable this rule.

Also here’s a note the book does not mention, and that is when you make two rules that are against each other it will tell you with a big red warning sign.

Task 6: Create Test, and Disable a VM-Host Affinity Rule

First, we go into VM/Host Groups and click add.

So first we created a VM group for my VMs

Now we need to create one for the Host.

Now I’m also going to make one for Host 2 and VMs2

Now going to VM/Host Rules and clicking Add.

Now we need to check for recommendations.

Question: What recommendations did DRS make and why? It made the recommendation of moving nw02 to host2 and nw01 to host1 because these are the rules I just specified.

Now we can apply these recommendations.

Now we need to verify in VMs that the VMs are where they should be, and they are.

Now we need to right-click one of the VMs and try to migrate it.

As you can see it won’t let us because of the rules.

Now we need to disable these rules.

Lab complete.


This lab taught me everything I currently know about settings rules on how VMs sit on hosts etc, it was interesting as I had so many questions about how you would handle it and this lab answered them.

I did not face any issues with the lab itself, just with my VMs acting so slow whcih added a lot of time to this lab.

All in all 10 points out of 10 points








%d bloggers like this: