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

  • Volume migration will fail if the volume is attached.

    In this case, migrate the corresponding instance. Attached volumes will migrate with the instance.

    Note:

    Corresponding volume shadow VMs will not be migrated. To migrate such volume shadow VMs, run the viocli ds-migrate-prep Command, then migrate the shadow VMs using the vSphere Web Client.

  • Volume migration will fail if the volume has a storage policy that cannot be satisfied by the destination datastore.

    You can force the migration by including the --ignore-storage-policy parameter. The command will output a warning if the storage policy is ignored for the migration to a non-compliant datastore.

The viocli volume-migrate command uses the following syntax.

viocli volume-migrate [-d [NAME]] \
                      [--source-dc [SRC_DC_NAME]] [--source-ds [SRC_DS_NAME]] \
                      [--volume-ids [VOLUME_UUIDS]] [--ignore-storage-policy] \
                      DEST_DC_NAME DEST_DS_NAME [-h] [-v]

Parameter

Mandatory or Optional

Description

-d, --deployment NAME

Automatic

Name of the deployment in which the volumes will be migrated.

Applied automatically. The default value is the name of the current deployment.

--source-dc SRC_DC_NAME

Mandatory unless VOLUME_UUIDS is specified.

Identifies the source datacenter.

Used with the --source-ds parameter to uniquely identify the datastore.

--source-ds SRC_DS_NAME

Mandatory unless VOLUME_UUIDS is specified.

Used with the --source-dc parameter to uniquely identify the datastore.

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

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

--volume-ids VOLUME_UUIDS

Mandatory unless SRC_DC_NAME and SRC_DS_NAME are specified.

Migrates one or more individual volumes specified by UUID value. To specify more than one volume, separate the UUIDs by commas.

For example, the following command migrates two volumes specified by their UUID values to datastore DS-01 in datacenter DC-01.

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

--ignore-storage-policy

Optional

Ignores storage policy compliance check.

Include this parameter to prevent migration failure if the migrated volume includes a storage policy with which the destination datastore does not comply.

DEST_DC_NAME

Mandatory

Specifies the destination datacenter.

DEST_DS_NAME

Mandatory

Specifies the destination datastore.

-h, --help

Optional

Show the use and arguments for this command.

-v, --verbose

Optional

Enter verbose mode.