We have talked a bit in the past about the various files that make up the Hyper-V disk infrastructure, including the two hard disk types that can be created when provisioning a Hyper-V virtual machine. These include the VHD and the VHDX virtual hard disk files. From the outset, Hyper-V has supported the VHD file format as this was the first virtual hard disk file that was supported, long before the VHDX file was introduced.
- What are the various differences between the VHD and VHDX files and what considerations do Hyper-V administrators make when provisioning new virtual machines concerning these file types?
- How do the file types weigh into interactions with Microsoft Azure public cloud?
- How does a Hyper-V administrator convert between the two virtual hard disk file types and when would they want to do so?
We will take a look at Converting Hyper-V VHD to VHDX disks Considerations and see how each above-mentioned questions weigh into decisions made by a Hyper-V administrator.
Hyper-V VHD vs VHDX
The VHD virtual hard disk format was born back in 2003 with a product called Microsoft Virtual PC. The product as branded came from the acquisition of the original company, Connectix, by Microsoft. After 2005, Microsoft made the VHD format available to all third parties under open specification. The first version of Hyper-V made use of the VHD format of virtual hard disk and has been the staple hard disk ever since the release of Hyper-V.
A lot of changes came the way of Microsoft Hyper-V with the release of Windows Server 2012. With Windows Server 2012, the new VHDX virtual hard disk format was introduced and it holds quite a few advantages over the previous hard disk format.
What are some of the advantages of using VHDX virtual hard disks as opposed to the VHD format?
- Supports larger virtual disks – up to 64TB
- More resilient against corruption with special metadata that logs updates
- 4K disk alignment to support much larger big sector disks
- Online resizing
- Better performance than VHD format
With all of the advantages listed above, the VHDX is certainly a superior virtual hard disk specification.
What considerations do Hyper-V administrators need to make when deciding to use VHDX over VHD virtual hard disks?
Considerations When Choosing VHDX vs VHD
One would think that since VHDX is the much more powerful and performant of the two virtual hard disk specifications, Hyper-V administrators would always choose this format when compared to the VHD format. However, there are considerations that need to be made before making that assumption. Hyper-V administrators must take a look at the overall architecture and any portability requirements with other systems, including Microsoft Azure.
A few things that need to be considered are the following:
- Are generation 1 or generation 2 virtual machines in use? Generation 1 VMs can use either the VHD or VHDX format, however, generation 2 VMs can only use the VHDX format
- You must be running Windows Server 2012 Hyper-V version to take advantage of VHDX virtual disk format
- Microsoft Azure public cloud still does not support the VHDX file format
***Note*** If you are using Azure Site Recovery then you can replicate VHDX files to Azure as it will automatically be converted to the VHD format.
- This could be a major consideration for organizations who are looking at interoperability and mobility with Azure environments as the compatibility for VHDX is still just not quite there.
With the above considerations mentioned and weighed into the mix for compatibility, it is however considered best practice if you are running with the current requirements for VHDX files, it would be a good practice to convert from the VHD to VHDX.
Converting from Hyper-V VHD to VHDX Files
Hyper-V actually has a built-in mechanism to convert from using a VHD file to a VHDX file. There is a conversion tool that comes with the Edit Disk functionality. First, let’s create a virtual machine with a VHD hard disk type and then demonstrate how to convert the VHD file to VHDX.
As shown below, when you create a virtual machine, you can choose not to create the hard disk and do this later to have more control over not only the type of disk, but also the allocation of the disk that is used.
We have created a virtual machine that has a VHD hard disk instead of the VHDX hard disk. To convert the hard disk to VHDX format, click the virtual machine in Hyper-V Manager and select the Edit Disk option under the Actions menu.
This will begin the Locate Virtual Hard Disk wizard. The first step is to choose the source disk to be converted. Hyper-V Manager doesn’t prepopulate the disk that is already being used (unfortunately), so you need to choose it.
Now, we have the source VHD disk chosen and ready to begin the conversion process.
The next screen is the Choose Action screen. On this screen you have a number of options including Compact, Convert, and Expand. The option you want to choose here is fairly obvious – Convert. As shown, the Convert option allows converting a virtual hard disk by copying the contents to a new virtual hard disk. The new virtual hard disk can use a different type and format than the original virtual hard disk.
On the Choose Disk Format option page, choose the VHDX option. Note the description of the VHDX format. “This format supports virtual disks up to 64 TB and is resilient to consistency issues that might occur from power failures. This format is not supported in operating systems earlier than Windows Server 2012.”
During the conversion process from VHD to VHDX, you can also choose what the wizard is calling “Disk Type” which is a bit non-intuitive since we are converting the “format” from VHD to VHDX. Here you can select to allocate all the space up front using the Fixed size or choose to leave it at Dynamically expanding disk. This is basically “thick” vs “thin” provisioning.
One the Configure Disk screen, you choose the name of the converted hard disk. Here, we are configuring the vhdx file name for use in the conversion.
Finally, we simply complete the wizard by reviewing the Summary page and then clicking the Finish button.
One thing to note – running through the Edit Virtual Hard Disk wizard does not automatically change the hard disk to the newly converted disk. If you look at the properties of the virtual hard disk on your virtual machine, you will see it is still using the VHD disk. Hit the Browse button and choose the new VHDX disk.
Note, when you select the Browse button, you will see both the VHD and VHDX disks as the process does not get rid of the original VHD disk.
Now, we have the VHDX in place and applied in the settings of the virtual machine. We can simply power on the virtual machine and it will be using the VHDX file.
With every new version of Hyper-V that has been introduced, there are new features and functionality that are added to the various releases. With the Windows Server 2012 release, the VHDX file format has introduced a lot of new features that improve stability, resiliency, and performance with Microsoft Hyper-V. However, there are considerations that need to be made before using VHDX everywhere or converting all of your virtual machines to using VHDX files. If you are using legacy versions of Hyper-V or you have different generation configurations of virtual machines, note that each has abilities to use the various hard disk formatting. Additionally, for those organizations that are heavily invested in Azure, VHDX files are not supported. If you are using Azure Site Recovery, it does have the ability to automatically convert between formats. All in all, the VHDX file format is the superior format of the two types. If you have no reason not to use VHDX, it is certainly recommended to do so.