Q
Get started Bring yourself up to speed with our introductory content.

What is the Hyper-V VHD Set format and how is it optimized?

VHD File Set -- a file format new to Windows Server 2016 -- is helpful for IT administrators using guest clusters. Get up to speed on the basics and learn how to optimize it.

Hyper-V VHD Set, introduced in Windows Server 2016, is a virtual disk model you can use as a shared disk for guest...

clusters and clustering between VMs.

Hyper-V VHD Set supports all standard features, including online resizing and Hyper-V replica support; you can even include it in application-consistent checkpoints.

To create Hyper-V VHD Set files, you can use either Hyper-V Manager or PowerShell.

In Hyper-V Manager, navigate to Action, select New and then click Hard Disk. In the Choose Disk Format wizard, select VHD Set and follow the onscreen steps.

To create Hyper-V VHD Set files using PowerShell, execute the following PowerShell commands:

New-VHD -Path C:\Temp\ClusterWitnessDisk.VHDS -SizeBytes 1GB -Dynamic

New-VHD -Path C:\Temp\ClusterDataDisk.VHDS -SizeBytes 10GB -Dynamic

You need to specify the VHDS extension when you create VHD Set files with PowerShell.

Once you create the Hyper-V VHD Set files, you can attach them to the VMs that will participate in the cluster using the PowerShell commands below:

Add-VMHardDiskDrive -VMName "ClusterVM1" -ControllerNumber 0 -ControllerLocation 1 -Path C:\Temp\ClusterWitnessDisk.VHDS -ShareVirtualDisk

Add-VMHardDiskDrive -VMName "ClusterVM2" -ControllerNumber 0 -ControllerLocation 1 -Path C:\Temp\ClusterWitnessDisk.VHDS –ShareVirtualDisk

Optimize Hyper-V VHD Set files with PowerShell

Similar to VHD and VHDX files, you can optimize Hyper-V VHD Set files. You will, however, need to use the Optimize-VHDSet PowerShell command instead of the Optimize-VHD cmdlet that you use for VHD and VHDX files.

To optimize a VHD Set file, execute the following PowerShell command:

Optimize-VHDSet -Path C:\Temp\ClusterDataDisk.VHDS

When you execute the command above, the process compacts the Hyper-V VHD Set file by reclaiming unused blocks and rearranging the blocks so information stored in the VHD Set can be read faster. This improves the performance of the VHD Set file.

You can also resize the VHD Set files by executing the following PowerShell command:

Resize-VHD -Path C:\Temp\ClusterDataDisk.VHDS -SizeBytes 30GB

You can only use Hyper-V VHD Set files for guest clustering. VHD Set files aren't meant for general VM deployments.

This was last published in June 2018

Dig Deeper on Microsoft Hyper-V and Virtual Server

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What are your favorite PowerShell optimization tips?
Cancel

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close