Friday, 16 May 2014

Migrating VMs from Hyper-V 2008 R2 to 2012 R2 with VHDX using Dell AppAssure

I have been working on a project where the customer needs to migrate virtual machines from an existing Windows 2008 R2 Hyper-V cluster with VHD format disks to a new Windows 2012 R2 Hyper-V cluster. The new hardware employs Dell PowerEdge R620 servers.

It is well documented that the most favourable way to achieve this goal is by stopping the VMMS on the source 2008 R2 server, copy all the Virtual Machines files over including the virtual disk and configuration and import them into 2012 R2.

The problem with this is the amount of downtime required, as all the VMs on the source host must be powered off and copied in one hit. This could be for example 20 VMs and 4 TBs of data. That's fine if the business can accept this, but most won't!

Another solution is to use Dell AppAssure to perform a bare metal recovery to the new 2012 R2 host. This also allows you to end up with VMs using the new VHDX format even when the source VM was VHD! This is presuming you already have AppAssure as a backup solution, in this case the customer does.

The URL below is a link to the AppAssure KB article with the helicopter view of the operation. 
Performing a Bare Metal Restore for a Windows Machine

Here are the steps you will need to take:

Step 1: Create a new VM on the Windows 2012 R2 host. This is your opportunity to re-jig the virtual hardware. At this stage you can create new VHDX hard drives. These need to be the same size as the source or you can take this opportunity to increase the disk size.

Step 2: Take a final AppAssure snapshot of the VM running on the 2008 R2 host. To do this locate the VM in the AppAssure web GUI. Select the all the disks, as below. Then click 'Force Snapshot.
The job starts and you can monitor this via the Events tab in AppAssure.
After the snapshot has completed you need shut down the source VM ASAP, so that the snapshot doesn't become too dated.

Step 3: Record the VMs IP address information. Shut down the source VM using Hyper-V manager. Make sure you notify user first.

Step 4: Boot the destination VM, making sure you have attached the AppAssure recover ISO, which is detailed in the AppAssure KB above. After the AppAssure recovery environment has booted, note the IP address and Authentication Key on screen.
One of the great features of the recovery CD is that it already has the Hyper-V integration tools integrated to you don't need to fiddle about integrating synthetic drivers into you ISO!

Step 5: Using the AppAssure web GUI find the VM in the list and select 'Recovery Points' find the latest recovery point from the list. Select it and click 'Restore'

Step 6: Chose the destination as detailed below. Tick to confirm you have already booted from the recovery media ISO. Enter the IP address and Activation Code you noted down in step 4 and click next.
Step 7: Disk Mapping, Automatic volume mapping seem to do a good job of matching the source to the destination VHDX. Confirm and click next.

Click finish.

Step 8: Monitoring the recovery. In the AppAssure GUI select 'Events'. You can see that AppAssure is performing a roll-back of the snapshot data to the destination VM.

Step 9: After the recover has finished you can disconnect the AppAssure recovery media. At this point edit the setting of the destination VM and detach the network. This is so when the VM boots it doesn't get a DHCP address and screw up the DNS record. Remember this is a new VM with old disks so it will have a new NIC.

Step 10: Reboot the VM, once it has booted you will need to login with cached credentials and update the integration services. Set the IP address details and reboot. At this point you can edit the VM setting and re-attach the VM Network.

Step and repeat, jobs a good'un!!

Congratulations to the Dell AppAssure team, they really have made this a simple and efficient way to perform a migration! Please also note you could use this technique for moving from VMware to Hyper-V or vice-versa.

Notes: You need to disable or make sure Windows defrag is not active during the AppAssure snapshot, if not the VM won't boot after the restore. Also we saw mixed speeds from 2MB/s to 50MB/s. After the destination VM has booted for the first time you will see the Windows boot menu and abnormal shut down popup.
We managed to squeeze some extra performance out the of the AppAssure server by disabling C and C1e states in the BIOS, and configuring Windows PowerCfg of 'High Performance'

Thanks to James Allen for your assistance.