Virtual machines (VMs) have specific management requirements that don't apply to physical servers. For effective...
VM administration, you need to know how to properly manage, maintain and troubleshoot your VMs.
There are several challenges that you should be aware of to keep your VMs fit and healthy. In this article, I share five virtualization best practices to help you efficiently and effectively manage VMs. For VMware-specific advice, check out this companion article on five ways to improve VMware administration and management.
VM administration tip No. 1: Avoid overallocation
You virtualize physical servers to make use of wasted resources. But many administrators allocate the same amount of resources to virtual machines as they did to physical servers.
When creating a VM, start with the bare-minimum amount of resources.( The beauty of VM administration is that you can easily change a VM's hardware configuration.) In particular, try not to give a VM too many virtual CPUs (vCPUs). It makes CPU scheduling by the hypervisor more challenging, and it can actually slow down VMs instead of making them faster. Many applications run well with just one vCPU. Start there, and you can always increase the number later.
Memory is in high demand on a host, and most VMs are given more than they need for applications. Do your homework, and size the memory properly. Use performance monitoring tools to identify how much memory your applications need.
Disk space is often another wasted resource. You can easily increase the size of a virtual disk and the OS partitions. Start by estimating a disk space amount required, though your estimate that isn't set in stone.
VM administration tip No. 2: Control resource usage
Don't allow VMs to battle for resource usage. Put rules in place to instill some order.
Use built-in VM administration controls to establish priority access to resources, and set limits and reservations on VMs. Using a combination of resource pools, VM shares, limits, reservations and storage and network I/O control, you can customize how VMs access resources. These VM administration tactics ensure that critical VMs aren't resource-starved, and that they get the resources they need for their workloads.
VM administration tip No. 3: Lock down VM permissions
Don't give your VM owners full control over managing VMs at the virtualization layer. There are many granular permissions built into VMware vCenter Server, for example, that can restrict VM owners from performing certain VM operations.
If used improperly, many available operations can be dangerous, and they can also weaken the security of a VM. Permission for operations such as changing a VM's network connection, interacting with the host file system, modifying VM hardware and creating snapshots should be granted only when absolutely necessary.
By locking down the VM permissions, you can improve security. Doing so also protects the host and other VMs if a user does something stupid with a VM.
VM administration tip No. 4: Clean up converted VMs
Many VMs are created through a physical-to-virtual (P2V) conversion process. P2V tools basically encapsulate the physical server into a VM, but they don't remove the applications and drivers that existed on the physical server's hardware.
A converted VM receives new virtual hardware, and when you start the VM for the first time, the guest operating system discovers the new hardware and loads the appropriate drivers. The old physical hardware devices remain hidden in the OS, however. The old hardware no longer exists, but its remnants still consume resources.
Therefore, you should remove these old, hidden devices for maximum efficiency. You should also remove hardware-specific applications that may have been installed, such as Hewlett-Packard Co.'s Insight Manager agents or array utilities. Additionally, you should edit a converted VM's virtual hardware and remove extra devices that you don't need. You should also adjust the amount of CPU and memory (which can usually be reduced). And don't forget to change the Windows Hardware Abstraction Layer if you go from a multi-CPU to a single-CPU arrangement.
VM administration tip No. 5: Know how to troubleshoot
Troubleshooting problems with virtual machines is a lot more complex than with physical servers, because you also have to account for the host server and its subsystems. But knowing where to look -- and what to look for -- can make troubleshooting much easier.
In most cases, when a problem with a VM occurs, you will focus troubleshooting efforts on the virtualization layer. Many log files on a host can provide clues to help you pinpoint the problem. Make sure you know the locations of these files and how to access them. You should also be familiar with the host's management console.
The management client provides a nice graphical user interface for host and VM administration, but in some cases you may not be able to use it. Sometimes, the command-line console and utilities are the only methods available to solve problems. Know which commands and syntaxes to use in specific situations. Knowing how to perform these actions -- before you need to use them during a crisis -- is invaluable.
About the expert
Eric Siebert is a 25-year IT veteran with experience in programming, networking, telecom and systems administration. He is a guru-status moderator on the VMware community VMTN forums and maintains vSphere-land.com, a VMware information site.