Migrating Hyper-V Virtual Machines from Server 2008R2 to Server 2012 – Part 10 of the Migration and Deployment Series

As part of our Migration and Deployment Series today we shift the focus to Hyper-V migrations.  First let’s start with a chart on what is possible for upgrading in place:

image

Standard, Enterprise, and Datacenter editions of Windows Server running Hyper-V are supported as either source or destination servers.

Upgrading to the stand-alone product “Microsoft Hyper-V Server” is not supported, however importing VMs via the migration techniques outlined in this article is supported.

Since in-place upgrades of server operating systems is not something some administrators like to do for various good reasons(ex.  inherited the environment, past hardware issues, lack of documentation for prior deployments), a simpler way to upgrade the Hyper-V infrastructure is to simply blow away the current operating system, then install Server 2012 fresh on the hardware.  The following steps will describe the process of upgrading the infrastructure without upgrading the OS in place. Before getting started there are some really important file locations we need to take note of:

• VM Config (XML) files

• VM Data (VHD) files

• VM Snapshot (XML) pointer files

It is wise to remove, revert, or apply(depending the individual scenarios) all snapshots prior to proceeding. however it is not required.

Notice first that by default in 2008R2, the VM Config and Snapshot files are located in a separate place from the Disk files. (ProgramDataMicrosoftWindowsHyper-V)

image

The Virtual Disk files are located in by default in another folder (%Profile%DocumentsHyper-VVirtual hard disks), hopefully in production these files are located on centralized or some physical disks other than the profile directory:

image

We are now assuming that a Windows Server 2012 instance is available for us with Hyper-V enabled.  If you have not prepared the server yet you can follow along the lab guides found here to get started, skipping the steps for booting to a VHD of course.  So what we want to do is consolidate the folders shown above to a LUN or separate disk than the operating system, then copy them to the target server or mount the LUN that includes the contents,  so that effectively we end up with this collection of subfolders together available on our target Hyper-V system:

image

Next we will want to launch the Hyper-V Manager and click on “Import Virtual Machine”

image

Browse to the location and select the “Virtual Machines” folder:

image

You should be presented with a list of VMs ready to be imported:

image

At the next screen we are asked to choose one of three options.

Register – Assumes that all files exist in this consolidated folder and that the files will continue forward residing in this folder

Restore – Registers the VM configuration files in their current location and copies the other necessary files to new location

Copy – Copies all VM files to a new location for the VM to continue forward running in the new location

For simplicity sake I will leave these VMs in the same folder, however best practices would tell us to make sure the disk files are stored on the fastest disk possible, and normally set away from the hypervisor and applications directories.

image

Now because we are adding virtual machines to a new server it is important to point out that prior to booting any of these virtual machines we will want them pointed to the right virtual switch.  Fortunately the Import Wizard will ask for this.  If you have not setup the Virtual Switches to match the source Hyper-V servers, now would be a good time to do so, then proceed with importing the VMs.  Notice that all of the Virtual Switches appear in the drop down menu.  This will happen for each network card found in the VM.  Once you have selected a switch for each network card the Wizard will proceed to the next step.

image

Finally you will see a summary page for the Import process about to take place.

image

You should now see the VMs in Hyper-V Manager ready to start up.  Take a look at the properties for each if you want to be sure that everything imported properly.

image

We will dig into the Powershell method of importing VMs in the near future as well so stay tuned!

Comments

[...] installment of our 19 part series on Windows 8 and Windows Server 2012, Tommy Patterson gives us Part 10 – Migrating Hyper-V Virtual Machines from Server 2008R2 to Server 2012. Tommy gives us a detailed account of how to move virtual machines on Win 2008 R2 Hyper-V over to [...]

[...] As you start looking into migrating from Server 2008 / 2008 R2 to Windows Server 2012, one of the things that may really push you to make the move is Hyper-V.  With that in mind, it is good to know what it takes to migrate a Server 2008 R2 Hyper-V machine to Server 2012 Hyper-V.  In the latest blog post by my peer, Tommy Patterson, he goes over some simple things to do to make the process easier.  I am including a quick snippet directly from his blog, but you’ll want to read the full article on Tommy’s blog. [...]