Convert to generation 2 on a VM in Hyper-V 2012 R2 with Powershell
I have done blog posts about why you should create your new VM´s with Windows Server 2012 instead of 2008 R2 or older even if you were not able to create them with the generation 2 at that time as the Windows 2012 R2 was not released back then.
I also did a blog post how to use a third party product to do the migration from generation 1 to 2 with Double Take Move software.
Now I found John Howards script that he has made public that does the migration from generation 1 to 2 🙂 He also has a blog series about generation 2 VM´s that is definitely worth the time to check out.
I got an error when running it though and it seems that it does not work so good with the partition on the gen 1 virtual disk.. It appears that when I have created my virtual machine with the Convert-WindowsImage.ps1 script that only creates one partition the row in the script that checks for $partitions.length fails and I could not get it to continue but when I commented that away I got my first conversion on the way 🙂
And here you can se in the PowerShell ISE my alteration 🙂
Now I am sure that John and his team will work and distribute new versions with correct error checking and I am truly glad that they have released this so I could test it right now anyway 🙂 !!
Here is my VM in generation 1
And here is the converted VM,
And here you can see that during the conversion that I have two disks attached to my server and that the one at the bottom has got some new partitions for the gen 2 UEFI boot process
Happy converting and making generation 2 VM´s your standard in Hyper-V