Hyper-V

Converting a Hyper-V Pass-Through Disk to a VHDX

How do I convert a Hyper-V pass-through disk to a VHDX disk?

After learning about the merits of VHDX format virtual hard disks, you might decide to convert any physical pass-through disks to VHDX on your Windows Server 2012 hosts. Luckily, Microsoft provides us with a way to do this in Hyper-V Manager.

The first step is the tricky one: The virtual machine must not use the pass-through disk so that you can mount the disk exclusively on a machine that has the Hyper-V Manager installed. This will require a maintenance window.

Next, open Disk Management on the Hyper-V Manager machine and note the disk number. In our example below it is Disk 3.

Hyper-V Passthrough disk

Sponsored Content

Maximize Value from Microsoft Defender

In this ebook, you’ll learn why Red Canary’s platform and expertise bring you the highest possible value from your Microsoft Defender for Endpoint investment, deployment, or migration.

Open up Hyper-V Manager, and select New >Hard Disk under Actions. This opens the New Virtual Hard Disk Wizard.

Select the VHDX format, choose the type (Fixed Size or Dynamically Expanding), and choose the name and location of the new VHDX file.

The crucial step in the process comes in the Configure Disk screen. Choose Copy the Contents of the Specified Physical Disk, and select the disk that you identified in Disk Management (again, in this example, it’s Disk 3).

The Hyper-V VHD Wizard

On completion of the wizard, a new VHDX file will be created. You can then edit the properties of the machine and replace the pass-through disk with the VHDX file. Remember to remove the disk from Failover Cluster Manager if the virtual machine was highly available.

Converting a Hyper-V Pass-Through Disk Using PowerShell

You can also do this conversion using PowerShell. The first step is to identify the physical disk. Use Get-Disk to list the disks. Again, in this example the disk ID is 3.

Next you will run New-VHD to create a new VHDX file, then use the -SourceDisk flag to point at a physical disk to convert. The following example converts physical disk 3 into a dynamically expanding VHDX:

​New-VHD -Path "D:\VHD\Converted.VHDX" -Dynamic –SourceDisk 3

The above approaches will create a VHDX file with a physical sector size of 4K and a logical sector size of 512 bytes. Using the -SourceDisk flag with New-VHD prevents the use of the -LogicalSectorSize flag. If you want to create a VHDX with a 4K logical sector size then you will have to create a new (and blank) VHDX, attach it, and copy (or restore from backup) the files from the pass-through disk.

Some suggestions:

  • Your pass-through disk might reside on a SAN that supports LUN cloning. Create a clone of the LUN and test the process and the results. This will also tell you how long the production conversion will take.
  • Presence of Offloaded Data Transfer (ODX) might accelerate the conversion process if the pass-through disk and the new VHDX reside on the same SAN.

Related Topics:

Aidan Finn, Microsoft Most Valuable Professional (MVP), has been working in IT since 1996. He has worked as a consultant and administrator for the likes of Innofactor Norway, Amdahl DMR, Fujitsu, Barclays and Hypo Real Estate Bank International where he dealt with large and complex IT infrastructures and MicroWarehouse Ltd. where he worked with Microsoft partners in the small/medium business space.
External Sharing and Guest User Access in Microsoft 365 and Teams

This eBook will dive into policy considerations you need to make when creating and managing guest user access to your Teams network, as well as the different layers of guest access and the common challenges that accompany a more complicated Microsoft 365 infrastructure.

You will learn:

  • Who should be allowed to be invited as a guest?
  • What type of guests should be able to access files in SharePoint and OneDrive?
  • How should guests be offboarded?
  • How should you determine who has access to sensitive information in your environment?

Sponsored by: