Lab 20 Implementin a vSphere DRS Cluster

Create a Load Imbalance

From the vSphere Web Client go to Hosts and Clusters and make sure that every VM is running in one host. If not, migrate the VMs to one host. Also power on all of the VMs.

Figure 1. All VM powered on in one host

Start the CPUBUSY script in each of the VM. You can do that by right-clicking the CPUBUSY file and select Open with > Command Prompt. You will need to run more CPUBUSY script to make the load imbalanced later.

Figure 2. Execute CPUBUSY script in VMs

Create a vSphere DRS Cluster

From Hosts and Clusters, right-click Lab Cluster and select Settings. Choose vSphere DRS and click Edit. Figure 3 will show the configurations I have made for preparing a DRS cluster. The settings outside the figure have no changes.

Figure 3. DRS configurations

Verify Proper vSphere DRS Cluster Functionality

Go to Lab Cluster Monitor tab and select vSPhere DRS. Click Run DRS Now.

Figure 4. Run DRS now

Select the Summary tab and expand vSphere DRS. You can see that the DRS load is imbalanced.

Figure 5. CPU load imbalanced

Now, go to Monitor tab > vSphere DRS and select CPU Utilization. You can see under the Sum of Virtual Machine CPU Utilization – Per Host is fully on one of the ESXi host as all of the VM is running on it. That is why it is imbalanced in the DRS load.

Figure 6. CPU utilization imbalanced

Select Recommendations from the middle pane and you can check several action that could be done for a better performance. Click Apply Recommendations

Figure 7. Migration recommendations

Back to the Monitor tab, click Tasks & Events then select Tasks and you can check the VM migration process.

Figure 8. Tasks and events

Next, click the vSphere DRS tab and select Run DRS.

Figure 9. DRS recommendations empty

Click the Summary tab and the gauge is now more balanced though it still states that it is imbalanced.

Figure 10. More balanced load

In the vSphere DRS > CPU Utilization, the CPU usage is now spread evenly due to the migration of two VMs to another ESXi host.

Figure 11. CPU more balanced

Create, Test, and Disable a VM-VM Affinity Rule

Click on Lab Cluster and select the VMs tab. Right-click in an empty space in the columns and select Show/Hide Columns. Check the Host check box and click OK.

Figure 12. Show host columns

You can see the information of the VMs and make sure they are not running on one host. If it is still in one host, migrate one of them to another.

Figure 13. VM is separated to all hosts

Right-click on Lab Cluster and select Settings. Select VM/Host Rules menu and click Add. A window will appear and Figure 14 will show my configuration of the VM/Host rule. Click OK if done.

Figure 14. Keep VM together rule

Go to the Monitor tab and select vSphere DRS. Select Recommendations and click Run DRS Now. The recommendation will appear when your VM2-# are seperated in different ESXi host. A recommendation will show up then click Apply Recommendations, it might take a while for the recommendation to show up. It will migrate the VM2-# to keep it together in a single ESXi host as the rule we have applied previously.

Figure 15. Migration recommendation

Now from the Monitor tab, click Tasks & Events to see check the migration progress.

Figure 16. Migration process

Click VMs tab and click Host column heading and check VMs host.

Figure 17. VM2-# are kept together

Go to the Configure tab of Lab Cluster and select VM/Host Rules. Select the affinity rule and click Edit. Uncheck Enable rule and click OK.

Figure 18. Disable rule

Create, Test, and Disable an Anti-Affinity Rule

Still continuing from the last step, click Add. We will create a new rule as configured like shown in Figure 19. Click OK to confirm.

Figure 19. Add separate VM rule

Go to Monitor tab > vSphere DRS. Select Recommendations and Run DRS Now. You can see the recommendation is separating the VM2-# to different hosts and moving the other VM to balance the load. Click Apply Recommendations.

Figure 20. DRS recommendations

Check the migration process in Monitor tab > Tasks & Events.

Figure 21. VM migration task

Go to VMs tab and check the host of the VMs. The VM2-# are separated in different host.

Figure 22. VM2-# are seperated

As we have finished testing, delete the rule by going to the Configure tab and select VM/Host Rules. Select Separate-VM2-VMs rule and click Delete from the above pane. Click yes to confirm.

Figure 23. Disable seperate VM rules

Create, Test, and Disable VM-Host Affinity Rule

In the middle pane, select VM/Host Groups then click Add. A window will appear and the configuration of the group will be as shown as in Figure 23. Click OK if done. This group is for VM2-# group.

Figure 24. VM group

Add another group by clicking Add and the configuration of this one is shown in Figure 25. Click OK. This group covers the second ESXi host.

Figure 25. Host group

Now, we will create the rules by applying the group in the rules. Go to VM/Host Rules and click Add. The rules configuration will be configured as shown in Figure 26. Click OK if done.

Figure 26. VM/Host rule with groups

Go to Monitor tab > vSphere DRS. In Recommendations click Run DRS Now. The Recommendations show that the VM2-# has to be migrated to the second ESXi host. Select Apply Recommendations.

Figure 27. Migration recommendations

Check the migration process on Monitor tab > Tasks & Events.

Figure 28. Migration process

Go to the VMs tab and click the Host column heading and check where the VMs are located.

Figure 29. VM2-# running on second host

Now, try to migrate one of your VM2-#. Right-click one of your VM2-# and select Migrate. Select Change computer resource only and click Next. Then select the Lab Cluster and you will see that there is compatibility problem as there is a rule that has been set to prohibit this action. Click cancel.

Figure 30. Compatibility issue in migrating VM

As we have finished the test, we will turn of the rule. Go to Lab Cluster Configure tab. Select VM/Host Rules and select Run-only-on-host2 rule then click Edit. Uncheck the Enable rule then click OK.

Figure 31. Disable rule

Leave a comment