Latest posts by Vladan Seget (see all)
- Top 5 tips for VMware virtualization-based security - Wed, Sep 11 2019
- VMware VM Hot Add: Changing VM hardware on a running vSphere VM - Fri, Aug 30 2019
- What is the VM Overrides option and how do you use it? - Fri, Aug 16 2019
A balanced cluster means that your hosts in a cluster will be equally (or almost) balanced. If your cluster is unbalanced, your VMs will be automatically hot migrated via vMotion to the hosts with the lowest resource utilization. For example, if you have DRS within your environment, you should not see a host being used at 99% and another one at 50%.
DRS takes care of balancing the VMs via vMotion. In this post, we'll give you a few tips that will allow you to get the most out of VMware DRS and make this technology worth the investment.
VMware DRS is not part of vSphere Standard and is only included in the Enterprise Plus or Platinum versions. It is always a question whether to go for a version of vSphere that has DRS or not. If I had a chance to choose, I'd certainly prefer the licensing option with VMware DRS.
To give you an idea of what's needed, let's start with the basics. VMware vSphere Distributed Resources Scheduler (DRS) requires the following:
- VMware vCenter Server
- VMware vSphere ESXi cluster
- vMotion network enabled on cluster hosts
- Enterprise Plus licensing (or higher)
- Shared storage between ESXi hosts (traditional or hyperconverged via VMware VSAN)
- If using predictive DRS, you will also need to be running vRealize Operations Manager (vROPs), including its license.
VMware DRS tips ^
Use homogenous hardware — The first tip concerns the hardware when forming your clusters. The VMware general rule of thumb is to choose hosts with the same or very similar hardware.
There is a reason for that. When deciding which hosts to group into DRS clusters, try to choose hosts that are as homogeneous as possible in terms of CPU and memory. This improves performance predictability and stability.
DRS speed and lower resource utilization — Upgrade to the latest version of vSphere. The latest vSphere, 6.7, is much more efficient when it comes to DRS speed and resource utilization.
While the vMotion speed itself can't get faster, because it depends on the underlying networking and storage architecture, VMware was able to optimize the speed of decision making before the vMotion happens.
In fact, they achieved 2-3 times faster decision making capability in vSphere 6.7. One of the improvements was the simplified initial placement, which now in vSphere 6.7 does not snapshot the whole environment but rather just uses continuous monitoring, allowing 1-2 seconds to be saved before each decision is made.
This is especially valuable in high-consolidation environments where you will see reduced resource consumption because of DRS enhancements and reduced latency to generate VMotions for load balancing. You will also see faster initial placement of VMs.
Use the Fully Automatic mode — The DRS Automation level can be set to Manual, Partially Automated, or Fully Automated. What's the difference?
- Manual — vCenter will only recommend moving resources.
- Partially Automated — After you create a VM and power it ON, vCenter will automatically place the VM on the best host to keep your cluster in balance. Once the VM is powered on, vCenter will present a migration recommendation, taking into consideration the CPU and memory consumption. The vSphere admin will have to approve the migration.
- Fully Automated — vCenter is in control of initial placement and VM migrations. Everything is fully automatic, and the admin does not see any messages concerning recommendations. No decision from the admin is necessary to keep the cluster balanced.
By default, when you enable DRS on a cluster, the automation level selected at the cluster level is applicable to all VMs that reside in that cluster. You can, however, create individual rules for VMs that need to be separated (or kept together).
Migration Threshold — This option allows you to set a threshold that, when hit, causes DRS to kick in and move VMs around to achieve a perfectly balanced state. As the performance of each VM varies, the host's CPU and memory usage vary as well.
You can move the threshold slider to use one of five settings, ranging from Conservative to Aggressive. The five migration settings generate recommendations based on their assigned priority level.
As you move the slider to the right, each setting allows the inclusion of one lower level of priority. The Conservative setting generates only priority-one recommendations (mandatory recommendations), the next level to the right generates priority-two recommendations and higher, and so on, down to the Aggressive level, which generates priority-five recommendations and higher (that is, all recommendations).
To do that, select your Cluster > Configure > vSphere DRS > Edit > The slider allows you to move from the Conservative (left) to the Aggressive (right) position.
You must determine how aggressively or conservatively that you want DRS to run. I usually keep it in the middle, because if you’re too aggressive, you will most likely be moving your VMs around way too frequently. And remember that with each move, you create pressure on the underlying infrastructure, such as storage or CPU usage. This is because the copy operations during vMotion might saturate network links, and if you don’t have 10GbE (or more), the vMotion operations will be never-ending.
If you leave the setting too low (too conservative), your VMs will not move enough, and the imbalance of your cluster will rise, or will happen more often, without being corrected.
Power off VMs you don't use — Leave powered ON only the VMs you really need. Powered-on VMs consume memory resources and typically consume some CPU resources even when idle.
Even idle VMs with their small utilization of resources can affect DRS decisions. You can obtain a small performance increase by shutting down or suspending VMs that are not being used.
DRS Affinity rules — DRS affinity rules can keep two or more virtual machines on the same ESXi host ("VM/VM affinity"), or, on the other hand, they can make sure they are always on different hosts ("VM/VM anti-affinity").
DRS affinity rules can also be used to make sure a group of virtual machines runs only on a specific group of ESXi hosts ("VM/Host affinity") or never runs on a specific group of hosts ("VM/Host anti-affinity").
Usually it's best to leave the affinity settings unchanged. In some specific and rare cases, however, specifying affinity rules can help improve performance.
To change affinity settings: Select a cluster > Configure > VM/Host Rules > Add, enter a name for the new rule, choose a rule type, and proceed through the GUI as appropriate for the rule type you selected.
Besides the default setting, the affinity setting types are:
Keep Virtual Machines Together — This affinity type can improve performance due to lower latencies of communication between machines.
Separate Virtual Machines — This affinity type can maintain maximal availability of the VMs. For instance, if they are both web server front ends to the same application, you might want to make sure that they aren't affected by server failure (if that happens). So those two VMs would not be powered off at the same time. This can also keep two domain controllers separated on two different hosts, so users can be authenticated and can access resources.
Virtual Machines to Hosts — These affinity types can be useful for clusters with software licensing restrictions or specific availability zone requirements.
Final notes ^
As you can see, VMware vSphere DRS is adaptive for many scenarios. The default settings work out of the box, but you have many choices to adapt it to your environment if needed.
By understanding your workflows and your requirements, you'll be able to configure vSphere DRS to get the maximum performance and maximum benefit from your virtual infrastructure.