Q: I have virtual machines running on Windows Server "8" Beta and want to move to the Windows Server 2012 Release Candidate--what do I need to do?
How to import virtual machines in Windows Server 2012 Hyper-V.
July 12, 2012
A: The good news is very little! With the new ability to import virtual machines (VMs) in Windows Server 2012 Hyper-V, even when the VMs weren't exported first, the process is quite simple (this is assuming clustering isn't being used, which would require migration of VMs):
On the existing Hyper-V server, make sure you don't delete the VMs--just stop them and leave them in place.
Install Windows Server 2012 Release Candidate, install the Hyper-V role and any drivers needed to access the storage that contains the VMs.
Make sure you configure Hyper-V with the same network switches with exactly the same name as were available on the previous Windows Server "8" Beta installation.
In Hyper-V Manager, select the Import Virtual Machine action.
Select the location of a VM and run through the import wizard. Within a few clicks, the VM will be imported. Repeat for all VMs to be imported.
It's possible to also import from Windows PowerShell. However, using the GUI does some automated fixing, which doesn't occur when using the Import-VM PowerShell cmdlet, unless you use the Compare-VM cmdlet as well. For example, here are two cmdlets in action, along with resulting output:
PS D:virtuals> import-vm -path 'D:VirtualsAPPVSequenceVirtual Machines8FE19B75-7C0F-4B8E-821E-8A7B06E11938.xml'
import-vm : Unable to import virtual machine due to configuration errors. Please use Compare-VM to repair the virtual
machine.
At line:1 char:1
+ import-vm -path 'D:VirtualsAPPVSequenceVirtual Machines8FE19B75-7C0F-4B8E-82 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-VM], VirtualizationOperationFailedException
+ FullyQualifiedErrorId : Microsoft.HyperV.PowerShell.Commands.ImportVMCommand
PS D:virtuals> $report = compare-vm -path 'D:VirtualsAPPVSequenceVirtual Machines8FE19B75-7C0F-4B8E-821E-8A7B06E11938.xml'
VM : Microsoft.HyperV.PowerShell.VirtualMachine
OperationType : ImportVirtualMachine
Destination : SAVDALHV01
Path : D:VirtualsAPPVSequenceVirtual Machines8FE19B75-7C0F-4B8E-821E-8A7B06E11938.xml
SnapshotPath : D:VirtualsAPPVSequenceSnapshots
VhdDestinationPath :
VhdSourcePath :
Incompatibilities : {33012, 33012}
PS D:virtuals> $report.Incompatibilities | Format-Table -AutoSize
Message MessageId Source
------- --------- ------
Could not find Ethernet switch 'b8c09ad6-7514-4dd7-a050-1c2eb70ec717'. 33012 Microsoft.HyperV.PowerShell.VMNetwo...
Could not find Ethernet switch 'b8c09ad6-7514-4dd7-a050-1c2eb70ec717'. 33012 Microsoft.HyperV.PowerShell.VMNetwo...
I can see that the problem is that the Ethernet switch in the VM configuration doesn't exist. I would then take steps to fix the problem and then import. This example also shows that it's much easier to work from the GUI, rather than by using PowerShell.
About the Author
You May Also Like