Use the viocli volume-migrate command to migrate one or more non-attached Cinder volumes from one datastore to another.

Note:

To migrate attached volumes, you must migrate the entire instance.

To migrate volumes for shadow virtual machines, use the viocli ds-migrate-prep command and then complete the migration using the vSphere Web Client.

The viocli volume-migrate command uses the following syntax.

viocli volume-migrate [-d NAME] {--volume-ids UUID1[,UUID2...] | --source-dc SRC-DC-NAME --source-ds SRC-DS-NAME] DEST-DC-NAME DEST-DS-NAME [--ignore-storage-policy] [--verbose]
Parameter Mandatory or Optional Description

-d NAME or --deployment NAME

Optional

Name of the deployment to use.

If you do not enter a value, the default deployment is used.

--volume-ids UUID1

Mandatory unless --source-dc and --source-ds are used.

Migrates one or more volumes specified by UUID. To specify multiple volumes, separate the UUIDs with commas.

For example, the following command migrates two volumes to datastore DS-01 in data center DC-01.

viocli volume-migrate --volume-ids 25e121d9-1153-4d15-92f8-c92c10b4987f,4f1120e1-9ed4-421a-b65b-908ab1c6bc50 DC-01 DS-01

--source-dc SRC-DC-NAME

Mandatory unless --volume-ids is used.

Identifies the source data center.

This option must be used together with the --source-ds option.

--source-ds SRC-DS-NAME

Mandatory unless --volume-ids is used.

Identifies the source datastore.

This option must be used together with the --source-dc option.

For example, the following command migrates all the volumes from datastore DS-01 in data center DC-01 to datastore DS-02 in data center DC-02.

viocli volume-migrate --source-dc DC-01 --source-ds DS-01 DC-02 DS-02

DEST-DC-NAME

Mandatory

Specifies the destination data center.

DEST-DS-NAME

Mandatory

Specifies the destination datastore.

--ignore-storage-policy

Optional

Ignores storage policy compliance check.

This parameter enables volume migration when the destination datastore does not comply with the storage policy of the migrated volume.

--verbose

Optional

Displays output in verbose mode.

You can also run viocli volume-migrate -h or viocli volume-migrate --help to display the parameters for the command.