Migrate a virtual machine using System Center Virtual Machine Manager 2012

Once you have gone through the lengthy and specific requirements to install and get VMM running (See http://technet.microsoft.com/en-us/library/gg610592.aspx for all the requirements), added your physical servers to a host group for management, and configured networking ‘fabric’, you can use VMM to perform live migration between your servers running the same version of Hyper-V.

Note that starting in Hyper-V 3.0 VMM is no longer needed to perform live migration; they can be initiated directly in Hyper-V manager.

This guide assumes a pre-configured VMM, server, and network infrastructure (see the technet article for more information).

From VMs and Services sub-menu in VMM console:

1. Right click the virtual machine you wish to perform live migration on and click Migrate Virtual Machine from the context menu

clip_image002

2. Select the server you wish to migrate to (the list will be auto-populated based on the hosts VMM manages) with at least a 1-star rating

clip_image004

3. Select storage location if different than pre-configured path (the path that was set up when adding host to VMM)

clip_image006

4. Verify network connection (generally the defaults will be correct)

clip_image008

5. Accept summary by clicking Move

clip_image010

From this point, you do not have to do anything else. However, it is generally good practice to check the job status before closing the VMM console. The migration job will be visible under the Jobs sub-menu and will take some time as it needs to copy all VM data across the network. There are numerous ways that this job can fail which are all out of the scope of this guide. You will have to mitigate any failures by delving in to the cryptic error codes that VMM will inevitably throw. If everything is configured correctly though, the job should complete successfully after some time. The VM will be visible under the target host after the job has finished.

clip_image012

 

Using Powershell

If you are a Powershell guy, use this template generated by VMM:

$virtualNetworkAdapter = Get-SCVirtualNetworkAdapter -ID “5d1dbbaa-31d1-48be-8b05-7286986f5a1b”

$vmNetwork = Get-SCVMNetwork -Name “Internal Switch” -ID “334091d7-f553-4200-8ed1-760895a54042”

Set-SCVirtualNetworkAdapter -VirtualNetworkAdapter $virtualNetworkAdapter -VLanEnabled $false -VirtualNetwork “Internal Switch” -VMNetwork $vmNetwork -EnableVMNetworkOptimization $false -EnableMACAddressSpoofing $false -MACAddressType “Dynamic” -IPv4AddressType “Dynamic” -IPv6AddressType “Dynamic” -RunAsynchronously -JobGroup “80f1a276-362c-42ab-aeed-84cf79544318”

$vm = Get-SCVirtualMachine -ID “f05ab99e-d9b1-457d-ab5f-0c4eab795867” -Name “WIN2012SRV01”

$vmHost = Get-SCVMHost | where { $_.Name -eq “HYPERV2012.DALARIS.LOCAL” }

Move-SCVirtualMachine -VM $vm -VMHost $vmHost -HighlyAvailable $false -UseLAN -RunAsynchronously -JobGroup “80f1a276-362c-42ab-aeed-84cf79544318” -Path “D:\VM”

If you'd like to share this, click below:

Leave a Reply