Thursday, January 30, 2014

Migrate a generation 1 virtual machine to a generation 2 virtual machine in Hyper-V 2012 R2 environment

In Windows Sever 2012 R2, Microsoft introduced a new generation version of virtual machine. It is generation 2 virtual machine. Generation 2 virtual machine supports Windows 8, Windows Server 2012, Windows 8.1 and Windows Server 2012 R2. John Howard, Senior Program Manager in Hyper-V Team of Microsoft, wrote a series of Hyper-V generation 2 virtual machines to talk about all the thing in generation 2 virtual machines and He also wrote a PowerShell script, Convert-VMGeneration, to convert a generation 1 virtual machine to a generation 2 virtual machine. Basically, administrators cannot convert a generation 1 virtual machine to a generation 2 virtual machine directly. However, we can following the steps which are provided by John Howard to migrate a generation 1 virtual machine to a generation 2 virtual machine or using a PowerSehll script, Convert-VMGeneration, to do that.

Before you migrate a generation 1 virtual machine to a generation 2 virtual machine, there are some limitation that we should be aware.
  • Script requirement: It must run on Windows 8.1 or Windows Server 2012 R2 with Hyper-V feature
  • Supported Operating System: Windows 8 (64-bit editions), Windows 8.1 (64-bit editions), Windows Server 2012 and Windows Server 2012 R2
  • Items in a generation 1 virtual machine will not be migrated to a generation 2 virtual machine: Checkpoints (Snapshots), additional data partitions on the source boot disk, Floppy, physical DVD drivers.
  • Non accepted scenario: The virtual machine is running, Hyper-V replica is enabled on a virtual machine, Dual boot virtual machine configuration


Goal 
Using "Convert-VMGeneration" converts a Windows Server 2012 R2 from generation 1 to generation 2.

Prerequisites
  • 1 Hyper-V host named HV02 which is installed Windows Server 2012 R2
  • 1 Windows Server 2012 R2 generation 1 virtual machine named W2012R2
  • Download and save Convert-VMGeneration script at C:\Script in HV02
  • Backup a current virtual machine before perform Convert-VMGeneration (Suggested by John Howard)
Lab
1. On W2012R2 and then log in Local Administrator.
2. Launch "Command Prompt" as administrator. 
3. Perform "reagentc /disable" to disable Windows Recovery Environment (RE).


4. Shut down W2012R2.
5. On HV02, launch "PowerShell" as administrator.
6. Navigate to "C:\Script".
7. Perform ".\Convert-VMGeneration.ps1 -VMName W2012R2 -Path E:\" to convert W2012R2 to a generation 2 virtual machine.


8. Enter "Y".


The virtual machine is converting.


As a result, W2012R2 has been converted to a generation 2 virtual machine.


More information:


This posting is provided “AS IS” with no warranties, and confers no rights!

No comments:

Post a Comment