Share via


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

Comments

  • Anonymous
    March 23, 2014
    Why am I just finding this out today? Why? WHY? Trying this out now.
  • Anonymous
    May 28, 2014
    You can use it only with VMM 2012 R2 when you created it through Service Template.
  • Anonymous
    May 28, 2014
    You can use it only with VMM 2012 R2 when you created it through Service Template.
  • Anonymous
    March 03, 2015
    It is a nice feature but you loose so much management capability when trying to manage from VMM. might as well throw VMM out and just use FCM and HyperV manager. What a waste of time.
  • Anonymous
    May 06, 2015
    This feature is essentially useless in its current state as I found out the hard way. Assuming a physical hyperV cluster running VMs, some of which have virtual clusters - everything is fine if the CSV the shared .vhdx resides on is owned by the physical host the VM is running on. However if the VM is migrated onto a different physical host then regardless of the fact it is hosted on a CSV volume, it falls back to redirected IO across the cluster networks, which is a performance killer. MS denied this over the course of weeks while I was investigating, then once we got the product team involved they agreed this is how it works and agreed to change the documentation that stated otherwise.
    If you want to use shared .vhdx for testing or on a single host, it will work just fine. Want to use it for anything serious? think again.
  • Anonymous
    May 06, 2015
    btw - this was about 17 months ago I was doing this work, but to my knowledge nothing has changed and the product team stated they do not intend to make updates/changes to the way it works, at least until version.next - but even then wouldn't confirm/deny.
  • Anonymous
    May 07, 2015
    SAP and Microsoft are continuously adding new features and functionalities to the SAP on SQL Server platform
  • Anonymous
    June 12, 2015
    It is a great feature to set up guest clusters inside Hyper-V until you want to resize the shared VHDX ... and find out it is only possible when the whole cluster is down. As shared storage spaces are not supported on VMs (the virtual disks would be extendable) there is no easy solution for it, is it ? Pity, looked really nice.
  • Anonymous
    December 04, 2015
    Joe Gough, can you please provide references and documentation to what you are alluding to?
  • Anonymous
    February 15, 2016
    What Joe is referring to is documented here https://blogs.technet.microsoft.com/askpfeplat/2015/05/31/how-shared-vhdx-works-on-server-2012-r2/