Chapter 2. MTV cold migration and warm migration introduction Cold migration is when a powered off virtual machine (VM) is migrated to a separate host. The VM is powered off, and there is no need for common shared storage. Warm migration is when a powered on VM is migrated to a separate host. A source host state is cloned to the destination host. Warm migrations precopy stage Create an initial snapshot of running VM disks. Copy first snapshot to target: full-disk transfer, the largest amount of data copied. It takes more time to complete. Copy deltas: changed data, copying only data that has changed since the last snapshot was taken. It takes less time to complete. Create a new snapshot. Copy the delta between the snapshot and the new snapshot. Schedule the snapshot, configurable by default, one hour after the last snapshot finished. An arbitrary number of deltas can be copied. Warm migration cutover stage Scheduled time to finalize warm migration Shut down the source VM. Copy the final snapshot delta to the target. Continue in the same way as cold migration Guest conversion Starting target VM (optional) 2.1. Migration speed comparison The observed speeds for the warm migration single disk transfer and disk conversion are approximately the same as for the cold migration. The benefit of warm migration is that the transfer of the snapshot is happening in the background while the VM is powered on . The default snapshot time is taken every 60 minutes. If VMs change substantially, more data needs to be transferred than in cold migration when the VM is powered off . The cutover time, meanng the shutdown of the VM and last snapshot transfer, is dependent on how much the VM has changed since the last snapshot. 2.2. About cold and warm migration MTV supports cold migration from: VMware vSphere Red Hat Virtualization (RHV) OpenStack Remote OpenShift Virtualization clusters MTV supports warm migration from VMware vSphere and from RHV. 2.2.1. Cold migration Cold migration is the default migration type. The source virtual machines are shut down while the data is copied. Note VMware only: In cold migrations, in situations in which a package manager cannot be used during the migration, MTV does not install the qemu-guest-agent daemon on the migrated VMs. This has some impact on the functionality of the migrated VMs, but overall, they are still expected to function. To enable MTV to automatically install qemu-guest-agent on the migrated VMs, ensure that your package manager can install the daemon during the first boot of the VM after migration. If that is not possible, use your preferred automated or manual procedure to install qemu-guest-agent manually. 2.2.2. Warm migration Most of the data is copied during the precopy stage while the source virtual machines (VMs) are running. Then the VMs are shut down and the remaining data is copied during the cutover stage. Precopy stage The VMs are not shut down during the precopy stage. The VM disks are copied incrementally by using changed block tracking (CBT) snapshots. The snapshots are created at one-hour intervals by default. You can change the snapshot interval by updating the forklift-controller deployment. Important You must enable CBT for each source VM and each VM disk. A VM can support up to 28 CBT snapshots. If the source VM has too many CBT snapshots and the Migration Controller service is not able to create a new snapshot, warm migration might fail. The Migration Controller service deletes each snapshot when the snapshot is no longer required. The precopy stage runs until the cutover stage is started manually or is scheduled to start. Cutover stage The VMs are shut down during the cutover stage and the remaining data is migrated. Data stored in RAM is not migrated. You can start the cutover stage manually by using the MTV console or you can schedule a cutover time in the Migration manifest. 2.2.3. Advantages and disadvantages of cold and warm migrations The table that follows offers a more detailed description of the advantages and disadvantages of cold migration and warm migration. It assumes that you have installed Red Hat Enterprise Linux (RHEL) 9 on the Red Hat OpenShift platform on which you installed MTV: Table 2.1. Advantages and disadvantages of cold and warm migrations Cold migration Warm migration Duration Correlates to the amount of data on the disks. Each block is copied once. Correlates to the amount of data on the disks and VM utilization. Blocks may be copied multiple times. Fail fast Convert and then transfer. Each VM is converted to be compatible with OpenShift and, if the conversion is successful, the VM is transferred. If a VM cannot be converted, the migration fails immediately. Transfer and then convert. For each VM, MTV creates a snapshot and transfers it to Red Hat OpenShift. When you start the cutover, MTV creates the last snapshot, transfers it, and then converts the VM. Tools virt-v2v (Red Hat Enterprise Linux 9), used to convert virtual machines from a foreign hypervisor to run on Kernel-based Virtual Machines (KVMs). Containerized Data Importer (CDI), a persistent storage management add-on, and virt-v2v (Red Hat Enterprise Linux 9) Data transferred Approximate sum of all disks Approximate sum of all disks and VM utilization VM downtime High: The VMs are shut down, and the disks are transferred. Low: Disks are transferred in the background. The VMs are shut down during the cutover stage, and the remaining data is migrated. Data stored in RAM is not migrated. Parallelism Disks are transferred sequentially for each VM. For remote migration, disks are transferred in parallel. [a] Disks are transferred in parallel by different pods. Connection use Keeps the connection to the Source only during the disk transfer. Keeps the connection to the Source during the disk transfer, but the connection is released between snapshots. Tools MTV only. MTV and CDI from OpenShift Virtualization. [a] Remote migration: Target environment that does not have MTV installed. Migration to a remote environment using CDI. Note The preceding table describes the situation for VMs that are running because the main benefit of warm migration is the reduced downtime, and there is no reason to initiate warm migration for VMs that are down. However, performing warm migration for VMs that are down is not the same as cold migration, even when MTV uses virt-v2v and RHEL 9. For VMs that are down, MTV transfers the disks using CDI, unlike in cold migration. Note When importing from VMware, there are additional factors which impact the migration speed such as limits related to ESXi, vSphere. or VDDK. 2.2.3.1. Conclusions Based on the preceding information, we can draw the following conclusions about cold migration vs. warm migration: The shortest downtime of VMs can be achieved by using warm migration. The shortest duration for VMs with a large amount of data on a single disk can be achieved by using cold migration. The shortest duration for VMs with a large amount of data that is spread evenly across multiple disks can be achieved by using warm migration.

Commands: