Developer Support Team Foundation Server

Tips, tricks, thoughts and experiences from the Microsoft Team Foundation Server global support team.

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

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

  • Comments 3

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:

http://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.

  • I'm getting the same error. I was hoping to not have to make copies of my VHDs!

  • I think I found a solution. You can edit the exported VM config and change the "CopyVmStorage" value from FALSE to TRUE. It worked for me.

    Find this value:

    <PROPERTY NAME="CopyVmStorage" TYPE="boolean"><VALUE>FALSE</VALUE></PROPERTY>

    Change it to:

    <PROPERTY NAME="CopyVmStorage" TYPE="boolean"><VALUE>TRUE</VALUE></PROPERTY>

  • I found the solution to this. In the script you need to specify the path to all the disks that are used in the VM Config. It is on line number 83 (starts with "newSourceResourcePaths(0)"). Not a nice script - you have to adapt it for every VM you want to import. Or modify it to get the right paths... Christian

Page 1 of 1 (3 items)
Leave a Comment
  • Please add 6 and 2 and type the answer here:
  • Post