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

Note: After an attached volume is migrated, the corresponding shadow virtual machine remains on the original datastore but has no disk. When you detach the volume, the disk will be re-attached to the shadow virtual machine.

Prerequisites

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

Procedure

  1. Log in to the OpenStack Management Server as viouser.
  2. Prepare the datastore containing the volume for migration.
    This step prepares all volumes on the specified datastore for migration.
    sudo viocli ds-migrate-prep dc-name ds-name
    Option Description

    dc-name

    Enter the data center that contains the desired volume.

    ds-name

    Enter the datastore that contains the desired volume.

  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 an Instance.

  4. In the vSphere Client, migrate the shadow virtual machine for the volume.
  5. If you want to migrate the shadow virtual machine to a cluster in a different availability zone, update the availability zone for the volume.
    sudo -u cinder cinder-manage volume update_volume_host --volume_id volume-uuid --newhost new-volume-host 

Results

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