Live Migration technology in the Hyper-V virtualization system allows to move a running virtual machine between Hyper-V hosts without stopping it or without any impact on the availability of services. In earlier Hyper-V versions, using Live Migration you could move a virtual machine only between the nodes of the Failover Cluster. This restriction is removed in Hyper-V 3.0 (Windows Server 2012) and higher due to Shared Nothing Live Migration technology. In this article we’ll show how to enable Live Migration and move a running VM between stand-alone Hyper-V hosts running Windows Server 2016.
Shared Nothing Live Migration requirements:
- Migration is possible between the servers running the following OSs: Windows Server 2012 R2 or Windows Server 2016
- Virtual machine version has to be 5 or higher
- Both computers must be located in the same Active Directory domain or in trusted domains
- A user performing the configuration must have Hyper-V administrator privileges. While configuring Kerberos constrained delegation, a user must have the domain administrator privileges (or server account privileges)
Suppose, we have 2 servers running Windows Server 2016 with the Hyper-V role: Srv01 and Srv03. Both servers are members of the Active Directory domain and are not clustered (Windows Server Failover Clustering). Start Hyper-V Manager console on any of the servers and add both servers to it.
Then enable Live Migration in the settings of both servers. To do it, right-click a Hyper-V server and select Hyper-V Settings. Go to the Live Migration section and check Enable incoming and outgoing live migrations. Restrict the list of migrations to the IP addresses of two Hyper-V hosts.
You can do the same things using the following PowerShell commands:
Set-VMMigrationNetwork 192.168.10.41 192.168.10.21
To migrate a VM using Kerberos authentication, the administrator doesn’t need to sign in on the server, but the constrained delegation in Active Directory (KCD — Kerberos constrained delegation) has to be configured.
Start the ADUC snap-in, find the account of the first Hyper-V server, open its properties and go to the Delegation tab.
In the next window, click Users and Computers and specify the name of the second Hyper-V server. In the list of available services, select Microsoft Virtual System Migration Service.
Save the delegation settings. Configure the same settings for the second Hyper-V server.
It remains to wait for the replication of the changes in AD and re-issue of the Kerberos ticket, then you can perform live migration of the VM. Right-click the virtual machine and select Move.
Select Move the virtual machine as the type of migration.
Specify the name of the Hyper-V host to which you want to migrate VM.
Then select the folder on a target host to move the VM files to (the folder must exist already).
Click Finish and wait till the Live Migration process of the virtual machine to the second Hyper-V server is over.
Move-VM srvapp1 Srv01 -IncludeStorage -DestinationStoragePath c:\hyperv\vm
If the processor compatibility isn’t turned on in the VM settings, the migration will be interrupted with the following error:
To solve this problem, you will have to shut down the VM and enable CPU compatibility for it:
Set-VMProcessor srvapp1 -CompatibilityForMigrationEnabled $true