Hyper-V on Windows 10, how to fix a broken VHD

I’m running Windows 10 w/ Hyper-V on my home lab pc, and found a strange Hyper-V error this week.

One of the core things you shouldn’t do with differencing disks is to ever, ever move or edit the parent disk, or else you can break the child disk.  I added some more storage and moved my VHDs around to an all SSD Raid, then found that I’d broken the chain of VHDs for one of my VMs.

When trying to start the VM, this is the error you’ll see.

Img 1
The chain of virtual hard disks is broken. The system cannot locate the parent virtual hard disk for the differencing disk.

Normally, one runs ‘Inspect Disk’ from Hyper-V to locate the parent disk of a child VHD, which will fix the chain of differencing and allow your VMs to access the disks again.  However on Windows 10, clicking ‘Inspect Disk’ will result in Hyper-V throwing a fatal error.

There was a problem with one of the command line parameters. Either 'BEHEMOTH' could not be found, or 'X:\Virtual Machines\Virtual Hard Disks\VM01.vhdx' is not a valid path. Property 'MaxInternalSize' does not exist in class 'Msvm_VirtualHardDiskSettingData'.
There was a problem with one of the command line parameters. Either ‘BEHEMOTH’ could not be found, or ‘X:\Virtual Machines\Virtual Hard Disks\VM01.vhdx’ is not a valid path.
Property ‘MaxInternalSize’ does not exist in class ‘Msvm_VirtualHardDiskSettingData’.

The path is valid and exists. I’ve found a workaround, that of using PowerShell and the Hyper-V module to run Set-VHD, like so:

set-vhd -Path ‘X:\Virtual Machines\Virtual Hard Disks\VM01.vhdx’ `
-ParentPath “X:\Server2012Template\Virtual Hard Disks\Server2012Template.vhdx”

Anyway, this is a bit of a bugger, and I’ve alerted authorities in Redmond, so we should see a fix soon 🙂

Advertisements

4 thoughts on “Hyper-V on Windows 10, how to fix a broken VHD

  1. savindrasingh March 4, 2016 / 5:53 am

    I had the same issue today. Fortunately I had a checkpoint available and I just selected revert option and it is working now.,

  2. savindrasingh March 4, 2016 / 5:55 am

    I had the same issue today. Fortunately I had a checkpoint available and I selected Revert option to restore to previous checkpoint. It is working fine now.

  3. Paul Nicholls March 21, 2016 / 10:48 pm

    I had this problem today, but when I ran the PS command I got an error about mis-matching IDs. I was able to add the -IgnoreIdMismatch parameter to the end though and it fixed it successfully! Thanks for your help.

  4. Mark Morgan (@mjohnmorgan) November 16, 2016 / 5:40 pm

    Lifesaver! Thanks for the tip! In my case I copied ALL of my VHDX and Diff disks from one computer to another. The relative paths did not change a bit. The only thing that changed was the drive letter. I’ve been moving disks like this for years with Hyper-V, and this is the first time it has caused an issue. Sounds like an issue with the Hyper-V service in Win10/Server 2016 not recognizing the relative path somehow. I’m glad PowerShell has the ability to fix this for us!

Have a code issue? Share your code by going to Gist.github.com and pasting your code there, then post the link here!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s