VMware | vSphere | Load Balancing using DRS in vSphere Cluster
This is my second part of the VMware vSphere important features series. In the first part, we discussed and explore about vSphere’s High Availability (HA) protection feature. In this part now we are going to discuss the automated workload scheduling feature called Distributed Resource Scheduler (DRS).
VMware vSphere HA is an outstanding way to ensure that your vSphere Cluster provides very robust high-availability to protect against general host failures of ESXi hosts in your vSphere Cluster.
But, what about ensuring efficient use of resources in your vSphere Cluster? Let’s take a look at another vSphere Cluster resource to help ensure efficient use of your vSphere Cluster capacity and resources.
What is DRS in the VMware vSphere cluster?
VMware has a really powerful feature called Distributed Resource Scheduler (DRS) when running vSphere Clusters. It provides load balancing and scheduling across a vSphere Cluster. VMware DRS is the feature found in vSphere Clusters that ensures that virtual machines running inside your vSphere environment are provided with the resources they need to run effectively and efficiently.
In a DRS-enabled cluster, VMs are generally subject to DRS early in their life, as from their first power on. To make available the required resources to the VM as soon as they are powered on, DRS places the VMs on the best host configured. Additionally, DRS strives to hold vSphere clusters balanced from a resource usage perspective.
Even if a vSphere Cluster is balanced at a certain point in time, VMs may get moved around or change in such a way that an imbalance of cluster resources can creep back into the environment. When clusters become imbalanced, it can be harmful to the overall performance of virtual machines running in a vSphere Cluster.
By default, automatically DRS runs on a vSphere cluster after every five minutes to determine the balance of a vSphere Cluster and see that if any changes are needed to be made to make more effective use of the resources.
VMware DRS Requirements
To take advantage of VMware DRS, there are several requirements that need to be met to ensure taking advantage of the Distributed Resource Scheduler functionality. These include:
- A cluster of ESXi hosts
- vCenter Server
- Enterprise Plus License
- vMotion is required for automatic load balancing
DRS Migration Thresholds
DRS includes a very useful setting to control the amount of imbalance that will be tolerated before DRS recommendations will be made. To control the amount of imbalance tolerated, there are five DRS migration thresholds.
The range is 1-one (most conservative) to 5-Five (most aggressive).
DRS tolerates less imbalance in a cluster with more aggressive settings. The more conservative, the more DRS tolerates imbalance. The range is One-1 (most conservative) to Five-5 (most aggressive).
DRS tolerates less imbalance in a cluster for more aggressive settings. The DRS tolerates more imbalance in a cluster with more conservative settings.
DRS Automation Levels
DRS automation levels are an important feature of DRS. As DRS continues to scan the vSphere Cluster and provide recommendations for every 5 minutes, we can determine whether or not DRS is able to perform its recommendations automatically or manually i.e. it only suggests changes that should be made and you have to do it yourself. DRS has three DRS automation levels. These include:
- Fully automated – In this fully automated practice, DRS applies both the load balancing and initial placement recommendations automatically.
- Partially Automated – With partial automation practice, DRS applies recommendations only for the initial placement of VMs automatically. For load balance, DRS only suggest the changes that should be made.
- Manual – In manual mode practice, DRS only suggests the changes that should be made and you must apply the recommendations for both initial placement and load balancing recommendations by yourself.
VMware DRS Actions
After every five minutes when VMware DRS runs on a vSphere Cluster, it determines if there are any imbalances that exist in the cluster. If DRS found the vSphere cluster is imbalanced, a vMotion will be performed to move designated VMs from one ESXi host to another.
How exactly does DRS determine if virtual machines are better suited to one ESXi host or another?
To determine the right ESXi host that should accommodate a particular VM, DRS runs a special algorithm. When any VM is powered on, this algorithm observes the resource distribution across the vSphere Cluster and after it ensures that there are no constraint violations if a particular VM is placed on a particular ESXi host, it boots that VM on that particular ESXi host.
Moreover, the demand of the VM itself is taken into consideration so the VM will hopefully not be lack for resources when it is powered on. What is included in VM demand? A VM’s demand includes the number of resources needed to run.
- For CPU demand, this is calculated based on the amount of CPU the VM is currently consuming
- For memory, demand is calculated based on the formula: VM memory demand = Function (Active memory used, Swapped, Shared) + 25% (idle consumed memory). This shows that the DRS memory balance is based mainly on a VM’s active memory usage. While DRS considers a small amount of its idle consumed memory as a protection for any increase in workload.
VMware DRS VM/Host Rules
There is a very much useful feature found while using VMware DRS to control the placement of VMs in your vSphere DRS-enabled clusters. This is VM/Host Rules feature. The VM/Host Rules allows us to run specific VMs on specific ESXi host. These VM/Host rules, we can think like affinity rules.
The VM/Host rules allow you to create an affinity between VMs and Hosts in a vSphere Cluster:
- Keep virtual machines together
- Separate virtual machines
- Tie Virtual Machines to specific hosts
- Tie Virtual Machines to virtual machines
In what type of situations, we can use these VM/Host rules?
One of the standard situations where we can use these affinity rules that exist is with domain controllers. Generally speaking, if we are running all of our domain controllers in a virtualized environment such as a vSphere Cluster, we want to make sure that we have our domain controller virtual machines on different ESXi hosts inside the cluster. In this way, if you’ve got an ESXi host go down alongside one among your domain controllers, you continue to have DC that’s subject to a Separate Virtual Machines rule that’s keeping it off an equivalent host as another DC.
VM Overrides for DRS
The vSphere Cluster provides well-detailed granularity at the lowest level also for operations that affecting individual VMs inside the vSphere Cluster. To define more specific settings for each individual VM in vSphere Cluster, we can create VM Overrides to override global settings set at the cluster level for HA and DRS.
CPU and Memory Utilization Summary
VMware DRS provides a complete high-level view of the CPU utilization summary for ESXi hosts in the vSphere Cluster of their individual CPU resources. For this, navigate to Cluster > Monitor > vSphere DRS > CPU Utilization.
The same high-level overview can be viewed for memory utilization as well. For this, navigate to Cluster > Monitor > vSphere DRS > Memory Utilization.
The VMware DRS checks the resources demands of different VMs and determines whether there is a better ESXi host for the VM to be placed on in the vSphere cluster.
The Best of Both Worlds
Are VMware vSphere HA and VMware DRS technologies competitors?
No, actually they are not. In reality, it is highly suggested that use both vSphere HA and VMware DRS together. They both combine automatic failover with load balancing functionality and features. Thus we can create a much more resilient and more balanced vSphere environment.
If one of the ESXi hosts’ failure occurs, vSphere HA will move the VMs on that host and restart the VMs on the remaining healthy hosts in a vSphere Cluster. So, to do this, of course, in the first priority, the requirement is the availability of virtual machine resources. Here VMware DRS will run and determine if any imbalance exists between the ESXi hosts running the workloads. Based on the configured migration threshold, VMware DRS will make recommendations to resolve any imbalances in the cluster. These recommendations will either be automatically actioned or only recommended and action needs to be done manually, based on the configured automation level.
Final Thoughts on VMware vSphere HA and DRS
In a production vSphere Cluster environment, running both VMware vSphere HA and DRS are highly recommended. Using DRS and HA technologies helps to ensure your workloads continuously have the resources required based on the CPU/memory demands of the VM and to make them highly-available.
Understanding how HA and DRS mechanisms work is very helpful to you as a vSphere administrator. As an administrator, we can leverage both technologies in the best way possible and in accord with best practices. Among the advantages that both technologies bring to us, each feature is extremely easy to enable and configure. With a few simple clicks in the configuration of our vSphere Clusters, we can quickly start benefiting from these available cluster-level features.
This is the end part of my VMware vSphere important features series blog, where we discussed in detail VMware DRS and vSphere HA.
Sumaiyya S Bagwan | Technical Trainer
SevenMentor Pvt. Ltd.
Call the Trainer and Book your free demo Class now!!!
© Copyright 2020 | Sevenmentor Pvt Ltd.