Windows Server TechCenter > Windows Server Forums > Hyper-V > NIC info lost in reinstallation... will export fix this?
Ask a questionAsk a question
 

AnswerNIC info lost in reinstallation... will export fix this?

  • Tuesday, November 03, 2009 9:26 AMFinlandRobert Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Earlier this year when I updated the hardware in my HP DL580 G5 using HP's Systems Management tool, (OS on mirrored drives on one controller, VMs on RAID 5 on second controller), it killed the Windows 2008 OS. I did not export the VMs... When I was ready to update the hardware, I just shut down the server and pulled all the drives in the data array. When the new OS was installed with HyperV and all the updates, etc, I shut down the server and plugged back in the drives. The new installation saw the drive, and All was right with the world, then I realized that every VM had lost its NIC information... I had to log into each one and manually enter the static IP information for every server. I'm currently planning to upgrade the firmware again, and install Server 2008 R2. My currernt plan is to export the VMs to an external drive as a backup strategy just in case, and then pull the drives again prior to the hardware updates and OS installation. I'd like to save the time that it will take to import all the VMs, as they'll still be right where they were prior to the rebuild, but I don't want to go through manual NIC configuration on these VMs again either.

    Will exporting then importing the VMs retain their NIC configuration when they are imported and brought back up in the new OS?

Answers

  • Wednesday, November 04, 2009 6:51 AMVincent HuMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi,

     

    Based on my experience, after the import on the new server or after reinstallation, it will keep the NIC configuration only when you set static MAC address for the VM.

     

    By the way, you don’t have to export the VMs with VHD files, you can only export the configuration files. In Windows Server 2008 R2, there is no GUI to export the VM only with configurations, you can copy the code in the following link, save it as a .VBS file(such as Export.VBS) and run the following command on an elevated command prompt line:

     

    ----------------------------

    cscript Export.vbs vmName exportDirectoryName

    ----------------------------

    For example: D:\>cscript Export.vbs Test_VM D:\Backup (Test_VM is the name of my VM)

     

    In addition, you can import the VM from the Hyper-V Manager. However, you have to select the option “Copy the virtual machine(create a new unique ID)”, if not you will receive the following error:

     

    Note: When you copy the code from the link, you may copy it to a Doc file first and then copy the content from the Doc file to a txt file, I noticed that if you copy the content directly from the web to a txt file, you may encounter the typeset problem.

     

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

     

     

    Best Regards,

    Vincent Hu

     

All Replies

  • Wednesday, November 04, 2009 6:51 AMVincent HuMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi,

     

    Based on my experience, after the import on the new server or after reinstallation, it will keep the NIC configuration only when you set static MAC address for the VM.

     

    By the way, you don’t have to export the VMs with VHD files, you can only export the configuration files. In Windows Server 2008 R2, there is no GUI to export the VM only with configurations, you can copy the code in the following link, save it as a .VBS file(such as Export.VBS) and run the following command on an elevated command prompt line:

     

    ----------------------------

    cscript Export.vbs vmName exportDirectoryName

    ----------------------------

    For example: D:\>cscript Export.vbs Test_VM D:\Backup (Test_VM is the name of my VM)

     

    In addition, you can import the VM from the Hyper-V Manager. However, you have to select the option “Copy the virtual machine(create a new unique ID)”, if not you will receive the following error:

     

    Note: When you copy the code from the link, you may copy it to a Doc file first and then copy the content from the Doc file to a txt file, I noticed that if you copy the content directly from the web to a txt file, you may encounter the typeset problem.

     

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

     

     

    Best Regards,

    Vincent Hu

     

  • Monday, November 09, 2009 9:14 AMFinlandRobert Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    OK, so that is why I lose the NIC configuration - I'm using dymanic MAC assignment. Not a biggie in this rebuild, because I have to install the new integration files anyway.

    To make sure I have the VMs backed up correctly, I would then export the configuration file and copy the vhd file to external storage? Would that would be the steps to take if I were moving the VHDs to another server?
  • Tuesday, November 10, 2009 7:57 AMVincent HuMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

     

    If you rebuild the system on the same server, you don’t need to move the VHDs to another server, you can just leave them at their original place(such as D:\VMs).

     

    Note: If you move the VHDs to another place, after the reinstallation, please copy the VHDs to it’s original place, if not, you will not be able to import the VM properly.

     

    Best Regards,

    Vincent Hu