Preparing the Windows migration worker template
To migrate Windows virtual machines, prepare a Windows migration worker template. During migration, the system creates a temporary worker VM from this template. After migration is complete, the temporary worker VM is deleted.
Windows migrations require both Linux and Windows worker templates: disk cloning uses a Linux worker, and OS morphing uses a Windows worker. In Virtuozzo Infrastructure, Linux worker templates are already available, so you only need to prepare the Windows template.
The Windows worker template must be based on the same Windows version as the VMs you plan to migrate, or on a newer version. Also, the system language in the Windows template must be set to English.
To prepare the Windows migration worker template
- Prepare a compute image with a Windows ISO, as described in Uploading images.
- Create a Windows VM to use as the migration worker template, as described in Creating virtual machines. Use a boot volume of at least 15 GB and ensure that the VM is connected to a network with Internet access.
- Install Windows in the VM. If you are installing Windows Server, select an edition with the Desktop Experience option.
-
Download Cloudbase-Init from https://cloudbase.it/cloudbase-init/#download, and then install it by following the procedure from the Installation section at https://cloudbase.it/cloudbase-init/.
During the installation, specify the default user name Administrator. The migration service relies on this user, so the Administrator account must exist and must not be disabled in the template.
When closing the Cloudbase-Init setup wizard, do not run Sysprep.
-
Allow ICMPv4 echo requests in Windows Firewall. Start Windows PowerShell as administrator and run:
> New-NetFirewallRule -DisplayName "Allow ICMPv4 Echo Request" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -Action Allow -Profile Any
-
Configure WinRM over HTTPS, as described in Microsoft documentation. The VM must have a valid local computer certificate for Server Authentication. The certificate must match the VM hostname and must not be expired, revoked, or self-signed.
Start Windows PowerShell as administrator and run:
> winrm quickconfig -transport:https > New-NetFirewallRule -DisplayName "Allow WinRM HTTPS" -Direction Inbound -Protocol TCP -LocalPort 5986 -Action Allow -Profile Any > winrm enumerate winrm/config/listener
-
Obtain the VM ID and hosting node. On a cluster node, run:
# vinfra service compute server list
-
Download and save the guest tools ISO and Cloudbase-Init ZIP inside the VM. Log in to the node that hosts the VM and run:
# virsh x-exec <VM_ID> -- powershell -NoProfile -Command "\$WebClient = New-Object System.Net.WebClient; \$WebClient.DownloadFile('https://repo.virtuozzo.com/vz-platform/guest-tools/vz-guest-tools-win.iso', 'C:\vz-guest-tools-win.iso'); Write-Host 'Downloaded vz-guest-tools-win.iso'" # virsh x-exec <VM_ID> -- powershell -NoProfile -Command "\$WebClient = New-Object System.Net.WebClient; \$WebClient.DownloadFile('https://www.cloudbase.it/downloads/CloudbaseInitSetup_x64.zip', 'C:\cloudbaseinit.zip'); Write-Host 'Downloaded cloudbaseinit.zip'"The files are only downloaded and saved to disk. Do not unpack or install them.
- Mount C:\vz-guest-tools-win.iso inside the VM and copy all files from the ISO to C:\vztools.
-
Install Windows ADK Deployment Tools to provide the legacy DISM tool required by the migration worker:
> Invoke-WebRequest -Uri "https://download.microsoft.com/download/d5be3ad2-c9b2-4034-b02d-5e6a3a0b9780/adk/adksetup.exe" -OutFile "C:\adksetup.exe" > C:\adksetup.exe /quiet /features OptionId.DeploymentTools
-
Shut down the VM. Then obtain the VM boot volume ID from the volumes field and upload this volume to an image with the predefined name vporter-minion-windows:
# vinfra service compute server show <VM_ID> # vinfra service compute volume upload-to-image --name vporter-minion-windows <volume_id>
-
Set the password for the temporary Windows worker:
# vinfra service compute maas set --minion-windows-password <password>
The migration service uses this image name to create the temporary Windows migration worker during migration.