Using Storage vMotion
Storage vMotion allows you to move a running virtual machine from one storage cluster to another. Taking the virtual machine or its associated storage offline is not required. All datastore types are supported, including local storage, VMFS, NAS (network attached storage), and VVols (virtual volumes).
You can place the virtual machine and all its disks in a single location, or select separate locations for the virtual machine configuration file and each virtual disk. The virtual machine remains on the same host during Storage vMotion.
To perform Storage vMotion, call the VirtualMachine object's RelocateVM_Task method. The RelocateVMSpec passed in to the method allows you to specify the target datastore and target host or resource pool.
As of vSphere 6.5, you should call RelocateVM_Task for all types of vMotion:
- cold relocate, whether VM storage moves or not
- vMotion within a cluster
- Storage vMotion
- cross-datacenter vMotion (XvMotion)
- Folder moves not involving VM moves