Mastering Windows Server 2016 Hyper-V

(Romina) #1

Figure 4. 28 Setting a VHDX file as shared


This process could also be accomplished using PowerShell. In the following example, I
have two virtual machines, savdalfc 01 and savdalfc 02 , to which I will add a shared
VHDX file. Notice the use of the - ShareVirtualDisk switch when I add the VHDX file
to the virtual machine.


New-VHD - Path C:\ClusterStorage\Volume 1 \SharedVHDX\Savdalfcshared 1 .vhdx '



  • Fixed - SizeBytes 25 GB
    Add-VMHardDiskDrive - VMName savdalfc 01 - Path '
    C:\ClusterStorage\Volume 1 \SharedVHDX\Savdalfcshared 1 .vhdx - ShareVirtualDisk
    Add-VMHardDiskDrive - VMName savdalfc 02 - Path '
    C:\ClusterStorage\Volume 1 \SharedVHDX\Savdalfcshared 1 .vhdx - ShareVirtualDisk


To check whether a virtual disk is using a shared VHDX, the
SupportPersistentReservations property can be examined. If the property is set to
True, you have a shared VHDX. For example, notice that my shared VHDX file has a
value of True:


PS C:> Get‐VMHardDiskDrive ‐VMName savdalfc 01 | ft vmname, path, `
controllertype, SupportPersistentReservations - auto


VMName Path ControllerType SupportPersistentReservations




savdalfc 01 C:\ClusterSto..\savdalfc 01 \savdalfc 01 .vhdx SCSI False
savdalfc 01 C:\ClusterSto.. \Shared VHDX\savdalfcshared 1 .vhdx SCSI True


Within the virtual machine, the shared VHDX would be seen as a regular shared SAS
disk and used like normal shared storage. The huge benefit with shared VHDX is that
the virtual machine knows nothing about the underlying storage fabric and provides
complete abstraction for the storage from the physical storage fabric.


Because the VHDX file is shared between multiple virtual machines, the ability to

Free download pdf