Home > Server Virtualization Tips > Virtualization platforms > How to maintain virtual hard disks (VHDs) with Microsoft Virtual Server
Server Virtualization Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

VIRTUALIZATION PLATFORMS

How to maintain virtual hard disks (VHDs) with Microsoft Virtual Server


Anil Desai, site expert
11.07.2006
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


IT staff and end-users tend to demand a lot from their hard disk subsystems. We throw thousands of files and move or copy gigabytes of data practically every day. So it probably comes as no surprise that, over time, this can take its toll on overall performance.

Just like physical hard disks, virtual hard disk (VHD) files need to be maintained over time. In this article, I'll discuss how to maintain VHD performance on Virtual Server host computers.

Note: For an introduction to working with Virtual Server's disk architecture, see Understanding virtual hard disk options.

Monitoring disk performance
Since disk-related throughput and latency often affect overall VM performance, it's important to monitor disk activity to see if you're at or near the capacity of your exiting storage system. Table 1 provides a list of useful System Monitor counters that offer statistics for determining whether disk performance is a bottleneck.

[TABLE]Table 1: Disk-related performance counters

When monitoring disk activity at the host level, you'll get an aggregate view of activity generated by the host and all VMs combined. These statistics are helpful for determining if a hardware upgrade or rearrangement of files is necessary.

By viewing statistics at the level of each VM, you can determine which guest operating systems are generating the most disk activity. All of these details can help clue you in on how the disk subsystem is being used.

Defragmentation
Virtual hard disks are just as susceptible to fragmentation as are physical hard disks. The bad news is that you'll need to worry about disk fragmentation both at the host-level and within each guest OS. The frequency of running defragmenting operations will vary depending on the amount and type of activity within the VMs.

As a general rule, you should use the same schedule that you would use for physical machines that are performing similar activities. So, on a


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   




busy file server, you might want to defragment frequently. And on a largely static-content Web server, you might be able to go months without any performance degradation.

The catch is that you need to coordinate defragmentation operations between VMs and the host. Running multiple defrag operations at the same time will significantly decrease performance and will put a much greater load on the physical disk subsystem. It's a balancing act, but monitoring can help you determine the most appropriate schedule.

Compacting VHDs
Dynamically expanding virtual hard disks can be compacted to reclaim space that is currently allocated on the host system but is not actually used within the guest. This situation can occur if you've deleted a lot of data from within the VM or if files are often moved to and from the VM's file system.

Compacted VHDs are easier to move around (since they're smaller). They can also perform significantly better.

There are two main steps to getting optimal results. The first is to run the Virtual Disk Precompactor – a utility that is available as an ISO file that's included with the installation of Virtual Server. Just attach the ISO (or access the utility over the network) and run the executable from within the VM. The precompactor will reallocate space to ensure that you get the most efficient compact operation.

With the prep work out of the way, you can compact the VHD using the Virtual Server Administration Web site's Inspect Virtual Disks function (see Figure 2). In order to compact a disk, it must not be attached to any running VMs. You'll need roughly twice the total disk space of the size of the VHD, since Virtual Server actually creates a new VHD in the background.

The process can generate a lot of disk I/O and can use significant amounts of CPU time, so you'll want to perform the operation during periods of low activity. Other options are to script the process or to copy the VHDs to a non-production computer and compact them there.

[IMAGE]
Figure 1: Compacting a virtual hard disk

Developing a VM maintenance plan
So far, we've looked at various ways to improve performance. Now, let's look at how you can bring these ideas together to maintain performance in a virtualized production environment. A regular virtual machine maintenance plan might include the following steps:

The frequency of these tasks will vary based on usage patterns for VMs and the amount of downtime available (or, at least, the amount of time during which activity is low). It can be a lot of work, but it's usually worth the effort.

Third-party disk defragmentation tools can also assist with scheduling and centrally managing defragmentation operations.

A stitch in time…
The benefits of a flexible virtual hard disk architecture come at the cost of gradual performance decreases over time. In this article, we looked at ways for monitoring and maintaining the performance of VHDs to ensure adequate VM performance.

Next up in this series is the topic of using network-based storage for your VHDs.

Optimizing Virtual Server directory
Series introduction
Monitoring CPU and memory resources | Managing CPU resource allocation
Designing virtual hard disk storage | Maintaining virtual hard disks
Using network-based storage | Optimizing network performance


Rate this Tip
To rate tips, you must be a member of SearchServerVirtualization.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Search More Tips on Virtual Implementation and Virtualization Platforms

Citrix - Application, Desktop and Server Virtualization Center

HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersEvents
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2006 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts