Understanding and Using Shared VHDX in Windows Server 2012 R2

VHDX Features

In order to keep pace with the growing storage and performance requirements of virtualized workloads, Microsoft introduced a new virtual hard disk (VHD) format called VHDX in Windows Server 2012. Table 1 summarizes the main improvement areas of the VHDX format in comparison to the VHD format.

Feature

VHD   Format

VHDX Format

Virtual   Disk Size

Up to 2040 GB

Up   to 64 TB

Data   Block Size

Up to 2 MB

Up   to 256 MB

Logical   Sector Size

512 bytes

Up   to 4 KB

Data   Corruption Protection

No

Yes

Table 1: Main Feature Comparison between VHD and VHDX Formats

The VHDX format enhances virtual hard disk I/O performance by increasing the supported logical sector size up to 4 KB, allowing for a faster conversion of physical disks with 4 KB sectors to virtual disks. The increase in supported data block size up to 256 MB allows adjustment to maximize application and physical storage performance patterns. Virtual hard disk data protection from system power failure events is supported using a log which contains entries that represent sector updates to be performed to a VHDX file. In the event that a power failure occurs, log entries that were not written and flushed to the VHDX file are detected, validated, and replayed when the VHDX file is next opened.

When using pass-through disks or SCSI disks with trim-compatible hardware, VHDX supports recovery of space that becomes unallocated to reduce the data footprint on the physical storage. However, this requires Windows Server 2012 for both the Hyper-V host and guest operating system. The advantage is that a VHDX file will only use storage space for real data instead of the defined VHDX file size, even in the case of a fixed disk. In addition to these performance features, VHDX also supports storing custom metadata about a VHDX file that a user wants to record.

Shared VHDX

Building on the Windows Server 2012 support for VHDX files, Windows Server 2012 R2 provides the ability to share VHDX files between multiple virtual machines. This supports the deployment of less complex storage configurations for guest failover clusters to provide cluster-aware application failover between virtual machines. Prior to Windows Server 2012 R2, a guest failover cluster required iSCSI or Virtual Fibre Channel storage configurations and storage device connection directly to the virtual machine. While these options are still available if required, a Windows Server 2012 R2 guest failover cluster can now be simplified by deploying one or more shared VHDX files on Cluster Shared Volumes (CSV) or SMB 3.0 file shares, masking the details of the actual storage system from the virtual machine guest operating system.

Using shared VHDX files works in this scenario because of support for persistent reservations, which provides the method to resolve dynamic contention and transfer of a storage LUN between cluster nodes in the case of a failover event. The supported guest operating systems for virtual machines used to create a guest failover cluster using a shared VHDX configuration include Windows Server 2012 R2 and Windows Server 2012 with Windows Server 2012 R2 Integration Services installed in the guest virtual machine.

Configuration of a Shared VHDX for a Guest Failover Cluster

The configuration of a shared VHDX is performed using Hyper-V Manager, PowerShell, Failover Cluster Manager, or System Center Virtual Machine Manager. In the following example, you can see how easy it is to configure a shared VHDX hosted on a SMB 3.0 share for a guest failover cluster using Failover Cluster Manager and Hyper-V Manager.

  1. In Failover Cluster Manager, select Roles, right-click on a virtual machine, and select Settings (Figure 1). This will open a virtual machine settings window for the selected virtual machine.

Image
Figure 1: Guest virtual machine settings in Failover Cluster Manager

  1. In the Settings window, select SCSI Controller, click Hard Drive, and click Add (Figure 2).

Image
Figure 2: Guest virtual machine settings in Virtual Machine Settings

  1. In the Settings window, select Hard Drive, and click New (Figure 3).

Image
Figure 3: Virtual Hard Disk Creation in Virtual Machine Settings

  1. In the New Virtual Hard Disk Wizard, on the Before You Begin page, select Next (Figure 4).

Image
Figure 4: New Virtual Hard Disk Wizard in Virtual Machine Settings

  1. In the New Virtual Hard Disk Wizard, on the Choose Disk Format page, select the VHDX option, and then click Next (Figure 5).

Image
Figure 5: VHDX Format Selection in New Virtual Hard Disk Wizard

  1. In the New Virtual Hard Disk Wizard, on the Choose Disk Type page, select an option, and then click Next (Figure 6).

Image
Figure 6: Virtual Disk Type Selection in New Virtual Hard Disk Wizard

  1. In the New Virtual Hard Disk Wizard, on the Specify Name and Location page, enter the new VHDX file name and the SMB 3.0 Share where the VHDX will be stored, and then click Next (Figure 7).

Image
Figure 7: VHDX Name and Share Location Entry in New Virtual Hard Disk Wizard

  1. In the New Virtual Hard Disk Wizard, on the Configure Disk page, enter the disk size and then click Next (Figure 8).

Image
Figure 8: VHDX Disk Size Selection in New Virtual Hard Disk Wizard

  1. In the New Virtual Hard Disk Wizard, on the Completing the New Virtual Hard Disk Wizard page, click Finish to create the new VHDX file (Figure 9).

Image
Figure 9: Completing the New Virtual Hard Disk Wizard

  1. In the Settings window, expand the newly added hard drive, select Advanced Features, select Enable virtual hard disk sharing, and then click Apply (Figure 10).

Image
Figure 10: Enabling Virtual Hard Disk Sharing in Virtual Machine Settings

  1. In the Settings windows, click OK.

There are advantages beyond reduced storage complexity and cost when storing shared VHDX files on SMB 3.0 shares. First, your SMB 3.0 shares can be made highly available by deploying them on clustered file servers. When combined with highly available Hyper-V host failover clusters, guest virtual machine failover clustering for applications, and SMB Multipath, you can build very robust environments that provide a highly reliable cloud infrastructure from the virtualization hosts layer to the business application layer, all on top of Windows Server 2012 R2. In addition, you can leverage SMB Direct with compatible network adapters that support Remote Direct Memory Access (RDMA) to maximize network throughput with low latency and lower CPU utilization.

Conclusion

The shared VHDX feature in Windows Server 2012 R2 gives IT staff a new, less complex, and lower cost method to deploy guest failover clusters for cluster-aware applications with high-availability requirements. With the selection of either a CSV or SMB 3.0 architecture to store shared VHDX files, you can abstract the underlying storage system from the guest virtual machines failover clusters without sacrificing the ability to deploy robust, reliable, and high-performance infrastructures.

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top