Tip

Microsoft VHDX format: Understanding benefits, conversion process

Virtualization expert David Davis explains how the new VHDX format in Windows Server 2012 has improved environments, and how to convert old VHD files.

The new VHDX virtual file format in Windows Server 2012 Hyper-V facilitates the conversion of virtual machines to a virtual infrastructure. VHDX is an upgrade to Hyper-V's former Virtual Hard Disk format, and provides benefits such as greater scalability and improved alignment. In this tip, virtualization expert David Davis explains how the VHDX format evolved from VHD, the benefits the new version provides and how to convert old files to VHDX.

One of the major new features of Windows Server 2012 Hyper-V is the VHDX format that now replaces VHD. As for what the X at the end of VHDX stands for, that appears to be a mystery. The X isn't even defined in the official Microsoft VHDX Format Specification.

With Windows Server 2008 R2 Hyper-V, a virtual hard disk was limited to 2 TB in size. This was a serious limitation in Hyper-V and a roadblock for converting certain physical servers to Hyper-V. The VHD format had been around since Microsoft Corp. bought Connectix Corp. and VHD was used with Microsoft Virtual Server.

A VHD (or VHDX) contains everything an operating system (OS) needs to store its data, including a disk partition and file system such as NTFS or FAT. For every virtual machine (VM) created, there's a virtual disk where the OS, applications and data for that VM reside. Of course, you can add multiple VHD or VHDX files to a VM.

What does VHDX offer?

The new VHDX format allows a virtual machine disk file to scale up to 64 TB in size. This is just what large VMs -- such as database servers, file servers, Exchange mailbox servers and more -- needed to be converted into the virtual infrastructure.

Besides the greater scalability of VHDX, it has additional resiliency. The VHDX format offers protection against data corruption when events such as power failures unexpectedly take down the Hyper-V host. Resiliency is possible by logging updates to the VHDX in the VHDX metadata such that those logged updates can be played back to recover the VHDX with integrity after the Hyper-V host is powered back on.

VHDX also offers the following:

  • Improved alignment of the virtual disk on large sector disks.
  • Large block size (4K) for dynamic and differencing disks that allows them to better match the size of the file being stored.
  • Ability to store custom metadata about the file being stored, such as the OS or patches applied.
  • Efficient representation of data, known as the TRIM, so the file can be smaller and the underlying storage can be reclaimed. (Note that physical storage devices attached to the Hyper-V host are required to be TRIM-compatible.)
  • Support for Offloaded Data Transfer (ODX), which allows the storage hardware to perform storage operations, freeing up server resources. Your hardware storage must support ODX.

Of course, like VHD in Hyper-V, VHDX disks can still be created in a fixed, dynamic or differencing disk format.

Inspecting and converting VHDX virtual disks

When you create a new VM in Windows Server 2012 Hyper-V, the default virtual disk format will be VHDX. However, if you need a backward-compatible virtual disk you can easily create a VM with the older VHD format and move it to a Windows Server 2008 Hyper-V host. If you want to convert VMs from the older Hyper-V platform to Windows Server 2012 Hyper-V, the Windows Server 2012 Hyper-V Manager allows you to inspect virtual machine disk files to see what format they are in and then convert VHDs to VHDX disks.

For example, I inspected a virtual machine disk file and found it to be in the older VHD format. (See Image 1: Inspecting the VHD virtual disk.)

Image 1: Inspecting the VHD virtual disk

I then had to shut down the VM to convert its virtual disk to VHDX. I used the "edit disk" option for the conversion. (See Image 2: Converting to VHDX format.)

Image 2: Converting to VHDX formatImage 2: Converting to VHDX format

I then selected the new VHDX format. Note the screen says VHDX is not supported with versions of Hyper-V prior to Windows Server 2012 Hyper-V. (See Image 3: Editing the virtual hard disk.)

Image 3: Editing the virtual hard diskImage 3: Editing the virtual hard disk

When that was completed, I re-inspected the disk at the "Virtual Hard Disk Properties" screen, verified that it was now in a VHDX format and powered on the virtual machine. (See Image 4: Inspecting the VHDX hard disk.)

Image 4: Inspecting the VHDX hard diskImage 4: Inspecting the VHDX hard disk

For a step-by-step walkthrough of this conversion process, watch my video on converting your VHD virtual machines to VHDX.

Dig Deeper on Storage architecture and strategy