Restore Guest OS on Window 2008 Hyper-V

Due to some confliction issue, I have restored the Hyper-V VM  (the XML Document and its folder) and VHD  file (xxx.vhd) for a guest OS. Afterwards, the definition under Hyper-V is name shown under Virtual Machineis disappered.  And I need to create the definition of the VM and relink the file again. However, some information is still missing (eg. IP address..)

Do I miss anything in my guest restore ?

Thanks
AXISHKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BembiCEOCommented:
You can export a virtual machine (if off - right click), this exports
- the HyperV machine configuration (XML)
- the virtual harddisk (optional)
- all snapshots (optional)

The XML File contains the information as set in the HyperV manager. I.r. Number of processors, memory etc., and the NIC MAC address

IP-Addresses (if static) and all configuration settings of the machine itselves is not stored in the XML. These information are stored in the machines registry and therefore on the virtual disk. If such information is lost, your virtual hard disc may not be up to date.  
If your IP is dynamic, the machine may get a new one.

0
AXISHKAuthor Commented:
Is it possible to restore VM using my existing Window 2008 backup ?  I have restored the Hyper-V VM  (the XML Document and its folder) and VHD  file (xxx.vhd) from my backup. But does it include everything that I need for the guest OS ?

Thanks
0
msmamjiCommented:
As the previous expert told you, in order to move VM from one place (HOST, CLUSTER etc) to other, you need to export the VM. The export option takes care of the export configuration in exp file, export the snapshots (if any) and the VHD file. Now since you didn't do the export, you can't use the import feature to import the VM.

You have the XML file which is not a proper import format. The XML file for a VM, hold its configuration and are created and maintained by the Hyper-V Manager itself. The XML file might not be handy for you for that reason.

You can however create a new VM, configure the options (if you remember them) and attach the VHD (from backup) and bring the VM up.  You might see some "New hardware detected" messages on the first boot with this method.

There is however one thing you might be able to do if you want  to bring the VM with original configuration but I haven't tried it myself and I am pretty sure it also unsupported. Create a new VM and configure it whatever way you want, attach the VHD to it. Now, without turning it on, locate its configuration file, open it in notepad and copy the content from the backup XML to this new XML file. Open the configuration of the VM, see if everything seems fine, if you find some configuration errors in the config, it pretty much means that some of the options from the previous XML were not understodd properly. Correct them and start the VM.  I am not sure if this works but in your case it might be worth a try. Keep the copy of the VHD somewhere safe as a backup, just in case.

Regards,
Shahid
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
Actually, I only want to restore all my existing settings and vhd files from the backup copy of Window 2008 into existing Hyper-V server. As my existing definition has been corrupted after serveral testing, I could only create the new definition of VM and re-attach the backup copy of VHD file.

Again, I really wonder how to fully recover existing configuration and VHD file from my Window 2008 backup copy, or we couldn't recover the existing configuration and setting from the Window 2008 and "Export" or re-create a VM definition is the only way to rebuild the image. Really want to clarify on this.

Sorry if there is anything confusing.

Thanks
0
BembiCEOCommented:
As I said before, the config (XLM) file stores the HyperV configuration and the *.vhd is the disk of this virtual machine. As you also can replace or move a physical disk in a physical machine, you can move a logical disk from one virtual machoine to another.

What may happen is, that some devices, which are represented by a GUID (128 Bit number) in the XML file, has to be recognized again as the new GUIDs are different from what is stored on the disk. But as all drivers for virtual machines are the same, it is not a problem at all, to run a virtual disk under a new HyperV Virtual machine definition. That means, each virtual machine has the same virtual hardware, it is the same as you would move the physical harddisc from one physical machine to a absolute identical new pysical machine.

Windows is able in general to rebuild itsself as long as the HAL is the same and all necessary base drivers are recognized by Windows. For virtual machines, this is the case anyway, as the physical hardware do not care. But configuration settings (i.e. for NICs are lost).

If you want to avoid the re-recognition of the hardware, you can backup the files, which are also copied if you export the virtual machine. The Export function just moves the files to another location, that all. And the import function moves them just back to the original place. If you restore all these files later from a tape, the virtual machine will start without problems, as long as they belong together and the virtual machine is not deleted from the virtual machine manager (the host stores the GUID of each virtual machine in its own registry.)

If configuration file and virtual disk are from different backups, you may run into some problems with existing snapshots, but the machine will start in general.

Of course you may be able to recreate an configuration file. But as all devices are represented by GUIDs, you would have find all of them to do this. Creating a new configuration and attaching the virtual disk is just much more easier.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.