Hyper-V Program Manager
Before I get going I want to get this out of the way: Export / import in Hyper-V is by no means intuitive or easy to use. It is definitely something that I hope we can improve in a future release - but for this release it is functional.
So with that behind us, let's start pulling this apart.
If you want to move or copy a virtual machine with Hyper-V, then you will need to use the export / import functionality provided by Hyper-V.
The first thing you need to do is to pick the virtual machine that you want to copy and / or move, and then select Export... from the action menu / pane. You will be presented with the following dialog:
Today I will be looking at the case where you specify an export path (in my case: "C:\Export") but do not check the option to Export only the virtual machine configuration.
Hitting Export will result in Hyper-V copying everything that makes up the selected virtual machine into a new folder under the export path you specify. This new folder will be named after the virtual machine name (in my case: "C:\export\Test Export VM"). Under this new directory will be the following items:
You can freely move / copy / backup this entire directory structure now. When you are ready to import the virtual machine you will need to go the the Hyper-V Manager and select Import Virtual Machine... from the action menu / pane. You will see:
Before clicking Import there are three important things to know:
After you click Import the file structure of the exported virtual machine will remain roughly the same, with the following exceptions:
And now the virtual machine will appear under the Hyper-V manager and you will be able to interact with it directly.
I have a virtual machine I am trying to export.
The virtual machine's size based on it's GUID in the folders \programData\Microsoft\Windows\Hyper-V\Snapshots and Virtual Machines is 35.8 GB. However, when I try to export the VM, it fails bc the required space for export is 120GB.
What's the deal? How is this calculation being made?
An error occurred while attempting to export the virtual machine.
Failed to export virtual machine 'O14 Main Enlistment' because of low disk space under 'H:\Hyper-V\'.
Failed to export virtual machine 'O14 Main Enlistment' because of low disk space under 'H:\Hyper-V\'. The required space is '119128.975285' MB, and the available space is '50516.031250' MB. (Virtual machine ID ACB01786-8CA7-4565-9061-A2879A2C19B3)
[^] Hide details [Close]
Any recommendations on scripting exports/imports?
my best guess would be that there must be some differencing disks or something else you failed to count up when you were figuring out the footprint of the current VM.
Rather than seeking support in the comments section of a blog, I'd suggest you try the Technet Hyper-v forum instead. Odds are you will get a rapid response there, which is not likely here as Ben is doing a lot of travelling right now.
Oh as for scripting the exports dude, learn to google! a search on "hyper-v export script" will find several useful hits on the first page, including this gem here
It would be good practice to set the VM's network adapter(s) connection property to "Not Connected" before exporting. If not a warning message will occur after the import. If moving to a different machine then... I think "Unknown" display's if the adapter was left to a setting.
No matter what (as far as I've been) it's not a problem because you can just go in and select the new server's correct adapter. Nobody likes a little warning notice when importing a machine. Personally I start to wonder if I could have messed something else up too.
Unfortunately, Microsoft didn't make this any better with Windows Server 2008 R2. Customer expect a right-click "Move..." button, but instead they get the old mess. It is unfortunate that Microsoft hasn't improved it. Here are the 3 problems I have experienced:
1. You can't export to a network location (ie: straight to the destination server)
2. It doesn't calculate the size properly (I have no differencing disks, and I checked the size of the export). Same problem as the other poster.
3. I didn't disconnect the network adapter before exporting. I have a warning in import, but it is NOT as simple as removing the network definition in the VM and then adding it back in again. My VM does not get any network connectivity.
So instead of a simple right-click operation, I have burned 6 hours of my time today, the VM has been down the entire time, and I still don't have network connectivity, so I may have to spin the VM back up on the source server and start all over again tomorrow.
Please do us a favor - please tell whoever in Microsoft needs to hear this that the experience MUST be fixed. And while you are talking with them, please tell them that it is completely unacceptable to not support 64-bit clients in VPC.
can you import the VMs from Microsoft for Sharepoint?
I can't import the folder.
Ben, I just following the export instructions and I did export the folder over to the storage location. But...
1. I do not see it go away from the Hyper V manager and
2. I did not see the folder get deleted from its original location.
Do I have to do these things manaually?
Could you update this for 2008R2? The Export command isn't there... If you have come back to this topic in this blog, my apologies, but I couldn't find it.
You need to shutdown the machine on 2008R2 for the export command to appear.
Can you export from a Hyper V 2008 R2 and import it into a 2008 non-R2?
Thanks Ben, i'm so glad this is all much easier in server 2012!
Ben pls confirm Bill S query below about backward compatibility.
It would be nice if it gave you some sort of progress bar while it was doing the exporting. As it is now, it just kind of sits there without any indication that it is work while the export is happening. It takes several minutes to complete and your just left to guess when it's done. Needs better feedback. Am I missing something?
As for a status on the exporting, I was thrown for a second too that I didn't see a progress bar. Then I realized I needed to scroll all the way to the right of my highlighted virtual machine that I was exporting and it had a status column there with progress percentage. :)