In the new released Performance Tuning Guidelines for Windows Server 2012 you can find a lot of tuning information for Windows Server 2012 Hyper-V. One important part is the Virtual Disk chapter which is all about the VHD and the new VHDX format.
The basic key takeaways are:
- Use VHDX every time
- Use Dynamic VHDX
The VHDX format:
VHDX is a new virtual hard disk format introduced in Windows Server 2012, which allows you to create resilient high-performance virtual disks up to 64 terabytes. Benefits of this format include:
- Support for virtual hard disk storage capacity of up to 64 terabytes.
- Protection against data corruption during power failures by logging updates to the VHDX metadata structures.
- Ability to store custom metadata about a file, which a user might want to record, such as operating system version or patches applied.
The VHDX format also provides the following performance benefits (each of these is detailed later in this guide):
- Improved alignment of the virtual hard disk format to work well on large sector disks.
- Larger block sizes for dynamic and differential disks, which allows these disks to attune to the needs of the workload.
- 4 KB logical sector virtual disk that allows for increased performance when used by applications and workloads that are designed for 4 KB sectors.
- Efficiency in representing data, which results in smaller file size and allows the underlying physical storage device to reclaim unused space. (Trim requires trim-compatible hardware.)
When you upgrade to Windows Server 2012, we recommend that you convert all VHD files to the VHDX format due to these benefits. The only scenario where it would make sense to keep the files in the VHD format is when a virtual machine has the potential to be moved to a previous release of the Windows Server operating system that supports Hyper-V.
VHD File Type
The following recommendations should be taken into consideration with regards to selecting a VHD file type:
- When using the VHD format, we recommend that you use the fixed type because it has better resiliency and performance characteristics compared to the other VHD file types.
- When using the VHDX format, we recommend that you use the dynamic type because it offers resiliency guarantees in addition to space savings that are associated with allocating space only when there is a need to do so.
- The fixed type is also recommended, irrespective of the format, when the storage on the hosting volume is not actively monitored to ensure that sufficient disk space is present when expanding the VHD file at run time.
- Snapshots of a virtual machine create a differencing VHD to store Writes to the disks. Having only a few snapshots can elevate the CPU usage of storage I/Os, but might not noticeably affect performance except in highly I/O-intensive server workloads. However, having a large chain of snapshots can noticeably affect performance because reading from the VHD can require checking for the requested blocks in many differencing VHDs. Keeping snapshot chains short is important for maintaining good disk I/O performance.
For more information checkout the Performance Tuning Guidelines for Windows Server 2012.
And check out my other post about VHD and VHDX for Hyper-V:
- Windows Server 2012 Hyper-V – How to create a new VHD from a source VHD
- Windows Server 2012 Hyper-V: Convert VHD to VHDX
- Windows Server 8 Hyper-V VHDX improvements
- Hyper-V 3: Attach multiple VHDs via PowerShell
- Windows 8: Client Hyper-V and boot from VHD
Update 1:
My Virtual Machine MVP colleague Carsten Rachfahl just told me that now also IDE devices can use the TRIM function for VHDX files. That means that VHDX on SCSI or IDE controller as well as pass-through disks support TRIM. The only thing which is required is trim-compatible hardware.
Update 2:
Even the GUI in Windows Server 2012 and Windows 8 recommend Fixed size for VHDs and Dynamic expanding for VHDX.
I have now server customer environment running in products for a couple of months and all are using the new Dynamic Expanding VHDX format. No problems and performance issues at all. Dynamic Expanding VHDX disks are even running faster than Fixed Size VHD files.
Tags: dynamic, Fixed, format, Hyper-V, Microsoft, performance, Tuning, VHD, VHDX, Virtual Disk, Windows Server, Windows Server 2012 Last modified: February 13, 2013
Thomas, I have to disagree with you on the “Use Dynamic VHDX” point. A dynamically expanding disk is always prone to fragmentation, which eventually leads to IO and CPU overhead. The Performance tuning doc states this, although it refers to a “VHD” (I’m interpreting this as “Virtual Hard Disk” e.g. any virtual hard disk format, both vhd and vhdx).
As mention this is a quote from the Performance and Tuning Doc ;) But you are right about fragmentation, but do you really care if you working with a enterprise SAN which stores blocks everywhere over “all” disks?
I do think dynamic VHDX is away to go for most of the deployments and there are maybe 2 reasons when you maybe should not use dynamic VHDX. This would be High Performance scenarios and when the CSV, Disk or LUN is not monitored and you could end up with a full disk.
would you recommend using dynamic disks for SQL Servers?
It depends :) I couldn’t make any tests at the moment. But for SQL Servers which need high performance or are performance critical I would still go with a fixed VHDX file.
I think if you go with a fixed VHDX you won’t have any problems but you will lose the advantages of a dynamic VHDX.
I’m also referencing the same doc. Here’s what it says:
-“There are three types of VHD files. Following are the performance characteristics and trade-offs between the three VHD types.” (I’m interpreting this “VHD File” as meaning both VHD and VHDX-format files)
-“Fixed type
Space for the VHD is first allocated when the VHD file is created. This type of VHD file is less apt to fragment, which reduces the I/O throughput when a single I/O is split into multiple I/Os. It has the lowest CPU overhead of the three VHD file types because Reads and Writes do not need to look up the mapping of the block.”
I would be very careful summarizing this into simply recommending dynamic VHDX files for most scenarios, like you’re doing in the top of the blog post, IMHO the reality (and the perf tuning doc) is more granular than that.
Hello
for what i tested and if for example you dont have good raid system.. fixed is better.. dynamic slow everything..
I am now running several customers with dynamic expanding VHDX disks since a couple of months now, no performance issues and problems at all.
What about using creatfil to provide a buffer of 10GB, 20GB, whatever to the dynamic VHDX file. You provision out the server, get your data in place then run creatfil to build some fake data space thus forcing the VHDX to expand. Once completed you defragment the volume where the VHDX is stored, delete the bogus files created by creatfil thus providing you with whitespace for growth. This should allow you to keep provisioning space to a minimum, stop fragmentation however provide you with unlimited growth (to its set limits) of the VHDX if needed. I’m assuming that on most given servers data growth tends to level out and can be predicted to a certain point.
Please help me
I have a VM running exchange 2016. Virtual disk .vhdx type dynamics disk
So grow up large host space
Please help me how to convert type from dynamic=> fixed disk
Thanks