You can live-migrate an OpenStack instance to a different compute node.

VMware Integrated OpenStack does not support the following VM migration scenarios:
  • Migration of a VM between two different vCenter Servers.
  • Migration of a VM within a cluster. To migrate a VM within a cluster, you must use vSphere.

To migrate VMs between clusters, you can use VMware Integrated OpenStack, if the source and the target clusters are in the same vCenter instance.

Note: Instances managed by VMware Integrated OpenStack must be migrated by using OpenStack commands. Do not use vCenter Server, or other methods to migrate OpenStack instances.

Prerequisites

  • Verify that the source and target compute nodes are present within the same vCenter Server instance.
  • Verify that your environment includes a shared datastore that all hosts and clusters can access.
  • Verify that the source and target compute nodes have at least one distributed switch in common. If two distributed switches are attached to the source compute node but only one distributed switch is attached to the target compute node, live migration can succeed but the OpenStack instance must be connected only to the port group of the distributed switch common to both compute nodes.
  • Verify that any FCD volumes are detached.

Procedure

  1. Log in to the Integrated OpenStack Manager as the root user.
    ssh root@mgmt-server-ip
  2. If the instance has a CD-ROM drive attached, configure a shared datastore for CD-ROM migration.
    1. Edit the Nova compute configuration.
      viocli update nova-compute
    2. In the vmware section, add the shared_datastore_regex parameter and set its value to the name of the shared datastore in vSphere.
  3. Open the toolbox.
    toolbox
  4. For the migration, if you are not selecting compute node as the target, you can run the following command:
    openstack server migrate --live-migration instance-uuid --os-compute-api-version 2.30
    For migrating an instance to the specified host, run the following command:
    nova --os-compute-api-version 2.67 live-migration --force [--block-migrate] <server> [<host>]
    For example:
    nova --os-compute-api-version 2.67 live-migration --force 7a9fd8a8-b3f2-4c72-af0e-ef0b856d7715 compute-35a9679c-c97

    You must specify --os-compute-api-version 2.67, [host], and --force options in the command.

    • To find the name of compute node, run the openstack host list command and view the Host Name column.
    • To find the UUID of the instance, run the openstack server list command and view the ID column.
    Live migrate vmotion between same vDCs from different compute
    To live migrate vmotion between same vDCs from different compute, perform the following steps:
    • Create tenant-vdc1 in compute-1.
      viocli create tenant-vdc --name tvdc-01 --project-id ecbf813ee5d54420864247a2edcd76dc --compute compute-c05c9c49-c55
    • Create a flavor and update the flavor property.
      openstack flavor set --property vmware:tenant_vdc='746146ea-a8f2-4be2-8bef-1dabe1249de7' 70841a4c-1332-4474-abd2-3fa07de3ab8e
    • Create instance with the created flavor which you must put under tvdc1 as follows:
      openstack server create --flavor 70841a4c-1332-4474-abd2-3fa07de3ab8e --network 39f32be5-7079-4110-8f38-8c3948d3079d --image "Photon 3.0" tvdc-001
    • Extend tvdc1 to compute 2.
      viocli update tenant-vdc --compute compute-c05c9c49-c3101 --id 746146ea-a8f2-4be2-8bef-1dabe1249de7
    • For live migration, run the following commands:
      export OS_COMPUTE_API_VERSION=2.67
      nova --os-compute-api-version 2.67 live-migration  --force d155cbf9-3c1d-4732-9d08-9e28cb141ca0 compute-c05c9c49-c3101

What to do next

You can run the openstack server show instance-uuid command to confirm that the instance has been migrated to the desired compute node.