Từ phiên bản Windows 2012 đã được hỗ trợ Live Migrate mà không cần phải sử dụng shared storage. Bạn có thể thực hiện live migrate trên Windows 2016 chỉ cần thông qua cáp mạng ;).
Trong trường hợp của tôi, Live migrate giữa cluster với một host standalone và thuộc 2 domain khác nhau. Để live migrate bạn cần phải:
1. Trusted giữa 2 forest domain cả outgoing và incomming
2. Thêm user Administrator của 2 domain vào group administrators local trên tất cả các node cần migrate
3. Tiến hành thêm Delegate 2 service SMB và Migration cho các node. Ví dụ bên dưới tôi thêm node LAB160 delegate vào node HV160.
$HostName = "LAB160"
$HostFQDN = "$HostName.lab.ods"
Get-ADComputer HV160| Set-ADObject -Add @{"msDS-AllowedToDelegateTo"="Microsoft Virtual System Migration Service/$HostFQDN", "Microsoft Virtual System Migration Service/$HostName", "cifs/$HostFQDN", "cifs/$HostName"}
4. Tiến hành migrate với powershell. Đến bây giờ tôi vẫn chưa thể migration thông qua giao diện Hyper-V Manger. Bạn có thể sử dụng script bên dưới của tôi:
$vm = Get-VM -Name "Template-2k16"
$username = "LAB\administrator"
$computer = "LAB160.lab.ods"
$password = convertto-securestring -String "password" -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
Invoke-Command -ComputerName $computer -ScriptBlock {
param($vmName)
New-Item -Path "C:\ClusterStorage\HYPERV\$vmName" -ItemType Directory -Force
} -credential $cred -ArgumentList $($vm.Name)
$vm | Move-VM -DestinationHost $computer -IncludeStorage -DestinationStoragePath "C:\ClusterStorage\HYPERV\$($vm.Name)"