Red Hat Training

A Red Hat training course is available for Red Hat OpenStack Platform

5.6. Live migrating an instance

Live migration moves an instance from a source Compute node to a destination Compute node with a minimal amount of downtime. Live migration might not be appropriate for all instances. For more information, see 「Migration constraints」.

注記

Live migrations preserve the instance machine type on the destination Compute node. Therefore, if you live migrate an instance with a RHEL-7.5 machine type running on a RHEL-7.5 Compute node, to a RHEL-7.6 Compute node, the migrated instance on the destination Compute node retains the RHEL-7.5 machine type. To change the machine type, you must set the image metadata property hw_machine_type, or set the NovaHWMachineType parameter on each Compute node.

Procedure

  1. To live migrate an instance, specify the instance and the destination Compute node:

    (overcloud)$ openstack server migrate <vm> --live <dest> --wait
    • Replace <vm> with the name or ID of the instance.
    • Replace <dest> with the name or ID of the destination Compute node.

      注記

      The openstack server migrate command covers migrating instances with shared storage, which is the default. Specify the --block-migration flag to migrate a locally stored volume:

      (overcloud)$ openstack server migrate <vm> --live <dest> --wait --block-migration
  2. Confirm that the instance is migrating:

    $ openstack server show <vm>
    
    +----------------------+--------------------------------------+
    | Field                | Value                                |
    +----------------------+--------------------------------------+
    | ...                  | ...                                  |
    | status               | MIGRATING                            |
    | ...                  | ...                                  |
    +----------------------+--------------------------------------+
  3. Wait for migration to complete. See Checking migration status to check the status of the migration.
  4. Check the status of the instance to confirm if the migration was successful:

    (overcloud)$ openstack server list --host <dest> --all-projects

    Replace <dest> with the name or ID of the destination Compute node.

  5. Optional: For instances that use NUMA, CPU-pinning, or DPDK, retrieve information about the NUMA topology from a Compute node to compare it with the NUMA topology that you retrieved during the preparing to migrate procedure. Comparing the NUMA topologies of the source and destination Compute nodes ensures that the source and destination Compute nodes use the same NUMA topology.

    • To view details about NUMA and CPU pinning, run the following command:

      $ ssh root@overcloud-compute-n
      # virsh vcpuinfo <vm>
      • Replace overcloud-compute-n with the host name of the Compute node.
      • Replace <vm> with the name of the instance.
    • To view details about which NUMA node the instance is using, run the following command:

      $ ssh root@overcloud-compute-n
      # virsh numatune <vm>
      • Replace overcloud-compute-n with the host name of the Compute node.
      • Replace <vm> with the name or ID of the instance.

When you finish migrating the instances, proceed to Completing the migration.