How to Configure Live Migration in Hyper-V on Windows Server 2012 R2
Live Migration allows you to move a running virtual machine from one Hyper-V host to another with zero downtime — the VM continues to run and serve clients throughout the entire migration process. This capability is essential for hardware maintenance (patching, firmware updates, hardware replacement) and workload balancing without requiring a service window. Windows Server 2012 R2 Hyper-V supports both shared storage Live Migration (requires a shared storage infrastructure) and Shared Nothing Live Migration (migrates both the VM configuration and storage simultaneously, requiring no shared storage).
This guide covers configuring Live Migration, setting authentication, performing migrations, and troubleshooting common issues.
Prerequisites
- Two Hyper-V hosts running Windows Server 2012 R2.
- Both hosts joined to the same Active Directory domain.
- Both hosts must be in the same or trusted AD site for Kerberos authentication to work.
- A dedicated, low-latency network for Live Migration traffic (ideally a separate NIC/VLAN).
- Sufficient RAM on the destination host to accommodate the migrating VM.
- For traditional Live Migration: shared storage (SAN/NAS) accessible by both hosts OR Failover Cluster.
- For Shared Nothing Live Migration: sufficient disk space on the destination host.
Step 1: Enable Live Migration on Both Hosts
# Enable Live Migration on HYPERV01
Enable-VMMigration -ComputerName HYPERV01
# Enable on HYPERV02
Enable-VMMigration -ComputerName HYPERV02
# Configure authentication type (Kerberos — no credential delegation needed)
Set-VMHost -ComputerName HYPERV01 `
-VirtualMachineMigrationAuthenticationType Kerberos
Set-VMHost -ComputerName HYPERV02 `
-VirtualMachineMigrationAuthenticationType Kerberos
# Set the maximum number of simultaneous live migrations
Set-VMHost -ComputerName HYPERV01 -MaximumVirtualMachineMigrations 2
Set-VMHost -ComputerName HYPERV02 -MaximumVirtualMachineMigrations 2
# Verify settings
Get-VMHost -ComputerName HYPERV01, HYPERV02 |
Select-Object Name, VirtualMachineMigrationEnabled, `
VirtualMachineMigrationAuthenticationType, `
MaximumVirtualMachineMigrations
Step 2: Configure a Dedicated Live Migration Network
Using a dedicated network for Live Migration isolates migration traffic from VM and management traffic, preventing network saturation during migrations from impacting running workloads.
# On HYPERV01: Identify the migration NIC
Get-NetAdapter -ComputerName HYPERV01 | Select-Object Name, InterfaceDescription, Status
# Configure which networks can be used for Live Migration
# Use only the dedicated migration NIC/subnet
Set-VMMigrationNetwork `
-ComputerName HYPERV01 `
-Subnet "10.100.0.0/24" `
-Priority 1
Set-VMMigrationNetwork `
-ComputerName HYPERV02 `
-Subnet "10.100.0.0/24" `
-Priority 1
# Optional: Allow Live Migration over the management network as a fallback (lower priority)
Add-VMMigrationNetwork `
-ComputerName HYPERV01 `
-Subnet "192.168.1.0/24" `
-Priority 5
# Verify migration network configuration
Get-VMMigrationNetwork -ComputerName HYPERV01
Get-VMMigrationNetwork -ComputerName HYPERV02
Step 3: Configure Constrained Delegation for Kerberos (if required)
If you use CredSSP authentication instead of Kerberos, or if Kerberos is not working due to firewall or DNS issues, you may need to configure Constrained Delegation in Active Directory.
# Configure constrained delegation for HYPERV01 computer account
# This allows HYPERV01 to delegate credentials to HYPERV02 for Hyper-V services
# On a domain controller:
Set-ADComputer HYPERV01 -Add @{
"msDS-AllowedToDelegateTo" = @(
"Microsoft Virtual System Migration Service/HYPERV02",
"Microsoft Virtual System Migration Service/HYPERV02.corp.example.com",
"cifs/HYPERV02",
"cifs/HYPERV02.corp.example.com"
)
}
# Also configure HYPERV02 to delegate to HYPERV01
Set-ADComputer HYPERV02 -Add @{
"msDS-AllowedToDelegateTo" = @(
"Microsoft Virtual System Migration Service/HYPERV01",
"Microsoft Virtual System Migration Service/HYPERV01.corp.example.com",
"cifs/HYPERV01",
"cifs/HYPERV01.corp.example.com"
)
}
# Enable "Use Kerberos only" delegation (not "Use any authentication protocol")
Set-ADComputer HYPERV01 -TrustedForDelegation $false
Set-ADComputer HYPERV02 -TrustedForDelegation $false
Step 4: Perform a Live Migration
# Live Migration of a VM (shared storage scenario — only moves VM state and configuration)
# The VM storage remains on the shared storage accessible by both hosts
Move-VM `
-ComputerName HYPERV01 `
-Name "WebServer01" `
-DestinationHost "HYPERV02" `
-IncludeStorage:$false
# Shared Nothing Live Migration (moves VM and its storage to the destination host)
Move-VM `
-ComputerName HYPERV01 `
-Name "WebServer01" `
-DestinationHost "HYPERV02" `
-IncludeStorage:$true `
-DestinationStoragePath "D:Hyper-VVMs"
# Migrate storage to a different path but keep VM on same host
Move-VMStorage `
-ComputerName HYPERV01 `
-Name "WebServer01" `
-DestinationStoragePath "E:Hyper-VVMs"
# Verify the VM is running on the destination host
Get-VM -ComputerName HYPERV02 -Name "WebServer01" |
Select-Object Name, State, ComputerName
Step 5: Monitor Migration Progress
# Check migration status while it is in progress
Get-VMReplication | Select-Object VMName, State, Health, LastReplicationTime
# For Live Migration specifically, watch the VM status
$vm = Get-VM -ComputerName HYPERV01 -Name "WebServer01"
while ($vm.Status -ne "Operating normally") {
Write-Host "VM Status: $($vm.Status) | Migration Progress: check Hyper-V Manager"
Start-Sleep -Seconds 2
$vm = Get-VM -ComputerName HYPERV01 -Name "WebServer01"
}
Write-Host "Migration complete."
# View migration events in the Hyper-V VMMS event log
Get-WinEvent -ComputerName HYPERV01 `
-LogName "Microsoft-Windows-Hyper-V-VMMS-Admin" `
-MaxEvents 20 | Where-Object { $_.Message -like "*migration*" } |
Select-Object TimeCreated, LevelDisplayName, Message
Step 6: Bulk Migration of All VMs from a Host
When preparing a host for maintenance, you may need to migrate all VMs off it at once.
# Get all running VMs on HYPERV01
$vms = Get-VM -ComputerName HYPERV01 | Where-Object { $_.State -eq "Running" }
# Migrate all VMs to HYPERV02
foreach ($vm in $vms) {
Write-Host "Migrating: $($vm.Name)"
Move-VM `
-ComputerName HYPERV01 `
-Name $vm.Name `
-DestinationHost "HYPERV02" `
-IncludeStorage:$false
Write-Host "Migrated: $($vm.Name)"
}
# Verify all VMs are now on HYPERV02
Get-VM -ComputerName HYPERV02 | Select-Object Name, State, ComputerName
Step 7: Troubleshoot Common Live Migration Issues
# Error: "Virtual machine migration operation failed at destination"
# Check: Does the destination host have the required virtual switch?
Get-VMSwitch -ComputerName HYPERV02 | Select-Object Name
# Error: "Insufficient system resources exist"
# Check available memory on destination
Get-VM -ComputerName HYPERV02 | Measure-Object -Property MemoryAssigned -Sum
(Get-VMHost -ComputerName HYPERV02).TotalMemoryUsage
# Error: "Live migration failed because the VM configuration version is incompatible"
# Upgrade the VM configuration version on HYPERV01 first (irreversible)
Update-VMVersion -Name "WebServer01" -ComputerName HYPERV01
# Check firewall rules for Live Migration on both hosts
Get-NetFirewallRule -DisplayGroup "Hyper-V" |
Select-Object DisplayName, Enabled, Direction | Sort-Object DisplayName
# Enable all Hyper-V firewall rules if missing
Enable-NetFirewallRule -DisplayGroup "Hyper-V"
# Test network connectivity between hosts on the migration subnet
Test-NetConnection -ComputerName HYPERV02 -Port 6600 # Live Migration port
Summary
Live Migration on Windows Server 2012 R2 Hyper-V is a cornerstone feature for maintaining high availability and performing hardware maintenance without downtime. The key configuration steps are: enable Live Migration on all hosts with Kerberos authentication, configure a dedicated migration network with highest priority to keep migration traffic isolated, use Shared Nothing Live Migration when you need to move both the VM and its storage to a new host without shared infrastructure, and test migrations regularly to verify they complete cleanly. When planning large-scale migrations (e.g., evacuating a host for maintenance), batch migrations sequentially or limit simultaneous migrations to avoid saturating the migration network and causing unnecessary VM performance degradation.