Virtual machine live migration

About live migration

Live migration is the process of moving a running virtual machine instance (VMI) to another node in the cluster without interrupting the virtual workload or access. If a VMI uses the LiveMigrate eviction strategy, it automatically migrates when the node that the VMI runs on is placed into maintenance mode. You can also manually start live migration by selecting a VMI to migrate.

You can use live migration if the following conditions are met:

  • Virtual machines must have a persistent volume claim (PVC) with a shared ReadWriteMany (RWX) access mode to be live migrated.

  • The pod network binding must not be of the bridge interface type ().

  • Ports 49152 and 49153 must be available in the virt-launcher pod. If these ports are specified in the masquerade interface, live migration does not function.

  • Live migration is supported for virtual machines that are attached to an SR-IOV network interface only if the sriovLiveMigration feature gate is enabled in the HyperConverged custom resource (CR). When the spec.featureGates.sriovLiveMigration field is set to true, the virt-launcher pod runs with the SYS_RESOURCE capability. This might degrade its security.

Updating access mode for live migration

For live migration to function properly, you must use the ReadWriteMany (RWX) access mode. Use this procedure to update the access mode, if needed.

Procedure

  • To set the RWX access mode, run the following oc patch command:

    1. $ oc patch -n openshift-cnv \
    2. cm kubevirt-storage-class-defaults \
    3. -p '{"data":{"'$<STORAGE_CLASS>'.accessMode":"ReadWriteMany"}}'

Additional resources: