I believe in Hyper-V!

VirtualizationCategory Archives

Convert VHD to VHDX with Hyper-V manager in Windows 8

After few turbulent weeks and rehabilitation I finally have a time to write blog post. For the beginning of “my new life” and my second birthday this will be an “light” post Winking smile. For those how don’t know, before eleven days ago I had two heart attacks in one day, luckily without injuries.

So, let’s begin. In this blog post I would like to explain how to convert .vhd to .vhdx with Hyper-V manager in Windows 8.

First, few things about what is .vhdx I what benefits we get.
VHDX is new virtual hard disk format in WS 2012 and Windows 8. In many ways, VHDX disks offer superior performance, capacity and reliability over Hyper-V’s legacy Virtual Hard Disks.
With the VHDX format we able to create much larger virtual hard disks. Old Hyper-V had a 2 TB limit to VHD’s, but VHDX files have up to a 64 TB capacity. Also, protection against data corruption during power failures my logging updates to the VHDX metadata structures as well as improved alignment of the virtual hard disk format to work well on large sector disks.
The VHDX format also provides the few more features such as; large block sizes for dynamic and differencing disks, which allows these disks to attune to the needs of the workload. The ability to store custom metadata about the file that the user might want to record, like operating system version or patches applied, and so on…

Many of us have virtual machines created with old Hyper-V and if we want to use the new features, we need convert .vhd to .vhdx.
How to do that? This is very simple process and we have two ways to doing that. Over Hyper-V manager GUI and with PowerShell.

Convert .vhd to .vhdx with Hyper-V manager GUI:

Step 1.

1

Step 2.
2

Step 3.
3

Step 4.
4

Step 5.
5

Step 6.
6

Step 7.
7

And after few simple steps we have converted .vhdx.

8

Convert .vhd to .vhdx with PoweShell:

If you prefer PowerShell follow this few steps. Open PowerShell as Administrator and enter few commands like in pictures below.

12
13
14

Enjoy in the new .vhdx features and benefits.

NOTE: You can convert a VHDX to a VHD. But keep in mind and make sure that the VHDX is not bigger than 2TB.

Also, keep in mind that the virtual hard disk will be unavailable during the conversion process. It will create a new virtual hard disk file and delete the old one. As such, you will need enough physical disk space to temporarily accommodate two copies of the virtual hard disk that you are converting.

You can read more about how to convert VHD to VHDX on the links below

Aviraj Ajgekar
Thomas Maurer

Quote from the Petri by Aidan Finn (http://www.petri.co.il/convert-vhd-file-into-vhdx-file.htm#)

“There is one more step that you might consider: When you create a new VHDX file (not converted) it has a physical sector size of 4 K. A converted VHDX file has a physical sector size of 512 Bytes. You can change the physical sector size of a converted VHDX by running this piece of PowerShell before you power up the virtual machine:

set-vhd d:\VM01\Disk0.vhdx -PhysicalSectorSizeBytes 4096

Now you have a virtual machine that is using the best kind of virtual machine storage, the VHDX format virtual hard disk.”

 

Enjoy in Virtualization Smile

KulenDayz 2012 MS Community Event

KulenDayz 2012 conference is regional Microsoft community event which is held in Beli Manastir from August 31.2012 to September 2.2012.
This will be my first KulenDayz conference, and I am very proud that I’ll be the speaker with one lecture and one workshop Winking smile. I’ll talk about System Center 2012 Virtual Machine Manager and App Controller. The main theme of the workshop will be a Private Cloud which I held with my colleague Tomica Kaniški, and where attendees could taste the passion of Private Cloud Smile.
For more information visit official KulenDayz 2012 web site.

I’m looking forward to see you at the KulenDayz 2012. Smile

Convert VMWare image to Hyper-V and stay there forever ;)

Everyone knows that we can convert VMWare virtual machines to Hyper-V with the System Center Virtual Machine Manager 2012 or 2008 R2 through the virtual-to-virtual (V2V) machine conversion process. How to do that you can read here.

But, what to do if we don’t have VMM?
For example; I need convert a few virtual machines from VMWare Workstation (XP, Server 2003 and one Server 2008 R2) to Hyper-V and that VMs I need import on my laptop with Hyper-V role and Windows 8 RP installed.

Here is a small how to:

Step 1.

Uninstall VM tools from your virtual machine. Log into virtual machine, open Control Panel –> Programs and Features and click Uninstall.

Step 2.

Shutdown the virtual machine!
Usually your VMWare VMs are based on SCSI drives, because VMWare recommends SCSI, and the operating systems are Windows XP, Windows Server 2003 or earlier then you have to add then you have to add the IDE driver to your VM before you shut it down in VMWare.
Otherwise you will end up with a converted VM that starts up in Hyper-V with a blue screen of death (BSOD) and 0x0000007B – “Inaccessible Boot Device” error. This is due to the fact that your converted VM will have no Primary IDE Channel and Hyper-V will presume that your converted disk is IDE type and located on the Primary IDE Channel.
Doing a Windows Repair Install can fix the 0x7B Inaccessible Boot Device error – but it’s both time consuming and the result might not be good.

Please note that adding a temporary IDE disk to your VM is not necessary with VMs running Windows 7 or Windows 2008 R2 – they seem to detect the Primary IDE Channel during initial boot phase.

Step 3.

Add a new IDE disk drive to your VM. Make sure that you select “Adapter: IDE 0 Device: 0” under “Virtual Device Node” while creating the new disk (otherwise you might end up with yet another SCSI disk).
3

Step 4.

Boot up your virtual machine with both drives connected and check that it detects your new IDE drive (along with a primary IDE channel and a disk device driver). You should be able to see the new drive as “not initialized” in Disk Management.

Step 5.

Power off your virtual machine and remove the newly created IDE disk from your VM (you can delete it from disk as well). Do not power on your VMware Machine again!

Step 6.

Now convert your VMDK file to VHD format using the Vmdk2Vhd utility that can be downloaded from http://vmtoolkit.com.
1

Step 7.

Create a new Virtual Machine in Hyper-V. Make sure you select “Use an existing virtual hard disk” and select the VHD file that you just created.

Step 8.

Power it on, and reboot when prompted, also check device manager, and do another reboot.

Step 9.

Check that all your applications and services are running.

NOTE: As I mentioned before, If you have Windows Server 2008 R2 or Windows 7 VMs then it’s not necessary to add a temporary IDE disk during migration…

Enjoy migrating to Hyper-V, the best virtualization technology ever Winking smile.