Shared VHDX Files - My Favorite New Feature in Windows Server 2012 R2

image

Hi Folks –

In my last blog article on improvements to Failover Clustering and Hyper-V, I briefly covered the new shared virtual hard diskfeature, which enables you to use a virtual hard disk file (VHXD file) as shared storage for a virtual machine failover cluster (also known as a guest cluster). This can help you protect the application services running inside your VMs.

This is my favorite new “timesaver” feature because it eases deployment of cluster configurations and it offers a way to quickly use resilient SMB shares for storage rather than FibreChannel or iSCSI.

The VHDX file:

  • Can be used like it is sitting on a SAN. It supports persistent reservations, which enables multiple cluster nodes to coordinate ownership of storage and it can transfer the storage LUN and VHDX file from one node to another if the first node stops functioning.

  • Can be housed on a continuously-available SMB share on a Windows Storage Server 2012 R2 failover cluster.

In my opinion the ability to store the VHDX on a SMB share is the best part. Not only does it enable the shared VHDX file to reside on cost-effective storage instead of a more expensive SAN, but it also enables you to leverage SMB Direct (RMDA) and SMB Multipath to get great reliability, excellent bandwidth, and low CPU overhead for those SMB shares, which further contribute to reliable, low-cost, easy-to-manage storage.

This article on TechNet provides a great overview of virtual hard disk sharing, and this article by Brien Posey (a Microsoft MVP) explains shared VHDX files and their benefits.
 

Key Deployment Scenarios

Using a shared virtual hard disk is ideal for many workloads. This article on TechNet discusses the two main deployment scenarios:

  1. Scenario 1: Hyper-V failover cluster using Cluster Shared Volumes (CSV) on block-level storage. In this scenario, all virtual machine files, including the shared VHDX files are stored on a CSV that is configured as shared storage for a Hyper-V failover cluster.

  2. Scenario 2: Hyper-V failover cluster using file-based storage in a separate Scale-Out File Server. This scenario uses Server Message Block (SMB) file-based storage as the location of the shared VHDX files.

Deployment diagrams for these two scenarios can be found here.

Configure a Shared Virtual Hard Disk in Just a Few Minutes

Configuring a shared VHDX is easy; inside the Hyper-V Manager UI, you will see this new option for virtual hard-disk sharing:

            

clip_image002

Figure 1. Virtual hard disk sharing can be configured using Hyper-V Manager, which is installed along with the Hyper-V role.

  

And if you are using the latest version of System Center Virtual Machine Manager (SCVMM), you can provision it all from the comfort of your remote workstation:

             clip_image004

Figure 2. You can use SCVMM to provision shared virtual hard disk files remotely.

If you prefer a command-line interface, as I often do, you can simply use Windows PowerShell commands to provision a shared VHDX across the cluster nodes and you will save a bunch of time.

New-VHD -Path C:\ClusterStorage\Volume1\Shared.VHDX -Fixed -SizeBytes 30GB

Add-VMHardDiskDrive -VMName Node1 -Path C:\ClusterStorage\Volume1\Shared.VHDX –ShareVirtualDisk

Add-VMHardDiskDrive -VMName Node2 -Path C:\ClusterStorage\Volume1\Shared.VHDX -ShareVirtualDisk

More information on using PowerShell to create a shared VHDX can be found here.

The same article mentioned above also provides a step-by-step overview of the deployment process.


Try it Yourself!

With Windows Server 2012 R2, you can deploy a Hyper-V guest failover cluster that is no longer bound to your storage topology—and shared VHDX files make the process easier than ever. If you’re interested in learning more, this blog article by Jose Baretto shares all the steps required to create a file server demo or test environment, so you can experiment with shared VHDX files and other new features. Enjoy!

Cheers,
Scott M. Johnson
Senior Program Manager
Windows Storage Server
@supersquatchy