Part 1: Introduction to generation 2 virtual machines Part 2: Networking and boot order Part 3: Storage Part 4: Keyboard for Windows 8 & Windows Server 2012 Part 5: Kernel debugging Part 6: Secure Boot Part 7: FAQ Part 8: Manually migrating generation 1 virtual machines to generation 2 Part 9: Installing from ISO Part 10: Utility for converting generation 1 virtual machines to generation 2 (Convert-VMGeneration)
The final part (at least for now, I’m hoping a guest author will write part 11) of this series on generation 2 virtual machines in Hyper-V re-visits conversion of a generation 1 virtual machine to a generation 2 virtual machine. Part 8 walked through the manual process, assuming it is possible. However, there is an easier way with a PowerShell script I wrote and recently released. Called Convert-VMGeneration.ps1, it can be downloaded from http://code.msdn.microsoft.com/ConvertVMGeneration. The script is intended to make life as simple as possible, reducing as many as reasonably possible manual post-migration fix-ups that may be required.
Convert-VMGeneration.ps1 is self-documenting – after downloading to a local drive, running get-help .\Convert-VMGeneration.ps1 –full will give you everything you need to know on how to use. I will assume that you have read part 8 of this series before use so you understand the three phases of conversion – capture, apply and clone.
A few tips worth mentioning:
Here’s an example of the conversion of a Windows Server 2012 virtual machine. The original virtual machine is highly available. The resulting generation 2 virtual machine will need to be made highly available after migration has completed.
Here’s an example where there are some (potential) issues to resolve. One is that there is an additional data partition on the boot disk for the source VM. Windows Recovery Environment was left enabled during the migration and will not operate correctly in the generation 2 virtual machine. Lastly, the original source boot disk was a differencing disk. Appropriate fix-ups may be required to mirror the configuration on the generation 2 virtual machine.
There are some VM configurations which aren’t handled, and the script will block the conversion:
I hope you find Convert-VMGeneration.ps1 useful. I’ll try to fix any bugs you report as time permits! A note for PowerShell aficionados reading the code – I make no apologies for my lack of PowerShell skills. This was the first time I’ve undertaken writing anything of reasonable complexity in PS. I’m sure there are many ways to make the code more powershellesque in efficiency.
So with that, I’ve reached the end of the planned parts of this series on generation 2 virtual machines in Hyper-V in Windows 8.1 and Windows Server 2012 R2. I hope you enjoyed them and found them and the conversion utility useful. As always, comments, questions and feedback are welcome.
Hi John,Thanks for your amazing script ! I tried it on few VM, works like a charm ! But on few VMs (our Exchange DAG), it keeps stucked a "bios" level with "Getting devices ready". What could be the mistake ?
John when I runnig this script I recived the error:CatgoryInfo: Security Error: PSsecurityExceptionFullQualifiedErrorID: UnauthorizedAccessCan help me?Marcus
Just upgraded my virtual Exchange 2013 (SP1) server with this (after running two ADDCs since months as Gen2 :-)), working like a charm... THX again for this great tool.
Hi, What effect (if any) does this have on the license of the converted VM?
There is no effect on licensing, although reactivation *MAY* be triggered due to the hardware changes depending on the SKU and VL vs non-VL.
Conversion worked fine (it was a vmware to hyper-v converted machine - Gen1) but now something strange happens. The virtual machine is seen in Hyper-v hosts (Hyper-v 2012R2) and in failover cluster manager console but not in SCVMM 2012R2 console. All other
virtual machines converted from VMware and newlly created are seen except this one converted.