svmotion - move the storage of a virtual machine while it is running


 svmotion <connection_options> --interactive
 svmotion <connection_options> 
         --datacenter=<datacenter name>
         --vm  <VM config datastore path>:
               <new datastore name>
         [--disks <virtual disk datastore path>:
               <new datastore>,
               <virtual disk datastore path>:
               <new datastore>]


The svmotion command moves a virtual machine's configuration file, and, optionally, its disks, while the virtual machine is running. The Basic System Administration manual discusses how to use svmotion. You can use svmotion to initiate migrations for virtual machines running on either ESX or ESXi hosts.

When you run svmotion, --server must point to a vCenter Server system.

The --vm option specifies the virtual machine and its destination. By default, svmotion relocates all virtual disks to the same datastore as the virtual machine. Use the --disks option to relocate individual virtual disks to different datastores. You cannot relocate a virtual disk without relocating the virtual machine configuration file.

The svmotion command supports both interactive or noninteractive mode.

Interactive Mode

To use the command in interactive mode, type svmotion --interactive. The command prompts you for the information necessary to complete the storage migration. Use quotes around special characters on Windows systems.

When you specify --interactive, all other options are ignored.

Noninteractive Mode

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

 svmotion [<connection_options] 
      --vm <VM config_ds_path>:<new_ds>  
      [--disks <virtual_disk_ds_path>:<new_ds>, <vdisk_ds_path>:<new_ds>]

Square brackets indicate optional elements, not datastores.



Specifies the target server and authentication information if required. Run svmotion with --help for a list of all connection options.

In non-interactive mode, all vCLI common options are supported. In interactive mode, command-line options are ignored and svmotion uses user input instead.


Prints a help message for each command-specific and each connection option. Calling the script with no arguments or with --help has the same effect.


Prints a short usage string. The usage string is also displayed when the number or format of input parameters is incorrect.


Starts interactive mode, where svmotion prompts you for all arguments. In interactive mode, svmotion does a sanity test on each option.

Note: You must enclose strings that contain special characters in quotes when responding to prompts.

--datacenter <datacenter_name>

Datacenter that contains the virtual machine to be migrated. Surround the name in quotes if it contains white spaces or special characters.

--disks <virtual_disk_datastore_path>:<new_datastore>...

Locations of individual disks. The format is datastore path of the disk, colon, name of the destination datastore. If the path contains spaces or special characters, you must quote it. You can specify multiple datastore and destination pairs, separated by commas. If you do not specify this option, all virtual disks associated with a virtual machine are relocated to the same datastore as the virtual machine configuration file. Specify this option 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>.

--vm <VM_config_ds_path>:<new_ds>

Specifies which virtual machine to move and to which datastore.

<VM_config_ds_path> is the path to the virtual machine configuration file. If the path contains spaces or other special characters, you must quote it.

<new datastore> is the name of the new datastore for the virtual machine configuration file or disk.


These examples are formatted for readability. In general, the command should be all on one line.

Start the interactive version.

 svmotion --interactive

Relocate a virtual machine's storage (including disks) to new_datastore:

 svmotion --url= 
          --vm='[old_datastore] myvm/myvm.vmx:

Relocate a virtual machine's storage to new_datastore, but leave the two disks (myvm/myvm_1.vmdk and myvm/myvm_2.vmdk) in old_datastore:

 svmotion  --datacenter='My DC' 
           --vm='[old_datastore] myvm/myvm.vmx:
           --disks='[old_datastore] myvm/myvm_1.vmdk:
                    [old_datastore] myvm/myvm_2.vmdk: