Is there a way to import a Hyper-V VM into a Hyper-V Server without an export file?

If you export a Hyper-V VM from Hyper-V manager to a folder, it will create a folder inside that folder with the name of the VM being exported, and within that folder will be an XML file that is used for importing, along with the VHD's of the VM, and any configuration files required for the VM to function.

Running VM's within Hyper-V are typically running inside a folder named for the name of the VM as well.  examples:

D:\VM-DATA\VM1 = working folder for VM1
D:\VM-DATA-VM2 = working folder for VM2

If I shut down VM1, copy the folder D:\VM-DATA\VM1 to another Hyper-V server and try to import the VM, I am not able to because of the absence of an export file.  I can create a NEW VM manually and point the hard drives of the new VM to the VHD files contained in the copied folder, however when this VM's boots up none of the NIC settings will be configured and the NIC's that are attached to the new VM will show up with a new name (LOCAL AREA CONNECTION 3, 4, 5, etc...).  The reason for this is the MAC address of the original NIC(s) was contained in the configuration file of the VM, and when we create a new VM but use existing VHD's, a new configuration XML file is generated and that includes a new MAC address for the NIC.

Is there a way to copy the entire VM folder from one server to another and ADD that VM to the target server without importing it?  Or asked a better way, how is the import file formatted, and is there a way to generate an import file from the current configuration files?  

I'm thinking about this from a disaster recovery point of view...we have had operating systems of VM-Hosts corrupt but the data partition stay intact.  We have been able to pull the entire content of folders off of dead VM Hosts and pull them into currently working hosts, but we end up having to create a new VM shell to host the "transplanted" VM VHD's and data services...the biggest issue being that we have a new MAC address of the VM-NIC and the settings default to DYNAMIC.  We need to set the MAC address sometimes (depending on the APP) and reset the NIC from dynamic to STATIC.  If there was a way to import without an import file, or generate one from the existing setup files, OR create a new VM shell and then replace the configuration file generated with the configuration file that was in the original VM's folder, any of these options would make life much easier.

I know that the right way to attack this requirement would be to put the VM's on external storage like iSCSI SAN, and cluster the VM's using Windows clustering services....but this is not an option and we're trying to mitigate the risk of not having that by coming up with a better way to transplant VM's without an import file.
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.

Lee W, MVPTechnology and Business Process AdvisorCommented:
What version of Hyper-V?  I believe 2012 can import VMs without an export
jkeegan123Author Commented:
Hyper-V v2 on Windows 2008 R2.  Currently you cannot import a VM without an export file.
Lee W, MVPTechnology and Business Process AdvisorCommented:
Upgrading to 2012 is not an option?
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.


All these actions can be automated with Powershell scripts. This is not exactly what you're asking, but here's an example of a ps script that will turnoff/export a VM:

You could modify it or look for other ps scripts as needed.
jkeegan123Author Commented:
@leew:  Upgrading to 2012 is definitely an option, but I'm looking for an easy way to deal with 2008R2 disasters, so not in this case.

@Eddie-Lopez:  Thanks, but I'm looking for a way to deal with the VM's in a disaster environment where there would be no time for a script to run, or no way to run it.

I'm looking for a way to get an existing VM with configuration file into a new / different Hyper-V server.
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
I see...

Looks like "Hyper-V Replica" feature would probably fit your needs, unfortunately it involves upgrading to Windows server 2012...

You could also make a PS script that on a schedule (once a day, for example) that would turn off, export, and copy your VM files to your disaster recovery host. Or simply a scheduled batch file that copies your VM vhd to your DS host.

That way if your host fails, you have an updated version of your VM to do a failover.
jkeegan123Author Commented:
These are all great suggestions if we were running an environment with a standby host next to it ready to go...the Windows Server 2012 replication option works great for this!  Unfortunately, we are just mercenaries that often walk into disaster, and in the places that we will encounter hosts in this state, we would not have had any opportunity to do any preventative work.  Furthermore, in the clients that we usually do work, they don't have the budget or the foresight to get a standby server for the WHAT-IF.  so I'm left with what I have.   Since I'm talking about a VM HOST either dying or the host OS corrupting, I'm assuming that all of the DATA PARTITION data is intact, and I'm looking for a way to be able to clone that entire partition and import the VM's without manually re-creating those VM's.  

In example:

When the storm hit in October, We had many VM Hosts come back up with corrupted OS's or damaged hardware.  In all cases, we were able to LIVE-STATE the data volume to external media and restore to a healthy server.  Once that happened, we MANUALLY created all new VM's, and instead of creating a "C" drive, we browsed to the existing one.  Then we added all data volumes as well, and the VM came up as it was without issue, with all drives attached, but the NIC's were not configured.  The LAST thing we had to do was manually re-address the NIC's.  This despite the fact that the VM configuration was in the folder, it just wasn't registered in the new, blank Hyper-V server.

Here is a good example of what I am talking about:

I haven't tried it yet, but this may be the way to go.  Does anyone have any experience doing this in the link attached?

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
jkeegan123Author Commented:
This was the only solution that met the posted questions requirements.
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.