Virtual Hard Disk Performance: Authors: Liang Yang Anthony F. Voellm
Virtual Hard Disk Performance: Authors: Liang Yang Anthony F. Voellm
Virtual Hard Disk Performance: Authors: Liang Yang Anthony F. Voellm
Authors:
Liang Yang
Anthony F. Voellm
1
This document is provided “as-is.” Information and views expressed in this document, including URL and other
Internet Web site references, may change without notice. You bear the risk of using it.
This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You
may copy and use this document for your internal, reference purposes.
Microsoft, Windows, Windows Server, Hyper-V are either registered trademarks or trademarks of Microsoft
Corporation in the United States and/or other countries.
The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
2
Contents
1. Introduction.........................................................................................................................................4
2. Performance Measurement Methodologies.......................................................................................6
A. Test Details......................................................................................................................................6
Choice of Targets: Raw Disk vs. Regular File vs. VHD...........................................................................6
Windows hypervisor impact on performance measurement..............................................................7
Choice of Workloads............................................................................................................................7
Choice of Performance Metrics...........................................................................................................8
Choice of Target File Size.....................................................................................................................9
Choice of Data Block Size.....................................................................................................................9
Choice of VHD Attach Mode................................................................................................................9
Reducing variation in measurements................................................................................................10
B. Test tools.......................................................................................................................................10
C. Server Platform and Operating System..........................................................................................10
D. Storage Platform Settings..............................................................................................................10
Storage Platform Hardware Settings.................................................................................................10
Storage Platform Software Settings...................................................................................................11
E. Virtual Hard Disk (VHD) Details......................................................................................................12
F. File System and Volume Settings...................................................................................................14
3. Comparison of Windows Server 2008 and Windows Server 2008 R2 VHD Performance..................15
G. Fixed Virtual Hard Disk creation speed..........................................................................................15
H. Fixed Sized VHD Performance Comparison...................................................................................16
SQL Server Log Workload..................................................................................................................16
Exchange Server Workload................................................................................................................17
I. Dynamically Expanding VHD Performance Comparison................................................................18
Media Streaming Workload...............................................................................................................19
Online Transaction Processing Workload..........................................................................................20
J. Differencing VHD Performance Comparison..................................................................................21
Web Server Log Workload.................................................................................................................22
Decision Support System Database Workload...................................................................................23
Performance Impact of Differencing Chain Length............................................................................24
4. Comparison of Native and Virtual Machine VHD Performance.........................................................25
K. Hyper-V Virtual Machine Performance Testing Settings................................................................25
5. Comparison of VHD type performance [fixed sized vs. dynamically expanding vs. differencing]......28
6. How to choose your Hyper-V and VHD Storage Container Format...................................................30
7. Summary of supported and practical limits.......................................................................................32
8. Closing...............................................................................................................................................34
9. Acknowledgements...........................................................................................................................35
10. References.....................................................................................................................................35
3
1. Introduction
A virtual hard disk (VHD) is a file that encapsulates a hard disk image. VHDs can be used in new and
interesting ways. VHDs first were created to be the storage media for virtual machines (VMs). Today,
VHDs are used to ship trial versions of software, used in backup solutions, used for bug triage (e.g.
customers can convert a physical disk to virtual and share it), and even used to store multiple boot
environments. VHDs are a very flexible storage container and are not tied to any single file system
format. Since June 2005, Microsoft has made the VHD Image Format Specification available to third
parties under the Microsoft Open Specification Promise (OSP).
Microsoft began using VHD technology in Microsoft Virtual PC around 2003, and then continued its use
in Microsoft Virtual Server release in 2005. The next major release happened as part of Hyper-V in
Windows Server 2008. Currently VHD support is made as part of Windows Server 2008 R2 and high-end
client SKUs of Windows 7. VHDs were limited to use by virtual machines running in Virtual PC/Virtual
Server/Hyper-V and loopback mounting of VHDs in the parent partition sometimes referred to as the
management operating system. The integration of VHD support into the operating system was
drastically improved in Windows Server 2008 R2 which added native support. Native support means the
technology is integrated into the operating system and no longer requires a virtualization solution such
as Hyper-V to be available. Native support added the following features:
There are three VHD formats each with different performance characteristics. The three formats of
VHD are fixed, dynamic and differencing.
4
A fixed sized VHD uses a file in which the space to store the file is allocated on the physical storage when the
virtual hard disk is created. The file size is the same as the size specified for the virtual hard disk. As their name
implies, fixed sized VHDs occupy the same space on the underlying physical storage device as their specified size.
However, once a fixed sized VHD is created, the size can be increased when the disk is offline by editing the disk to
expand it. Reducing the size is not supported. Because the physical storage required for a fixed size VHD is
allocated when the VHD is created, there is a better chance at optimal placement and organization on-disk which
yields the best performance. The disadvantage is the space is committed even if it is not used.
VHD Size
A dynamically expanding VHD is a file that at any given time is as large as the actual data written to it
plus the size of on-disk meta-data. Dynamically expanding disks are useful because they do not require
all the storage needed to contain the maximum size of the disk to be reserved up front. The VHD file
starts quite small (e.g. 42KB is a typical physical size of an empty 20GB disk) and grows as new blocks in
the disk are used. There are a number of optimizations around dynamically expanding disks that
improve performance; however, in general their read/write performance is slower than fixed disks. One
optimization is the selection of data block size which can be either 512KB or 2MB; another is skipping
allocation of all-zero blocks.
VHD Size
A differencing VHD is a file representing the current state of the virtual hard disk as a set of modified
blocks in comparison to a parent virtual hard disk. Differencing VHDs can be associated with either a
fixed sized or dynamically expanding VHD. Differencing VHDs can also be associated with another
5
differencing VHD but they cannot be associated with a physical disk. Differencing VHDs are used to
prevent changes from being made in their parent VHD to which they are applied and are used to
implement a number of additional features. In Hyper-V, differencing VHDs are also created
automatically whenever snapshots are taken of a virtual machine. Note differencing VHDs used for
snapshot purpose are named with an AVHD file extension to help users easily distinguish them from
regular differencing VHDs. Differencing VHDs may also be used to deploy a “golden” or “master” image,
because you can associate multiple differencing VHDs to one parent VHD. Some disadvantages of
differencing VHDs are increased caching needs and the inability to grow or shrink the VHD size. You can
however compact differencing VHDs to reclaim physical space usage.
VHDs can be mounted only on NTFS volumes (although you can still save a VHD file on
FAT/FAT32 assuming the maximum file size limit is not violated). For example, if you have a
differencing VHD chain, then every VHD along the chain must sit on an NTFS volume to make
VHD attaching work.
VHDs cannot be mounted within a compressed folder in Windows Server 2008 R2. This was
possible in Hyper-V role in Windows Server 2008, but this capability was explicitly blocked in
the Hyper-V role in Windows Server 2008 R2 since the compressed file size limit is relatively
small. A dynamically expandable VHD can easily outgrow that limit and get corrupted.
In addition to the maximum file size of NTFS, dynamic or difference VHDs cannot exceed
2040GB. The reason for the 2040G limit is the length of each Block Allocation Table entry is set
to 4 Bytes and the maximum valid value is 0xFFFFFFFE (0xFFFFFFFF means an unused entry). If
you multiply that value by 512B sector size and then subtract the overhead of on disk meta-data
structures, 2040G will be the maximum size of dynamically or differencing VHDs.
The remainder of this paper is focused on giving in-depth performance data on Virtual Hard Disks.
Comparisons are generally made between native, Window Server 2008 and Windows Server 2008 R2.
When comparing Windows Server 2008 and Window Server 2008 R2, no virtual machines are used
unless explicitly stated. The goal of this paper is to look at virtual hard disk performance and not Hyper-
V performance.
6
quickly determine if a performance issue or performance improvement is solely VHD-related or comes
from other Windows components.
A raw disk provides direct access to the storage media instead of through its file system and is
considered the thinnest layer in terms of sending I/Os down to the disk. This can give us a good
estimation of what the maximum throughput and minimum CPU cycles a VHD can achieve.
Occasionally a raw disk does not give the best performance due to additional optimization (e.g.
I/O batching) done by other layers, but so far it has been proved a sound guard for sanity
validation purposes.
A raw file shares the common I/O paths with a VHD file except those added by the VHD driver
stack. By comparing a VHD with a raw file, we can find out how much overhead the VHD adds on
top of a raw file. Ideally we want a VHD performance to be on-par with a raw file for the major
performance metrics.
Choice of Workloads
We used two types of performance workloads. The advantage of these workloads is that they are
neutral to operating systems and underlying storage platforms. This makes it easier to compare VHD
with other virtual disk formats.
The two overlapping I/O sizes (4K/64K) here also give us another opportunity to compare the
performance of sequential I/O with random ones.
Application-Based Workloads
We picked some of most commonly used server workloads to simulate enterprise customer
scenarios. They are well-recognized by the storage community and adopted by the industry.
7
Workload Category I/O Size Percentage of READ Percentage of RANDOM vs.
vs. WRITE SEQUENTIAL
Web File Server 4KB 95% RD vs. 5% WR 75% RAND vs. 25% SEQ
Web File Server 8KB 95% RD vs. 5% WR 75% RAND vs. 25% SEQ
Web File Server 64KB 95% RD vs. 5% WR 75% RAND vs. 25% SEQ
Workstation 8KB 80% RD vs. 20% WR 80% RAND vs. 20% SEQ
Throughput is measured either in terms of I/Os per second (IOPS) or megabyte per second (MBPs).
Typically under a monolithic I/O workload, for small sized I/Os, we intend to use IOPS while reserving
MBPS for larger sized I/Os. For Application based workloads, we use IOPS exclusively for performance
comparisons. Higher throughput means better performance.
8
Latency (average I/O response time) is measured in terms of milliseconds. Combined with throughput,
we can use latency to easily identify the storage saturation point when throughput gets flat and latency
keeps going up. Lower latency means shorter response time and better performance.
This leads to the question when comparing Windows Server 2008 and Windows Server 2008 R2 if we
should use the default setting or use the same block size in all tests. We chose to use the default
because this is the finely tuned parameter and we want to compare the out-of-box performance
because this is what most users will experience.
Only VHD related components are involved. No Hyper-V storage stack is needed.
The performance results are comparable to a raw file sitting on top of physical file system.
The performance impact of a guest operating system is eliminated.
Unless indicated otherwise, the VHD being tested is attached as a loopback drive on the parent partition,
and then the loopback drive is used as a raw disk during the performance measurement process (just
like how we measure the performance of a physical drive). We use virtual machine mode when there is
a need to compare performance between the parent partition and a virtual machine.
9
Reducing variation in measurements
In reality, an enterprise server may be engaged in many computing activities simultaneously when
dealing with the disk I/O subsystem. To minimize any interference from other applications and get
accurate performance results, we take explicit action to reduce the overhead of other applications and
services. For example, if we leave Hyper-V Manager open during I/O performance measurement within
VM, Hyper-V Manager will periodically communicate with the VM to get the screen contents update.
This can produce skewed results varying the accuracy by as much as 5 to 10%.
B. Test tools
IOMeter is a popular I/O benchmarking tool in storage community and it is also the tool used to
measure native VHD performance. Here are the major IOMeter settings being used in this report:
Version: 2008-06-22RC2(x64)
Ramp-up Time: 30 sec
Test Run Time: 60 sec
Number of IOMeter Worker: 1
I/O Alignment Size: Sector(512B)
10
Sustained data transfer rate for single drive is approximately 160MBps.
Native physical sector size: 512Bytes
Windows Server 2008 R2 ships with the latest driver version available inbox at the
time of writing, 4.5.0
Windows Server 2008 ships with version 2.3.0. We were able to upgrade to 4.4.0
and there is no performance difference between 4.4.0 and 4.5.0.
11
We chose RAID0 for two reasons:
E. VHD Details
The introduction gave an overview description of the different types of VHD. This section gives more
detail on the format and impact on overall performance and usage. The full VHD specification is
available online at http://technet.microsoft.com/en-us/virtualserver/bb676673.aspx .
12
Differencing VHD
A Differencing VHD is very much like the dynamic VHD as they are both dynamically expandable.
Their internal structures remain largely the same although runtime interpretation (e.g. sector
bitmap) may be different. You can convert a differencing VHD to a dynamic VHD by choosing to
merge to a new file. But there are also notable differences between them. For example, you can
expand a dynamic VHD (in terms of virtual size) but that is not allowed for differencing VHDs due to
the inherent size limitation inherited from the parent. A differencing VHD also requires the presence
of its parent to perform I/O activity.
Differencing VHDs are the foundation for Hyper-V VM snapshots and many other customer
scenarios (e.g. multiple client images share the same golden parent image). In the previous section,
we laid out details about physical space usage for fully populated dynamically expanding VHDs. The
Differencing VHD format has added a little bit more overhead in terms of actual physical file size
because it has to use built-in parent locators to save the parent path information. The absolute
parent locator path within a differencing VHD is set to 512B by default and the relative parent
locator path is set to 64KB (this one is indeed optional if there the differencing VHD does not share
any common path with the parent [for example when they are located on different volumes]). When
the native VHD stack tries to open a differencing VHD, both the differencing and the parent VHD are
opened. The parent locator information may get updated when the parent location information is
changed. For example, in case the differencing chain is broken, a reconnect operation lets you
specify the location of parent and re-establish the link between parent and child.
When accessing differencing VHDs, parent VHDs are opened in read only mode by the driver and the
child VHDs are opened in read/write mode so all the changes will stay within the child. However, the
VHD format and VHD driver assume that parent VHD will not change and have no inherent
protection against that assumption. In other words, it is possible to modify a parent VHD which will
corrupt the relationship between it and any child VHDs. A differencing VHD merge into a parent also
corrupts all other sibling VHDs not on the merging path regardless of merging success or not. The
child and the other siblings may never be made aware of if there are changes made in their parent
and results may become unpredictable.
A differencing chain can consist of one or more VHDs. However, the VHD specification and native
VHD driver does not requires the data block size for the entire chain be the same. For best practices,
we recommend using 2MB for both the parent and child VHDs to improve performance as the reads
to the parent may be impacted due to a smaller block size. For certain scenarios like booting a
differencing VHD on a physical machine, the child and parent VHDs must use the same data block
size (note that this rule does not apply to booting a Virtual Machine in Hyper-V). In Windows Server
2008 R2, differencing VHDs created via DiskPart or Hyper-V Manager always uses the same data
block size as the parent. That means you will get a 512KB differencing VHD instead of the default
2MB even in Windows Server 2008 R2 if that is the data block size of the parent VHD. If parent is a
fixed sized VHD, then the default data block size will be always used for the differencing VHD.
13
During performance experiments, the differencing chain length is set to one, i.e. one parent and one
differencing VHD (child). A 2040G dynamically expanding VHD is chosen as the parent and remains
unpopulated. We then fully populate the differencing VHD to make it as big as possible on the
physical volume.
14
3. Comparison of Windows Server 2008 and Windows Server 2008 R2
VHD Performance
The following section compares Windows Server 2008 and Windows Server 2008 R2 overall VHD
performance. We look at creation speed, various workloads, impact of queue depth, block size, chain
depth and other parameters that impact overall VHD performance.
Below is a 2040GB fixed VHD creation speed comparison based on a directly-attached storage between
Windows Server 2008 and Windows Server 2008 R2. Note: the speed improvement may vary on
different storage platforms and VHD file size.
400
350
300
WS08
250 WS08 R2
MBps
200
150
100
50
15
G. Fixed Sized VHD Performance Comparison
The fixed sized VHD performance has been on-par with the physical disk since Windows Server
2008/Hyper-V release to manufacturing In Windows Server R2 fixed VHD performance remains intact,
i.e. it as good as raw disk or raw file.
10000
WS08_RawDisk
8000 WS08_RawFile
WS08_FixedVHD
IOPS
6000
WS08R2_RawDisk
4000 WS08R2_RawFile
WS08R2_FixedVHD
2000
0
1 2 4 8 16 32 64 128 256
I/O Queue Depth
16
SQL Server Log 64KB 100%Sequential 100%Write Latency
30.0000
25.0000
WS08_RawDisk
20.0000 WS08_RawFile
Latency(ms)
WS08_FixedVHD
15.0000
WS08R2_RawDisk
10.0000 WS08R2_RawFile
WS08R2_FixedVHD
5.0000
0.0000
1 2 4 8 16 32 64 128 256
I/O Queue Depth
5000
WS08_RawDisk
4000 WS08_RawFile
WS08_FixedVHD
IOPS
3000
WS08R2_RawDisk
2000
WS08R2_RawFile
1000 WS08R2_FixedVHD
0
1 2 4 8 16 32 64 128 256
I/O Queue Depth
17
Exchange Server 4KB 100%Random 67%Read 33%Write Latency
60.0000
50.0000
WS08_RawDisk
40.0000 WS08_RawFile
Latency(ms)
WS08_FixedVHD
30.0000
WS08R2_RawDisk
20.0000 WS08R2_RawFile
WS08R2_FixedVHD
10.0000
0.0000
1 2 4 8 16 32 64 128 256
I/O Queue Depth
18
Writes
19
Media Streaming Workload
64KB I/O size, 98% Read, 2% Write, 0% Random, 100% Sequential
12000
WS08_RawDisk
10000
WS08_RawFile
8000
WS08_DynamicVHD
IOPS
6000 WS08R2_RawDisk
4000 WS08R2_RawFile
WS08R2_DynamicVHD
2000
0
1 2 4 8 16 32 64 128 256
I/O Queue Depth
30.0000
WS08_RawDisk
25.0000 WS08_RawFile
Latency(ms)
20.0000 WS08_DynamicVHD
WS08R2_RawDisk
15.0000
WS08R2_RawFile
10.0000 WS08R2_DynamicVH
D
5.0000
0.0000
1 2 4 8 16 32 64 128 256
I/O Queue Depth
20
Online Transaction Processing Workload
8KB I/O size, 70% Read, 30% Write, 100% Random, 0% Sequential
5000
WS08_RawDisk
4000 WS08_RawFile
WS08_DynamicVHD
IOPS
3000
WS08R2_RawDisk
2000
WS08R2_RawFile
1000 WS08R2_DynamicVHD
0
1 2 4 8 16 32 64 128 256
I/O Queue Depth
600.0000
WS08_RawDisk
500.0000 WS08_RawFile
Latency(ms)
400.0000 WS08_DynamicVHD
WS08R2_RawDisk
300.0000
WS08R2_RawFile
200.0000 WS08R2_DynamicVHD
100.0000
0.0000
1 2 4 8 16 32 64 128 256
I/O Queue Depth
21
I. Differencing VHD Performance Comparison
The following table shows a summary of peak IOPS comparison for a fully populated 2040G differencing
VHD (depth: 1) using a Dell MD1000 DAS. Note: the queue depth corresponding to the peak IOPS may
differ when comparing Windows Server 2008 with Windows Server 2008 R2.
Peak IOPS Windows Server Windows Peak IOPS Windows Windows Server
2008 Server 2008 R2 Server 2008 R2
2008
4K Sequential 39908 93352 4K 159 5167
Reads Random
Reads
4K Sequential 7320 44933 4K 156 2673
Writes Random
Writes
64K 6782 24651 8K 157 5033
Sequential Random
Reads Reads
64K 1076 10321 8K 155 3129
Sequential Random
Writes Writes
256K 1414 6294 32K 150 4410
Sequential Random
Reads Reads
256K 364 2511 32K 146 3077
Sequential Random
Writes Writes
1M 355 1565 64K 142 3760
Sequential Random
Reads Reads
1M 84 629 64K 136 2904
Sequential Random
Writes Writes
22
Web Server Log Workload
8KB I/O size, 0% Read, 100% Write, 0% Random, 100% Sequential
50000
WS08_RawDisk
40000 WS08_RawFile
WS08_DiffVHD
IOPS
30000
WS08R2_RawDisk
20000
WS08R2_RawFile
10000 WS08R2_DiffVHD
0
1 2 4 8 16 32 64 128 256
I/O Queue Depth
50.0000
WS08_RawDisk
40.0000 WS08_RawFile
Latency(ms)
WS08_DiffVHD
30.0000
WS08R2_RawDisk
20.0000 WS08R2_RawFile
WS08R2_DiffVHD
10.0000
0.0000
1 2 4 8 16 32 64 128 256
I/O Queue Depth
23
Decision Support System Database Workload
1MB I/O size, 100% Read, 0% Write, 100% Random, 0% Sequential
500
WS08_RawDisk
400 WS08_RawFile
WS08_DiffVHD
IOPS
300
WS08R2_RawDisk
200
WS08R2_RawFile
100 WS08R2_DiffVHD
0
1 2 4 8 16 32 64 128 256
I/O Queue Depth
6000.0000
WS08_RawDisk
5000.0000
WS08_RawFile
Latency(ms)
4000.0000 WS08_DiffVHD
WS08R2_RawDisk
3000.0000
WS08R2_RawFile
2000.0000
WS08R2_DiffVHD
1000.0000
0.0000
1 2 4 8 16 32 64 128 256
I/O Queue Depth
24
Performance Impact of Differencing Chain Length
In Windows Server 2008, experiments uncovered a critical performance issue in differencing VHD:
performance of accessing VHDs that belong to a chain of differencing disks degraded very quickly as
differencing chain length increased. This issue has been addressed in Windows Server 2008 R2. The
following performance results show the read performance improvements (all writes are directed only to
the last VHD in the chain) to the top level VHD as the differencing chain length increases.
700.00
600.00
500.00 WS08
WS08
MBps
400.00
R2
300.00
200.00
100.00
0.00
1 2 4 8 16 32 64
Diff VHD Chain Length
10.00
8.00
WS08
WS08
MBps
6.00 R2
4.00
2.00
0.00
1 2 4 8 16 32 64
Diff VHD Chain Length
25
4. Comparison of Native and Virtual Machine VHD Performance
We have been focusing on the performance comparison between physical disk, raw file and a native
VHD all residing on the parent partition. However, VHD was originally designed and developed as the
storage container format for virtualization environments. Virtual Machines remain the most common
use for VHD deployment. In this section, we compare the I/O performance between native storage
(physical disk and native VHD) and virtualized storage (pass-through disk and Virtual Machine VHDs).
26
WS08 R2 Sequential I/Os Throughput (Native vs. Virtual Machine)
1800.00
1600.00
1400.00
1200.00
1000.00 PhysicalDisk(Native)
800.00
PassthruDisk(VM)
600.00
400.00 FixedVHD(Native)
MBps
200.00 FixedVHD(VM)
0.00
500 FixedVHD(VM)
0
27
WS08 R2 Real Apps Workload Throughput (Native vs. Virtual Machine)
18000
16000
14000
12000 PhysicalDisk(Native)
PassthruDisk(VM)
10000
FixedVHD(Native)
8000
FixedVHD(VM)
6000
IOPS
4000
2000
0
The graphs here show the performance gap between a physical disk, pass-thru disk and a fixed VHD
(either attached to native or a VM) is small. The potential performance difference not shown here, may
come from the path length (i.e. CPU cycles per I/O) as a pass-through disk generally requires less CPU
resources due to the shorter path compared with fixed sized VHD.
28
5. Comparison of VHD type performance [fixed sized vs. dynamically
expanding vs. differencing]
Dynamically expanding VHDs are not recommended for virtual machines that run server workloads in a
production environment. Fixed VHD is preferred considering it has better performance with committed
space allocation so it will not run out of physical backing storage.
The following graphs show, in Windows Server 2008 R2, the gap between a fixed VHD and a fully
populated dynamic or differencing VHD is fairly small. The major performance gap comes from small I/O
writes. However, that gap may be widened if the VHD has to expand itself first before taking any user
data.
200.00 DifferencingVHD
0.00
500 DifferencingVHD
0
29
WS08 R2 Real Apps Workload Throughput (Native Mode)
18000
16000
14000
12000
PhysicalDisk
10000
8000 FixedVHD
6000 DynamicVHD
4000 DifferencingVHD
IOPS
2000
0
(Queue Depth:64)
30
6. How to choose your Hyper-V and VHD Storage Container Format
Customers always have to make a choice when they need to decide what the appropriate storage
container format is for deploying virtual machines using Hyper-V. The following summary table is
intended to make the decision-making process easier:
31
Differencing VHD disk space and provide during VHD expanding.
efficient storage usage. Dynamically expanding and
Smaller VHD file size differencing VHDs cannot exceed
makes it more nimble in 2040GB
terms of transporting May get VM paused or VHD
across the network. yanked out if disk space is
Blocks of full zeros will running out due to the dynamic
not get allocated and growth.
thus save the space Shrinking the virtual capacity is
under certain not supported.
circumstances. Expanding is not available for
Compact operation is differencing VHDs due to the
available to reduce the inherent size limitation of parent
actual physical file size. disk.
Defrag is not recommended due
to inherent re-directional layer.
Note: there are types of compaction for dynamic or differencing VHDs. One is done when file system is
presented (i.e. you mount the VHD and bring the disk online and the other is not (VHD is offline). We
recommend mounting a VHD first before doing compaction to improve the efficiency. This is also the
default behavior when a compaction is initiated in Hyper-V Manager. However, DiskPart allows you to
do an offline compaction without prompting you to mount it first. When that is the case, only data
blocks full of zero will get released since no file system is involved. This may limit the effectiveness of the
compact operation. Note that online compaction will fail with a file system limitation error if any volume
snapshots exist.
32
7. Summary of supported and practical limits
Virtual Hard Disks have a lot of flexibility in formats, block size and usage. The following table describes some
architectural limits around VHD in native use and in use by virtual machines followed by their definitions. One
thing worth pointing out here is Windows Server 2008 R2 provides two different user interfaces to deal with VHDs:
Hyper-V Manager and virtual disk service (VDS) based tools DiskMgmt/DiskPart. Customers may note inconsistent
behavior, for example, VHD compaction as discussed previously the maximum size of fixed size VHDs.
Max Fixed Sized VHD Size 2048GB(2040G via Hyper-V Manager) 16TB(2040G via Hyper-V Manager)
Nested Depth – refers to the number of VHDs contained in VHDs that can be attached. For
example nested depth 2 means a VHD is contained in a VHD that is attached.
Default VHD Block size – This is the default size of data blocks in Dynamic and Differencing VHDs.
In R2 the size was increased to improve overall throughput.
Number of Attached VHDs – This is the number of VHDs that can be attached to the system at
any one time. Keep in mind that after all drive letters are used you will have to use volume
naming or junction points to references drives.
Max Differencing VHD chain length – This defines how many virtual hard disks can be associated
in a hierarchical chain of ‘descendents’ – starting with the original parent disk and ending with a
child disk that has no children below it.
33
Max fixed sized/dynamically expanding/differencing VHD Size – This is the maximum size in
bytes that the format can present as a single disk.
In addition to the limits above there are some limits specific to VHD use in virtual machines that impacts
overall performance. The following table lists those limits followed by their description.
Windows Server
Virtualization Feature Windows Server 2008 R2
2008
Largest Virtual SCSI IO Size – This is the maximum size of and IO passed from a VM to the
management partition for processing over the Virtual SCSI path. Larger I/O size may improve
CPU efficiency by reducing I/O split.
Largest Virtual IDE IO Size – This is the maximum size of IO passed from a VM to the
management partition for processing over the Virtual IDE path.
If in addition to the limits above you can also see a feature comparison (including storage) between
Windows Server 2008 and Windows Server 2008 R2 at:
http://blogs.msdn.com/tvoellm/archive/2009/08/05/what-s-new-in-windows-server-2008-r2-hyper-v-
performance-and-scale.aspx
34
8. Closing
Virtual Hard Disk technology has continued to improve release-over–release, both in terms of the
scenarios supported (like boot from VHD) as well as overall performance. This paper details the
significant improvements in dynamically expanding and differencing VHD random performance, the
substantially faster fixed sized VHD creation speed, and almost zero percent drop in throughput to large
differencing VHD chains due to better caching.
When choosing the right VHD for your environment you should consider both the access performance
and storage needs. With the improvements demonstrated in Windows Server 2008 R2 the choice has
less to do with the access speed and more to do with the amount of memory used due to advanced
caching.
35
9. Acknowledgements
We want to thank the following people and the entire VHD team for the contribution and hard work
that were incorporated into the VHD performance improvement in Windows Server 2008 R2:
Dustin Green, Todd Harris, Mike Ebersol, Karthik Thirumalai, John Howard, Chris Eck, Taylor Brown
10. References
36