3 min read

Introduction

Shared VHDX is a great feature that was introduced in Windows Server 2012 R2, it’s very easy to set up for guest clustering. However, when you create a guest cluster with shared VHDX you pretty much all the limitations of any other disk cluster with the exception it’s just using VHDX, but with guest clusters you cannot do host-level backup as you do with the physical clusters, you cannot do online resize for shared VHDX, you cannot do storage live migration for the shared VHDX, you cannot protect and replicate VMs with Hyper-V replica, so all these great features are not available.

In Windows Server 2016, Microsoft introduced a new virtual hard disk format called VHD Set (VHDS).

There are three big features that have been introduced with the new VHD Set format. The first one is allowing you to do host-based backup without any agent in the guest, so you can backup the guest clusters with shared virtual hard disk (Check with your backup vendor if they support this feature). The second one is, you can online resize shared virtual hard disk while the guest cluster is running (Note: you can only expand, but you cannot shrink it). The third one is the integration with Hyper-V Replica, so guest clusters can now have Shared VHDX protected by Hyper-V Replica for disaster recovery.

As of this writing, the two limitations of Shared VHD Set in Windows Server 2016 are the following:

Storage live migration for a VM with shared VHD Set is not supported.

Create a checkpoint is not supported.

The Shared (VHDX) file still exists, so if you have an existing guest clusters using (VHDX) file you can continue to use those VHDX files for guest clusters. However, you will not be able to do the online resize and host based level backup. The good news, Microsoft is providing a very quick and easy way to migrate from a shared VHDX to a VHDS file, so you can take advantage of all the new features. Check all the new features in Windows Server 2016 Hyper-V here.

In this blog post, I will share with you on how easy to convert/migrate from a Shared Virtual Hard Disk VHDX to a VHDS Set format.

Migrate a shared VHDX file to a VHD Set file

Converting or Migrating an existing shared VHDX to a VHDS requires taking the VM offline. The recommended process is the following:

Shut down the VMs which are connected to the Shared VHDX. Remove the Shared VHDX from the VM settings. Convert the Shared VHDX to VHDS using Windows PowerShell. Connect the VHD Set to the VMs. Turn on the VMs which are connected to the Shared VHD Set.

All the steps that are mentioned above can be done using Hyper-V Manager console except for the VHDX conversion step. For the sake of this example, we will perform all steps using Windows PowerShell.

Shut down the VMs that you want to migrate by running the following command:

Get-VM -Name VM-Shared* | Stop-VM -TurnOff

Remove the VHDX from the VM by running the following command:

Get-VM -Name VM-Shared* | Get-VMHardDiskDrive | ?{$_.ControllerNumber -ne "0"} | Remove-VMHardDiskDrive

Convert the VHDX to a VHDS by running the following command:

Get-ChildItem -Path 'C:\ClusterStorage\CSV01\Virtual Hard Disks\' -Recurse -Filter *.vhdx | %{Convert-VHD $_.Name ($_.BaseName + ".vhds")}

This script will convert all target VHDXs to VHDSs automatically.

Add the VHDS to the VM by running the following command:

Get-ChildItem -Path 'C:\ClusterStorage\CSV01\Virtual Hard Disks\' -Recurse -Filter *.vhds | % {Add-VMHardDiskDrive -VMName VM-Shared* -Path $_.FullName -ControllerType SCSI -ControllerNumber 1 -SupportPersistentReservations}

Turn on the VMs that you migrated to Shared VHD Set by running the following command:

Get-VM -VMName VM-Shared* | Start-VM -Passthru

Hope this helps!

Cheers,

[email protected]