You can migrate Cinder volumes that are unattached to instances to specified target datastores.
Prerequisites
Detach all snapshots from the volumes that you want to migrate.
Procedure
- Log in to the OpenStack Management Server as
viouser
. - Migrate the volumes.
- To migrate all volumes from a datastore, run the following command:
sudo viocli volume-migrate --source-dc src-dc-name --source-ds src-ds-name dest-dc-name dest-ds-name [--ignore-storage-policy]
- To migrate specified volumes from a datastore, run the following command:
sudo viocli volume-migrate --volume-ids UUID1 dest-dc-name dest-ds-name [--ignore-storage-policy]
Option Description --source-dc Enter the data center containing the volumes that you want to migrate.
This parameter must be used together with the --source-ds parameter. If you want to migrate specified volumes only, do not include this parameter.
--source-ds Enter the datastore containing the volumes that you want to migrate.
This parameter must be used together with the --source-dc parameter. If you want to migrate specified volumes only, do not include this parameter.
--volume-ids Enter the UUID of the volume that you want to migrate. You can include multiple UUIDs separated by commas (,).
If you want to migrate all volumes from a datastore, use the --source-dc and --source-ds parameters instead of this parameter.
dest-dc-name Enter the name of the data center that contains the datastore to which you want to migrate volumes.
dest-ds-name Enter the name of the datastore to which you want to migrate volumes.
--ignore-storage-policy Include this parameter to migrate volumes to the target datastore even if the datastore does not comply with the storage policy of the volume.
- To migrate all volumes from a datastore, run the following command: