As you begin to deploy Microsoft Virtual Server 2005 R2 in a production environment, the performance of the virtual machines running on it becomes increasingly important. Not only do you have an operating system that you can tweak for performance increases, you also have a host operating system the virtual machine resides on that can be tweaked. This article is devoted to covering some of the configuration changes and maintenance tasks you can use to increase the performance of your virtual machines.
Installing the Virtual Machines Additions package is by far one of the most overlooked things that can be done to speed up a Virtual Server implementation. VM Additions are specialized drivers that allow for more efficient interaction between the host and guest operating systems on a physical server. Along with general performance increases, some of the other enhancements provided with VM additions include more fluid mouse control transitioning between host and guest operating systems, time synchronization, and optimized video drivers.
The VM Additions installation process is very simple:
You will then be prompted to restart the virtual machine. Once you do so, VM Additions will be successfully installed, and you should notice a pretty immediate performance increase.
Figure 1. Installing Virtual Machine Additions is commonly overlooked but provides a major performance increase. (Click to enlarge.)
A fragmented hard drive is a surefire way to sink your virtual machines into a slump of slowness. This slowness will be especially evident when you start, stop, pause, and resume your virtual machines. To remedy this and ensure performance continuity, you must defragment all hard drives that store VHD files. As an added note, when using dynamically expanding hard disks, you will want to use the virtual hard disk precompactor and compactor utilities to shrink your VHD files before defragmenting. This will decrease the amount of time it takes to defragment your hard drives.
Real-time virus scanning of your virtual machine VHD files on a host operating system could result in a dramatic speed decrease. As an alternative to this, you should make sure all of your guest operating systems are configured with virus protection. When this is being done, you can simply exclude VHD files from your real-time scanning on the host operating system.
The biggest thing that limits the number of virtual machines you can run on a physical server is the amount of RAM in it. You must be absolutely sure you have allocated enough RAM for use by the host operating system, as well as all of the guest operating systems running on the virtual machines.
You must also take into consideration that there is an approximate 32 MB memory overhead added to each virtual machine in order to allow for Virtual Server processing. This being the case, you should always add 32 MB of RAM per virtual machine to your calculations when figuring out your memory requirements in a Virtual Server installation.
As an example, consider a scenario in which we are setting up a Virtual Server installation that will host three virtual machines. We have determined that our host operating system will require 512 MB of memory. From here, we have determined that our virtual machines will require 256 MB, 512 MB, and 1 GB, respectively. This being the case, we should purchase a server with at least 2.4 GB RAM (1,024 + 512 + 512 + 256 + 32 + 32 + 32 = 2,400 MB). Figure 2 illustrates how to calculate how much RAM you need on a server.
Figure 2. Calculating RAM requirements ahead of time can help you gain an edge in the performance of your virtual machines. Don't forget about the 32MB overhead.
Just be sure to plan ahead when calculating RAM requirements for a new Virtual Server installation. Just because you only need a certain amount right now doesn't mean you won't need more later. It is always better to have a little extra than not enough.
Another overlooked consideration when setting up a Virtual Server is the type of hard drive on which you store your virtual machines. Both virtual and physical SCSI hard drives use a considerably wider data path and can increase performance dramatically. Additionally, it is good practice to store your VHD files on a physical disk that is separate from the physical disk running the host operating system.
Although dynamically expanding virtual hard disks has its advantages, you should not use them unless you really need to. The constant expanding and contracting of a VHD file's size can cause a significant bottleneck in performance. Using a fixed-size VHD eliminates this process and its accompanying bottleneck.
The host operating system plays a very important role in managing the communication from the virtual machines to the physical hardware. With this being the case, it is not good practice to share services with a virtual server host operating system. The server hosting all of your virtual machines should not also be your exchange server, proxy server, web server, etc. Get one server to act as a virtual server, and leave it at that.
Employing all or even just some of these techniques can lead to dramatic performance increases in your Virtual Server installation. One of the major highlights of using a virtual server deployment is a more effective allocation and utilization of physical resources, and the steps outlined here can dramatically increase this benefit.
Chris Sanders is the network administrator for one of the largest public school systems in the state of Kentucky. For more about Chris, you can view his personal blog at http://www.chrissanders.org.
Return to the Windows DevCenter.
Copyright © 2009 O'Reilly Media, Inc.