To get good virtual machine (VM) consolidation ratios, avoid these common mistakes and apply a little common sense to VM specification and placement.
1. Creating contention
To achieve high consolidation ratios, you’ll want to avoid contention. That can happen when you have more than one VM on the same host, network or storage unit, leading to the possibility they could compete for resources. Focus on the “four core” resources— CPU, memory, disk and network—and make sure that you don’t gather intensive VMs on the same resource.
Separate network- and disk-intensive VMs on different networks or spindles to massively increase scalability, while at the same time reducing the chance of performance problems later.
2. Overtaxing the scheduler
Placing two CPU-intensive VMs on the same physical host will not only tax the CPUs unnecessarily, but also cause the hypervisor’s “scheduler” to work harder. The scheduler decides where the VM’s vCPU executes, and the more vCPUs you allocate to the VM, the harder the scheduler must work to allocate resources to them. Use multiple vCPUs only when you’re 100% sure it will pay dividends. For example, some applications are single-threaded and don’t know how to use multiple CPUs, whether physical or virtual. And, watch out for high “CPU-ready” values, which can mean a VM needs more CPU than your physical host can provide. It’s a key indicator of a potential CPU bottleneck.
3. Incorrectly allocating memory
By far the hardest resource to allocate is memory. We all know more memory is good, but it’s often difficult to judge how much more to allocate. And, liberally over allocating memory with some hypervisors can incur a financial penalty. Some virtualization vendors like VMware have moved to licensing their products by memory. This should make you more cautious about over allocating to VMs that don’t need the resource. However, with those caveats in place, the same recommendation applies—avoid positioning two VMs with large memory demands on the same host.
4. Forgetting what your system can do
With the advanced and enterprise editions of most virtualization platforms, there should be features that allow the live migration of VMs from one host to another to improve performance—for example, VMware’s Distributed Resource Scheduler (DRS). Turn these features on! Experience has shown they make better judgments about the location of VMs than even the best team of human administrators. However, be sure to engage the rules that allow you to make sure that these initial placement systems don’t do silly things, such as placing all your domain controllers or all your Web servers on the same host. What might be good for performance may not be good for availability.
5. Losing your focus on applications and services
We’ve discussed improving consolidation ratios, but your focus should really be on the applications and services within the VM. Don’t lose sight of these. They’re the reason the VM exists. Most performance problems have nothing to do with the VM or the virtualization layer. Focus your performance analysis on the application—what it is doing and how it is configured. Application owners are often unaware of the true load created by end users. Sometimes the application itself hasn’t been optimized for its workload, and a whole heap of defaults and settings have been left untuned.
About the Author
Mike Laverick is a former VMware instructor with 17 years of experience in technologies such as Novell, Windows, Citrix and VMware. Since 2003, he has been involved with the Vmware community. Laverick is a VMware forum moderator and member of the London Vmware User Group. He is also the man behind the virtualization website and blog RTFM Education, where he publishes free guides and utilities for VMware customers. Laverick received the VMware vExpert award in 2009, 2010 and 2011.