This is a cache of https://docs.openshift.com/container-platform/4.2/cnv/cnv_users_guide/cnv-migrate-vmi.html. It is a snapshot of the page at 2024-11-23T02:39:19.753+0000.
Migrating a virtual machine instance to another node - Container-native virtualization <strong>user</strong>'s guide | Container-native virtualization | OpenShift Container Platform 4.2
×

Manually initiate a live migration of a virtual machine instance to another node using either the web console or the CLI.

Initiating live migration of a virtual machine instance in the web console

Migrate a running virtual machine instance to a different node in the cluster.

The Migrate Virtual Machine action is visible to all users but only admin users can initiate a virtual machine migration.

Procedure
  1. In the container-native virtualization console, click WorkloadsVirtual Machines.

  2. You can initiate the migration from this screen, which makes it easier to perform actions on multiple virtual machines in the one screen, or from the Virtual Machine Details screen where you can view comprehensive details of the selected virtual machine:

    • Click the Options menu kebab at the end of virtual machine and select Migrate Virtual Machine.

    • Click the virtual machine name to open the Virtual Machine Details screen and click ActionsMigrate Virtual Machine.

  3. Click Migrate to migrate the virtual machine to another node.

Initiating live migration of a virtual machine instance in the CLI

Initiate a live migration of a running virtual machine instance by creating a VirtualMachineInstanceMigration object in the cluster and referencing the name of the virtual machine instance.

Procedure
  1. Create a VirtualMachineInstanceMigration configuration file for the virtual machine instance to migrate. For example, vmi-migrate.yaml:

    apiVersion: kubevirt.io/v1alpha3
    kind: VirtualMachineInstanceMigration
    metadata:
      name: migration-job
    spec:
      vmiName: vmi-fedora
  2. Create the object in the cluster:

    $ oc create -f vmi-migrate.yaml

The VirtualMachineInstanceMigration object triggers a live migration of the virtual machine instance. This object exists in the cluster for as long as the virtual machine instance is running, unless manually deleted.