How to Set Up Hyper-V Live Migration on Windows Server 2012 R2
Hyper-V Live Migration allows a running virtual machine to be moved from one Hyper-V host to another with no perceptible downtime — typically under a second of network interruption. This capability is essential for performing host maintenance, balancing VM workloads across servers, and evacuating hosts before planned downtime. Windows Server 2012 R2 supports three types of migration: Live Migration (VM stays running), Quick Migration (VM is briefly saved), and Storage Migration (move VM disks to different storage without downtime). This guide covers configuration and execution of Live Migration in both clustered and non-clustered (Shared Nothing) scenarios.
Live Migration Architecture
During Live Migration, Hyper-V follows these steps:
- Copies the VM’s memory pages from the source to the destination host (while the VM continues running)
- Iteratively re-copies memory pages that were modified during the initial copy (dirty page tracking)
- When the remaining dirty pages are small enough, briefly pauses the VM (milliseconds)
- Transfers the final dirty pages and CPU state
- Resumes the VM on the destination host and redirects network traffic
Prerequisites
- Windows Server 2012 R2 with Hyper-V on source and destination hosts
- Both hosts joined to the same Active Directory domain (for Kerberos authentication) or configured for CredSSP
- Compatible CPUs between source and destination (same manufacturer and generation, or use processor compatibility mode)
- A dedicated high-bandwidth network for migration traffic (1GbE minimum, 10GbE recommended)
- For non-clustered Live Migration: shared storage (SMB 3.0 or SAN) or use Shared Nothing Live Migration
Step 1 — Enable Live Migration on Both Hosts
Enable Live Migration on the source and destination Hyper-V hosts via PowerShell:
Enable-VMMigration
Set-VMHost -VirtualMachineMigrationEnabled $true
Configure the authentication protocol. Kerberos is preferred for domain-joined hosts:
Set-VMHost -VirtualMachineMigrationAuthenticationType Kerberos
For CredSSP (useful when Kerberos delegation is not configured):
Set-VMHost -VirtualMachineMigrationAuthenticationType CredSSP
To use CredSSP for migrations, the administrator must log on directly to the source host (not via a remote PS session) or configure PowerShell CredSSP delegation.
Step 2 — Configure Kerberos Constrained Delegation
For Kerberos-based Live Migration, configure constrained delegation in Active Directory so the Hyper-V hosts can authenticate on behalf of each other:
# Run on a domain controller or machine with AD PowerShell module:
Import-Module ActiveDirectory
# Configure delegation for HV-Host01 to HV-Host02:
$SourceHost = Get-ADComputer -Identity "HV-Host01"
$DestHost = Get-ADComputer -Identity "HV-Host02"
# Add Kerberos delegation for the CIFS and Microsoft Virtual System Migration services:
Set-ADComputer -Identity $SourceHost -Add @{
'msDS-AllowedToDelegateTo' = "Microsoft Virtual System Migration Service/$($DestHost.DNSHostName)",
"cifs/$($DestHost.DNSHostName)"
}
# Repeat in reverse (HV-Host02 must delegate to HV-Host01):
Set-ADComputer -Identity $DestHost -Add @{
'msDS-AllowedToDelegateTo' = "Microsoft Virtual System Migration Service/$($SourceHost.DNSHostName)",
"cifs/$($SourceHost.DNSHostName)"
}
Step 3 — Configure the Migration Network
Designate a specific network for Live Migration traffic to prevent migration from saturating the VM production network:
# View current migration networks:
Get-VMMigrationNetwork
# Add the dedicated migration network (e.g., 192.168.10.0/24):
Add-VMMigrationNetwork -Subnet "192.168.10.0/24" -Priority 1
# Remove a network from migration use (e.g., the management/production network):
Remove-VMMigrationNetwork -Subnet "192.168.1.0/24"
Assign a static IP on the migration NIC on each host in the 192.168.10.0/24 range, but do not add a default gateway to this interface (it should not be a routed path).
Step 4 — Configure Maximum Simultaneous Migrations
Set-VMHost -MaximumVirtualMachineMigrations 4 -MaximumStorageMigrations 2
Windows Server 2012 R2 supports up to 4 simultaneous live migrations per host (or more on high-core-count systems). Adjust based on your network and host capacity.
Step 5 — Configure Processor Compatibility Mode
When migrating between hosts with CPUs from different generations (for example, an older Sandy Bridge host to a newer Ivy Bridge host), enable processor compatibility mode on the VM. This masks newer CPU features so the VM can run on the older-generation processor:
Set-VMProcessor -VMName "AppServer01" -CompatibilityForMigrationEnabled $true
Note: Enabling compatibility mode slightly reduces performance by hiding newer CPU instruction sets from the guest OS. Only use it when migrating between CPU generations.
Step 6 — Perform a Live Migration
Move a running VM from one host to another. The VM’s storage must be on shared storage accessible by both hosts (SAN, iSCSI, or SMB 3.0 SOFS):
Move-VM -Name "AppServer01" -DestinationHost "HV-Host02"
To watch the migration progress:
$Job = Move-VM -Name "AppServer01" -DestinationHost "HV-Host02" -AsJob
while ($Job.State -eq "Running") {
Write-Host "Migration progress: $($Job.ChildJobs[0].Progress.PercentComplete)%"
Start-Sleep -Seconds 2
}
Write-Host "Migration completed with status: $($Job.State)"
Step 7 — Shared Nothing Live Migration
Shared Nothing Live Migration moves both the VM’s memory state AND its storage simultaneously, eliminating the need for shared storage between hosts. This allows Live Migration between any two Hyper-V hosts:
Move-VM -Name "AppServer01" -DestinationHost "HV-Host02" -DestinationStoragePath "D:VMsAppServer01"
Shared Nothing Live Migration takes longer than standard Live Migration because it copies the VHD files over the network. Use a 10GbE link for optimal performance. The VM continues running throughout the process.
Step 8 — Storage Live Migration
Move a VM’s storage to a different location while the VM remains running (no host migration):
# Move all VM storage to a new path:
Move-VMStorage -VMName "AppServer01" -DestinationStoragePath "E:FastStorageAppServer01"
# Move only a specific VHD:
Move-VMStorage -VMName "AppServer01" -Destinations @{
"D:VMsAppServer01AppServer01.vhdx" = "E:FastStorageAppServer01AppServer01.vhdx"
}
Verifying Live Migration
# Verify the VM is now running on the destination host:
Get-VM -ComputerName "HV-Host02" -Name "AppServer01" | Select-Object Name, State, ComputerName
# Check migration event logs:
Get-WinEvent -ComputerName "HV-Host01" -LogName "Microsoft-Windows-Hyper-V-VMMS-Admin" | Where-Object { $_.Message -like "*migration*" } | Select-Object -First 10 TimeCreated, Message
Summary
Hyper-V Live Migration on Windows Server 2012 R2 is a cornerstone of any production virtualisation environment. Whether using cluster-based Live Migration with shared storage, Shared Nothing Live Migration for direct host-to-host moves, or Storage Live Migration for moving VM disks independently, the capability ensures that planned maintenance never requires VM downtime. Proper preparation — including Kerberos delegation, dedicated migration networks, and processor compatibility settings — ensures smooth, reliable migrations in your environment.