Sashkin - Fotolia


Rely on the hypervisor for VM load balancing

While administrators should aim to evenly distribute workloads, there's no substitute for automated load balancing features.

Most of the big problems related to server virtualization seem to revolve around the issue of resource contention. Think about it for a moment. Server virtualization is based on the idea that server hardware has become more powerful in recent years and most workloads do not require all of the power that a server can deliver. Consequently, multiple workloads can share a set of physical resources.

This idea of resource sharing seems simple enough, but all too often the devil is in the details. If multiple virtualized workloads are sharing a common pool of hardware resources then there has to be some mechanism at work to make sure that none of the virtual machines consume resources to the point that they begin depleting the other VMs of the resources that they need.

Controlling resource consumption

Admittedly, there are a lot of different techniques that are used to keep resource consumption in check. Administrators place limits on the CPU, memory, network, and storage resources that individual VMs can consume. Furthermore, when a VM is created an administrator will typically try to place the VM onto the host server that will be most capable of running the workload without the new workload negatively impacting the performance of existing VMs.

These and other mechanisms do a pretty good job of keeping virtual machines in check. The problem is that server virtualization environments are highly dynamic. A hypervisor might automatically live migrate a workload to another host as a result of a server failure, a host reboot, system maintenance, or a number of other reasons. Similarly, a VM’s resource consumption may change over time. We’ve all seen VMs that start out carrying a relatively light workload but then eventually consume far more resources as more and more users begin to use the application that is running on the VM.

The reason why this is a problem is because changing workloads and automatic live migrations can completely undermine the work that an administrator has done to make sure that VMs are created on the most appropriate host server.

Although it is possible to manually move virtual machines around in response to changing usage patterns, doing so probably isn’t the best idea. It is far more efficient to allow the hypervisor and your management software to handle load balancing automatically.

Load balancing solutions

Each hypervisor vendor has its own load balancing solution. In the case of Microsoft Hyper-V, load balancing can be achieved through the use of a System Setter VM Manager feature called dynamic optimization. The dynamic optimization feature is fairly simple. It performs a periodic check (every 10 minutes by default) to see if the available resources on your host servers have fallen below a predetermined threshold. If any of the servers are found to be low on resources then the dynamic optimization process will live migrate one or more VMs from the overworked host server to a host server that has more resources available.

Dynamic optimization is configured on a per host group level. From within the VM Manager console, go to the Fabric workspace, expand the host group that you want to work with, and then click on a cluster within that host group. Now, click on the Host Cluster tab at the top of the screen and then click on the ribbon’s Optimize Host button. This will cause Windows to open the Optimize Host Cluster dialog box. The dialog box will tell you if any VMs can be live migrated to achieve better performance. Recommendations are only displayed if one or more hosts are running low on hardware resources. If all of the hosts have plenty of resources then no recommendation is given, even if the VMs are not well balanced.

To configure the cluster optimization process to occur automatically, close the dialog box and then click on the Folder tab at the top of the screen and then click the ribbon’s Properties button. This causes the All Host Properties dialog box to be displayed. Now click on Dynamic Optimization and then select the "Automatically Migrate VMs to Balance Load at this Frequency (Minutes)" check box. While you have the dialog box open, you can also configure the load balancing frequency, the server resource threshold values, and the load balancing aggressiveness. More aggressive load balancing makes better use of system resources, but results in a higher number of live migrations. Click OK to complete the process.

In any server virtualization environment, it is important to use hardware resources efficiently. The VM Manager Dynamic Optimization feature can help with this by automatically moving VMs from overburdened hosts to hosts that have more hardware resources available.

Next Steps

Sixload balancing gotchas you should know about

How to load balance a VDI deployment

Load balancing can be tricky with larger VMs

Dig Deeper on Virtual machine performance management