Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

Fixed vs. dynamic disks for Hyper-V virtual machines

As you provision new virtual machines in Hyper-V, you face a key choice: whether to select fixed-size or dynamically expanding disks. This tip explains each disk type's tradeoffs.

Designating the number of CPUs and the amount of RAM for your virtual machines (VMs) is pretty straightforward....

But when it comes to configuring a hard drive, things get trickier. Whenever provisioning new VMs in a Hyper-V environment, selecting the right disk type is a key decision.

With Hyper-V, your choices include fixed, dynamically expanding and passthrough. For the sake of this tip, I focus here on fixed and dynamic disks – specifically, how to configure each type and their strengths and weaknesses -- because a passthrough setup is structurally different from the other two.

First, let's begin with the definition of each disk type. A fixed-size disk is a file-based Virtual Hard Disk (VHD), which has its full size pre-allocated on the physical host volume. A dynamically expanding disk, on the other hand, is a VHD, which starts small -- usually at only a few kilobytes -- and expands as additional storage space is needed. It can only grow, however, to the size limit you designate in the setup wizard.

Dynamically expanding VHDs
To create a new VM, visit the Connect Virtual Hard Disk page in Hyper-V Manager.

Figure 1
Here select the name, location and size of the disk – but not the disk type at the moment. (Click image for an enlarged view.)

By default, the wizard will create only a dynamically expanding disk at the location you choose.

Figure 2
At this point, the disk size will register at 194 KB before the installation of an OS. (Click image for an enlarged view.)

As a dynamically expanding disk, it will continue to grow up to -- but not more than -- the size specified. In this example, the limit is 24 GB. Be careful, though, as it is possible to create a dynamic disk that is larger than the size of your physical hard drive. If this happens, it can affect all the VMs on that volume. A Paused – Critical VM status usually indicates this problem.

Ultimately, there are several reasons to create a dynamically expanding drive: to save volume disk space or to provision and then de-provision VMs quickly. In my environment, I use dynamically expanding disks for test or evaluation installs. These disks are easy to deploy. And if testing functionality is your priority rather than peak performance, this strategy works well.

Fixed-size hard disks
What if you need the best possible performance out of a VHD? This is where a fixed-type disk excels. It not only offers superior performance over its dynamically expanding counterpart but also avoids host level fragmentation. This is because the VHD has expanded to its full size rather than grown in small amounts over time.

To modify the disk you created earlier to a fixed setup, right-click on the newly created VM and choose Settings.

Figure 3
In the next window, the desired hard disk will appear under IDE Controller 0. (Click on the disk, and choose Edit..)

In Hyper-V, all boot disks need to be IDE disks . Subsequent data disks can be SCSII or IDE.

Figure 4
In this case, choose the Convert option to change from a dynamically expanding VHD to a fixed VHD. (Click on the disk, and choose Edit..)

Next, provide a new name for the fixed size disk that is different from the original.

Figure 5
(Click image for an enlarged view.)

After creating a fixed-size disk that can ensure faster performance and less maintenance, there is one last, manual step: attaching the new fixed VHD to your VM.

Figure 6
(Click image for an enlarged view.)

Once the fixed-size disk has been created, the settings window will be open. Just click Browse, then select the name of the fixed-size VHD. Next, click Open and then OK.

Figure 7
The fixed size disk is now attached and ready for installation. (Click image for an enlarged view.)

Fixed-size disks come at a price, however. Since the VHD is at full capacity, you are now using much more physical host volume space and have to size these volumes appropriately to meet VMs' needs. Also, when performing host-level VM backups (1, 2) using the Hyper-V Volume Snapshot Service Writer, the full size or your fixed hard disk will need to be backed up, not just the data size. There are many independent service providers that are working to fixing this dilemma. But, until there is a viable option, this is the sacrifice that needs to made in order to maximize I/O speed, especially for production level workloads.

Table 1: Dynamic vs. fixed disks pros and cons summary
 

 

Pros

Cons

Dynamically expanding disks

  • Quick to provision
  • Good for testing or evaluating VMs

 

  • Reduced virtual machine performance
  • Physical host volume fragmentation
  • Maintenance need to keep dynamically expanding disks efficient
  • Not supported in Hyper-V clustered host

 

Fixed-size disks

  • Best performance for production or developer workloads
  • Minimal physical host volume fragmentation
  • No host-level maintenance needed
  • More space utilized
  • Requires more time to create
  • Affects backup size and time requirements

 

In the environments I have created I have primarily provisioned VMs with fixed-size disks. For my production or longer-term test/development environments, fixed-size disks have proved the best, even with the space requirement drawback. For now, benefits such as maximizing performance, avoiding excessive host volume fragmentation and reducing dynamically expanding disk maintenance outweigh the negatives associated with fixed-size VHDs.

I do, however, use dynamically expanding disks for many short-term or evaluation workloads. Also, dynamically expanding disks ease the VM provisioning/de-provisioning process greatly. Nevertheless, I do not recommend placing both fixed-size disks and dynamically expanding disks on the same volume. This creates fragmentation of a physical host volume where the VMs are located and causes I/O bottlenecks for all VMs.

Ultimately, with the cost of storage coming down, IT systems managers can effectively implement a virtual environment where the benefits of both fixed and dynamically expanding VHDs can be utilized.

About the expert Rob McShinsky is a senior systems engineer at Dartmouth Hitchcock Medical Center in Lebanon, N.H., and has more than 12 years of experience in the industry -- including a focus on server virtualization since 2004. He has been closely involved with Microsoft as an early adopter of Hyper-V and System Center Virtual Machine Manager 2008, as well as a customer reference. In addition, he blogs at VirtuallyAware.com, writing tips and documenting experiences with various virtualization products.


 

This was last published in October 2009

Dig Deeper on Virtualized test and development environments

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close