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 Scripting Guide and vSphere Command-Line Interface 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 Scripting Guide and vSphere Command-Line Interface 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.