1. Overview
VMware® Storage VMotion™ enables live migration for running virtual machine disk files from one storage location to another with no downtime or service disruption:
- Simplify storage array migrations and storage upgrades.
- Dynamically optimize storage I/O performance.
- Efficiently utilize storage and manage capacity.
VMware vSphere® 5.1 vMotion presents a unified and integrated migration architecture that migrates live virtual machines, including their memory and storage, between vSphere hosts without any requirement for shared storage. When a virtual machine needs to be migrated between hosts that do not share storage, vMotion copies the data across the vMotion network using some of the Storage vMotion code. This shared-nothing live migration feature offers administrators significantly more simplicity and flexibility in managing and moving virtual machines across their virtual infrastructures compared to the traditional vMotion and Storage vMotion migration solutions.
Prior to 5.1, Storage vMotion solution was limited to the hosts that shared a common set of datastores. In addition, migration of an entire virtual machine required two separate operations, for instance vMotion followed by Storage vMotion, or vice versa.
2. How it works
Ref:
VMware vSphere® 5.1 vMotion Architecture, Performance and Best Practices
Insight Into vMotion: Architectures, Performance, Best Practices, and Futures
The Design and Evolution of Live Storage Migration in VMware ESX
2.1 Storage vMotion (vSphere 5.1, 2012) – asynchronous transport mechanism
2.1.1 non-shared datastore migration – asynchronous transport mechanism
vSphere 5.1 Storage vMotion follows an almost identical model for migrating a virtual disk, but uses a network transport for migrating the data. In contrast to previous Storage vMotion, vSphere 5.1 Storage vMotion cannot rely on synchronous storage mirroring because the source and destination datastores might be separated by longer physical distances. High or varying network latency can impact the virtual machine I/O performance adversely when using synchronous storage replication. Instead, vSphere 5.1 Storage vMotion relies on an asynchronous transport mechanism for migrating both the bulk copy process and I/O mirroring process data. The asynchronous transport uses a buffering technique that essentially enables vSphere 5.1 Storage vMotion to maintain very good virtual machine performance during the storage migration even in the face of higher and unpredictable network latencies.

vSphere 5.1 Storage vMotion typically transfers the disk content over the vMotion network. However vSphere 5.1 Storage vMotion optimizes the disk copy by leveraging the mechanisms of Storage vMotion whenever possible. For instance, if the source host has access to the destination datastore, vSphere 5.1 Storage vMotion will use the source host’s storage interface to transfer the disk content, thus reducing vMotion network utilization and host CPU utilization. Similarly, if both the source and destination datastores are on the same array that is capable of using VMware vSphere® Storage APIs – Array Integration (VAAI), and the source host has access to the destination datastore, vSphere 5.1 Storage vMotion will offload the task of copying the disk content to the array using VAAI.
2.1.2 Parallel Storage vMotions
vSphere 5.1 allows up to 4 parallel disk copies per Storage vMotion operation, where previous versions of vSphere used to copy disks serially. When you migrate a virtual machine with five VMDK files, Storage vMotion copies of the first four disk in parallel, then start the next disk copy as soon as one of the first four finish.
To reduce performance impact on other virtual machines sharing the datastores, parallel disk copies only apply to disk copies between distinct datastores. This means that if a virtual machine has multiple VMDK files on datastore A and B, parallel disk copies will only happen if destination datastores are C and D.
A fan out disk copy, in other words copying two VMDK files on datastore A to datastores B and C, will not have parallel disk copies. The common use case of parallel disk copies is the migration of a virtual machine configured with an anti-affinity rule inside a datastore cluster.
2.2 Storage vMotion (vSphere 5.0, 2011) – Synchronous IO Mirroring method
2.2.1 A new Storage vMotion mechanism based on a mirror driver
Storage vMotion uses a synchronous mirroring approach to migrate a virtual disk from one datastore to another datastore on the same physical host. This is implemented by using two concurrent processes. First, a bulk copy (also known as a clone) process (data mover) proceeds linearly across the virtual disk in a single pass and performs a bulk copy of the disk contents from the source datastore to the destination datastore. Concurrently, an I/O mirroring process transports any additional changes that occur to the virtual disk, because of the guest’s ongoing modifications. The I/O mirroring process accomplishes that by mirroring the ongoing modifications to the virtual disk on both the source and the destination datastores. When the guest OS of the virtual machine that is undergoing the process using Storage vMotion initiates a write to an already copied block, the mirror driver will synchronously mirror this write and wait for both acknowledgements before communicating this to the guest OS.
Storage vMotion mirrors I/O only to the disk region that has already been copied by the bulk copy process. Guest writes to a disk region that the bulk copy process has not yet copied are not mirrored because changes to this disk region will be copied by the bulk copy process eventually.
A synchronization mechanism is implemented that prevents the guest write I/Os from conflicting with the bulk copy process read I/Os when the guest write I/Os are issued to the disk region currently being copied by the bulk copy process. No synchronization is needed for guest read I/Os, which are issued only to the source virtual disk.
The Storage vMotion process is fairly straight forward:
1) The virtual machine working directory is copied by VPXA to the destination datastore.
2) A “shadow” virtual machine is started on the destination datastore using the copied files. The “shadow” virtual machine idles, waiting for the copying of the virtual machine disk file(s) to complete.
3) Storage vMotion enables the Storage vMotion Mirror driver to mirror writes of already copied blocks to the destination.
4) In a single pass, a copy of the virtual machine disk file(s) is completed to the target datastore while mirroring I/O.
5) Storage vMotion invokes a Fast Suspend and Resume of the virtual machine (similar to vMotion) to transfer the running virtual machine over to the idling shadow virtual machine.
6) After the Fast Suspend and Resume completes, the old home directory and VM disk files are deleted from the source datastore.
It should be noted that the shadow virtual machine is only created in the case that the virtual machine home directory is moved. If and when it is a “disks-only Storage vMotion, the virtual machine will simply be stunned and unstunned.
2.2.2 Storage vMotion snapshot support.
Storage vMotion in vSphere 5.0 now also supports the migration of virtual machines with a vSphere snapshot and the migration of linked clones.
2.3 Storage vMotion (vSphere 4.1, 2010) – hardware acceleration with VAAI
With Hardware Acceleration with vStorage APIs for Array Integration (VAAI), ESX can offload specific storage operations to compliant storage hardware. With storage hardware assistance, ESX performs these operations faster and consumes less CPU, memory, and storage fabric bandwidth.
2.4 Storage vMotion (vSphere 4.0, 2009) – Dirty Block tracking (DBT) method
vSphere 4.0 introduces several new capabilities to Storage VMotion. When Storage vMotion was introduced in VI3 release 3.5, it had a few limitations which vSphere 4.0 addresses.
2.4.1 Fully integration with vCenter
2.4.2 Fully support for migration across datastores of several protocol choices (FC, iSCSI, or NFS)
2.4.3 Fully support of virtual disk format choices (thin or thick)
2.4.4 More efficient migration process – Dirty Block tracking method
The enhancements to Storage VMotion also include a more efficient migration process, as well as the removal of the 3.5 requirement for having 2 times the CPU and memory needed for the VM that is being migrated. Storage VMotion in vSphere now leverages a change block tracking method that moves the VM home over to the new datastore in a few iterations instead of using the virtual disk snapshot method used in the 3.5 release.
Before moving a virtual machines disk file, Storage VMotion moves the “home directory” of the virtual machine to the new location. The home directory contains meta data about the virtual machine (configuration, swap and log files). After relocating the home directory, Storage VMotion copies the contents of the entire virtual machine storage disk file to the destination storage host, leveraging “changed block tracking” to maintain data integrity during the migration process. Next, the software queries the changed block tracking module to determine what regions of the disk were written to during the first iteration, and then performs a second iteration of copy, where those regions that were changed during the first iteration copy (there can be several more iterations).
Once the process is complete, the virtual machine is quickly suspended and resumed so that it can begin using the virtual machine home directory and disk file on the destination datastore location. Before VMware ESX allows the virtual machine to start running again, the final changed regions of the source disk are copied over to the destination and the source home and disks are removed.
This approach guarantees complete transactional integrity and is fast enough to be unnoticeable to the end user.
2.5 Storage vMotion (vSphere 3.5, 2007) – Snapshot based method
http://technodrone.blogspot.com/2011/05/storage-vmotion-deep-dive.html
http://www.vmworld.com/docs/DOC-2931

3. Storage vMotion with RDM
Ref:
VMware KB 1005241
http://blogs.vmware.com/vsphere/2012/02/migrating-rdms-and-a-question-for-rdm-users.html
3.1 VM with Physical (Pass-Thru) RDMs (Powered On – Storage vMotion):
- If I try to change the format to thin or thick, then no Storage vMotion allowed.
- If I chose not to do any conversion, only the pRDM mapping file is moved from the source VMFS datastore to the destination VMFS datastore – the data stays on the original LUN.
3.2 VM with Virtual (non Pass-Thru) RDMs (Power On – Storage vMotion):
- On a migrate, if I chose to covert the format in the advanced view, the vRDM is converted to a VMDK on the destination VMFS datastore.
- If I chose not to do any conversion, only the vRDM mapping file is moved from the source VMFS datastore to the destination VMFS datastore – the data stays on the original LUN (same behaviour as pRDM)
3.3 VM with Physical (Pass-Thru) RDMs (Powered Off – Cold Migration):
- On a migrate, if I chose to change the format (via the advanced view), the pRDM is converted to a VMDK on the destination VMFS datastore.
- If I chose not to do any conversion, only the pRDM mapping file is moved from the source VMFS datastore to the destination VMFS datastore – the data stays on the original LUN
3.4 VM with Virtual (non Pass-Thru) RDMs (Power Off – Cold Migration):
- On a migrate, if I chose to covert the format in the advanced view, the vRDM is converted to a VMDK on the destination VMFS datastore.
- If I chose not to do any conversion, only the vRDM mapping file is moved from the source VMFS datastore to the destination VMFS datastore – the data stays on the original LUN (same behaviour as pRDM).
As you can see, there are 3 occasions when an RDM could be converted to a VMDK. Perhaps the most surprising is the fact that a pRDM could be converted to a VMDK, when a cold migration of the VM is attempted, and the format is changed.