Cry about...
Windows Hyper-V-Server

There was an unexpected error trying to create the virtual hard disk


When using Hyper-V manager (running on Windows 8) connected to a hyper-v-server and trying to create a new virtual hard drive for a virtual machine on the server, the following error is generated:

New Virtual Hard Disk Wizard

There was an unexpected error trying to create the virtual hard disk.

and the desired new virtual hard disk is not created. This error is created after working through the new virtual hard disk wizard and after clicking "Finish". It does not matter if the new virtual hard disk is attached to an IDE controller or SCSI controller.

Possible Causes and Remedies

Sadly, I wish I knew!

This is one error which I have yet to get to the bottom of.

Work around

As a work around, create the virtual hard disk using PowerShell. This has to be done on the server (use remote desktop) rather than remotely.

To create a virtual hard disk directly on the hyper-v server you will need to use PowerShell.

The following creates a new 60MB virtual hard drive:

New-VHD "C:\Hyper-V\Virtual Machines\Drive1.vhdx" -size 60GB -dynamic

Once you have created a virtual hard drive, you can then use it when creating a new virtual machine in Hyper-V manager.

Possible parameters to Hew-VHD applet:

-Path
This is implied, but it specifes the path of the virtual hard disk. In my example above it is "C:\Hyper-V\Virtual Hard Disks\Drive1.vhdx"

If you just specify the file name without a path then the virtual hard disk is created in the current folder.

The file name used should specify a file ending with either the file extension .vhd or .vhdx. A .vhdx file is a newer format than .vhd virtual hard drive files, which was introduced with Windows Server 2012. It supports larger disk sizes (up to 64TB instead of 2TB), some performance optimisations and is more resilient against corruption. So unless you have a good reason not to, use a .vhdx file in preference to a .vhd file.

-SizeBytes
The size of the virtual hard disk.
-fixed
Create a fixed virtual hard disk.
-dynamix
Create a dynamic virtual hark disk. A drive must be fixed or dynamic, it cannot be both.

For a detailed description of each of the arguments to New-VHD see http://technet.microsoft.com/en-us/library/hh848503.aspx



About the author: is a dedicated software developer and webmaster. For his day job he develops websites and desktop applications as well as providing IT services. He moonlights as a technical author and consultant.