In addition to using the Migration wizard, you can initiate migrations with Storage VMotion from the vSphere Command-Line Interface (vSphere CLI) using the svmotion command.

For more information about installing and using the vSphere CLI, see vSphere Command-Line Interface Installation and Reference.

You can run the svmotion command in either interactive or noninteractive mode.

To use the command in interactive mode, type svmotion --interactive. You are prompted for all the information necessary to complete the storage migration. When the command is invoked in interactive mode, all other parameters given are ignored.

In noninteractive mode, the svmotion command uses the following syntax:

svmotion [Standard CLI options] --datacenter=<datacenter name> --vm ‘<VM config datastore path>:<new datastore>’ [--disks ‘<virtual disk datastore path>:<new datastore>, <virtual disk datastore path>:<new datastore>]’

Square brackets indicate optional elements.

On Windows systems, use double quotes instead of single quotes around the values specified for the --vm and --disks options.

For more information on the standard CLI options, see the vSphere Command-Line Interface Installation and Reference.

svmotion Command Parameters describes the parameters for the svmotion command.

svmotion Command Parameters

Parameter

Description

<datacenter>

The datacenter that contains the virtual machine to be migrated. You must quote the name if it contains white space or other special characters.

<VM config datastore path>

The datastore path to the virtual machine’s configuration file. If the path contains white space or other special characters, you must quote it.

<new datastore>

The name of the new datastore to which the virtual machine configuration file or disk is to be moved. Do not include brackets around the name of the new datastore.

--disks

If you do not specify this parameter, all virtual disks associated with a virtual machine are relocated to the same datastore as the virtual machine configuration file. By specifying this parameter, you can choose to locate individual virtual disks to different datastores.

To keep a virtual disk on its current datastore, use the --disks option for that disk with its current datastore as the <new datastore>.

<virtual disk datastore path>

The datastore path to the virtual disk file.