Migrating Volumes

A volume is disk-based data storage that can be attached and detached to an instance as needed. You can only attach a volume to one instance at a time, but you can migrate volumes to other instances when required. You can transparently migrate a volume with its data from one location to another without disrupting users and workloads. A volume must be detached with no snapshots before you can perform migration.

You can use data migration to perform the following:

  • Bring down a physical storage device for maintenance without disrupting workloads.
  • Modify the properties of a volume.
  • Free up space in a thinly-provisioned back end.

To migrate a volume:

  1. Obtain the Volume ID.

    $ openstack volume list
    | ID           | Display Name    | Status    | Size | Attached to |
    |--------------|-----------------|-----------|------|-------------|
    | <volume_id>  | Volume A        | available | 8    |             |
    | <volume_id>  | Volume B        | available | 8    |             |
    
  2. Obtain the destination host name.

    $ openstack host list
    +------------------------+-------------+----------+
    | Host Name              | Service     | Zone     |
    +------------------------+-------------+----------+
    | mcp2.az.metacloud.net  | conductor   | internal |
    | mcp3.az.metacloud.net  | conductor   | internal |
    | mcp3.az.metacloud.net  | scheduler   | internal |
    | mcp3.az.metacloud.net  | consoleauth | internal |
    | mcp3.az.metacloud.net  | console     | internal |
    | mcp2.az.metacloud.net  | consoleauth | internal |
    | mcp2.az.metacloud.net  | console     | internal |
    | mcp2.az.metacloud.net  | scheduler   | internal |
    | mcp1.az.metacloud.net  | consoleauth | internal |
    | mcp1.az.metacloud.net  | conductor   | internal |
    | mcp1.az.metacloud.net  | scheduler   | internal |
    | mcp1.az.metacloud.net  | console     | internal |
    | mhv8.az.metacloud.net  | compute     | strat1   |
    | mhv9.az.metacloud.net  | compute     | strat1   |
    | mhv6.az.metacloud.net  | compute     | strat1   |
    | mhv10.az.metacloud.net | compute     | strat1   |
    | mhv7.az.metacloud.net  | compute     | strat1   |
    +------------------------+-------------+----------+
    
  3. Migrate the volume to the new host.

    $ openstack volume migrate <VOLUME_ID> <DESTINATION_HOST_NAME> --force-host-copy <True|False>
    

    Use --force-host-copy True to force the generic host-based migration mechanism and bypass any driver optimizations.

Note
If the volume has snapshots, the specified host destination cannot accept the volume. If the user is not an administrator, the migration fails.