Hyper-V Backup / Restore when upgrading to Windows Server 2008 R2

I use Hyper-V and Windows Server 2008 R2 RC right now to host all my TFS reproduction machines, on which I work customer issues. It’s time to move that Hyper-V box to RTM, since it is available to us internally. My Hyper-V server is set up thusly (three physical HDDs):

C Drive: OS
D Drive: Page file
E Drive: Hyper-V files (VHDs, ISOs, snap shots, etc.)

Since I store nothing on C, this makes for a simple FFR (FDisk, Format, Reinstall). I don’t need to remember any settings or copy off any files or what have you (I do this with all my PCs so I can whack them fast if need be. The new “libraries” feature in the Windows 7 code base is making this even easier now). The VPCs for Hyper-V would be on E in both the old and new configuration, so I figured it would be a simple matter of just leaving all the files be and just add them back to the new Hyper-V instance after the new OS was installed. Not so fast! Unlike Virtual Server 2005, it’s not a simple matter to just nuke the Hyper-V install (via the OS reinstall) and then re-add VPCs into the new Hyper-V instance. You need to export\import in order to retain settings and snapshots. This kind of threw me for a loop because it implies that I need a 4th drive – one to export all my Hyper-V files off to - since I don’t have enough space on all my drives to duplicate my current VPCs, what with all the snapshots and drives in use.

So, being who I am I complained about this on an internal discussion list for Hyper-V. My squeaky wheel was given this grease:

blogs.technet.com/virtualization/archive/2009/05/29/hyper-v-r2-import-export-part-6-so-what-happened-to-configuration-only-export.aspx

The recommendation being that I could do a config-only export of the Hyper-V files. Unfortunately, it didn’t work. The export worked but on import I was given an error from the script:

Import failed. Number of parameters supplied for resource paths are not consistent. You should have a SourceResourcePath entry for every CurrentResourcePath entry in import structure.

I also tried using the Hyper-V Manager to import the files I exported using the script. Same error. Sooooo, I just gave up and brought in one of my 1TB drives to export to. All is well now. I am not sure what went wrong with the script(s), and I am by no means disparaging the authors, but I just didn’t have time to troubleshoot it; I needed to move on.

Have a similar experience? Have a recommendation for doing this better? Comment below - I’d love to learn. :-)

-Trev

 

PS: If you have trouble grabbing nicely formatted copies of those scripts from the Virtualization blog like I did (all my copy\paste attempts from that web page resulted in loss of carriage return\line feeds - I got a jumbled mess <g>), let me know via the “Email” page and I’ll send you “good” copies of them.