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
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
-
Replace
Confirm that the instance is migrating:
$ openstack server show <vm> +----------------------+--------------------------------------+ | Field | Value | +----------------------+--------------------------------------+ | ... | ... | | status | MIGRATING | | ... | ... | +----------------------+--------------------------------------+
- Wait for migration to complete. See Checking migration status to check the status of the migration.
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.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.
-
Replace
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.
-
Replace
When you finish migrating the instances, proceed to Completing the migration.