You can migrate Cinder volumes that are attached to an OpenStack instance by migrating the corresponding virtual machine to a different datastore.

Note:
  • Multi-attach volumes cannot be migrated while attached. Detach multi-attach volumes before migrating them to another datastore.
  • After the OpenStack instance to which the volume is attached is migrated, the corresponding shadow virtual machine has no disk. When you detach the volume, the disk will be re-attached to the shadow virtual machine.
  • To keep a volume not migrated together with its attached virtual machine, please see Volumes Not Migrated with Attached Virtual Machines.

Prerequisites

Detach all snapshots from the volumes that you want to migrate.

Procedure

  1. Log in to the Integrated OpenStack Manager as the root user.
    ssh root@mgmt-server-ip
  2. Open the toolbox.
    toolbox
  3. Migrate the instance to which the volume is attached.
    openstack server migrate compute-name instance-uuid --live
    • To find the name of a 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.

    For more information, see Migrate Instance.

  4. In the vSphere Client, migrate the shadow virtual machine that corresponds to the OpenStack volume.
  5. If you want to migrate the shadow virtual machine to a cluster in a different availability zone, update the Cinder host for the volume.
    1. Get a list of cinder-api pods on the LCM node.
      osctl get pods | grep cinder-api
    2. Using the name of one of the cinder-api pods listed, start a bash session on the pod.
      osctl exec -it <cinder-api-pod-name> bash
    3. In the new session, get a list of Cinder hosts.
      cinder-manage host list
      The list includes hosts and zones of Cinder volumes.
    4. Modify the attributes of the volume you want to move. Set the host and zone values to the Cinder volume host in the AZ where you want to move the shadow VM.
      cinder-manage volume update volume_host --volume_id <volume-uuid> --newhost <new-volume-host> --zone <availability-zone>
      Where:
      • volume-uuid is the Cinder volume UUID of the shadow VM you want to move
      • new-volumne-host is the Cinder hostname in the destination AZ.
      • availability-zone is the destination AZ.

Results

The Cinder volume and the disk of the corresponding shadow virtual machine are migrated to the new datastore.