Hyper-V Home Lab – Shared VHDX

Hello,

Have you ever want to try to install a “Scale-Out File Server” or any kind of guest clustering in your home lab ?

If you’re like me, you just have one computer, with some VM’s on it, but no shared storage nor multiple physical computers available for a Hyper-V. That’s not an end, you can build a virtual cluster without any physical shared storage, here’s how :

You have two solutions to present virtual shared storage to your VM’s :

  1. Use the iSCSI Windows Feature (Separate download for 2008R2, integrated since 2012).
  2. Use shared VHDX (Hyper-V 2012R2).

Today, we’ll focus on the shared VHDX solution. The following is completely UNSUPPORTED by Microsoft, we do it for testing/learning purpose ONLY.

  1. On the Hyper-V host, install the fail over clustering feature (Install-WindowsFeature failover-clustering).
  2. Execute that command “fltmc.exe attach svhdxflt E:” with E: being the drive that will contain the shared VHDX.
  3. Make a new VHDX on the drive (New-VHD -Path “e:Shared.vhdx” -SizeBytes 500GB -Dynamic).
  4. Attach that VHDX to your VM’s (Add-VMHardDiskDrive -ControllerType SCSI -Path “e:Shared.vhdx” -VMName $vm -ControllerNumber 0 -SupportPersistentReservations -ControllerLocation 1).
  5. Now, your VHDX is available from the VM’s, you can add it to the cluster (Add-ClusterDisk).

PS : You need to run the FLTMC command at each host’s boot, it isn’t persistent.

 

 

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.