How does Storage vMotion work?
Storage vMotion is a great feature to use when you need to move VMs from one datastore to another. For instance, you may need to move all of your VMs to a newly purchased array. You can use Storage vMotion to do this migration without any downtime and with just a few clicks. Another use of Storage vMotion could be to convert workloads from thick provisioned disks to thin provisioned disks or vice-versa.
Now how does Storage vMotion work? The process appears to be quite simple on the surface, but under the covers, there is a lot of complex work going. In vSphere 4.1 and prior versions, the process used was called Changed Block Tracking (CBT), which basically copied all blocks the first time and then used the information within CBT to copy any blocks that had changed since the first copy.
In versions 5.0 and later, the process uses Mirror Mode. Mirror Mode splits the I/O between the source and destination, which means that every write I/O goes to both locations. This makes the process faster because the blocks only need to be copied once. The other cool thing about this is that if your storage array supports vStorage API for Array Integration, then Storage vMotion will use these capabilities as well.
Let's break down the actual process behind the scenes that makes all of this work.
- The source working folder (vmx, logs, etc.) is copied to the target datastore.
- A shadow VM is created and started on the target datastore using the copied files, but it is paused and prepared to receive copied blocks. This shadow VM is created to failsafe in the chance that the VM's home folder is moved.
- The mirror driver starts copying write I/O blocks already copied to the target datastore.
- The VM's disk files are copied to the target datastore and completed while the I/O is being mirrored in a single pass.
- The source VM is suspended and execution is resumed by the shadow VM.
- The source VM's folder and disk files are deleted from the source datastore.
How do you use Storage vMotion? The process is quite simple, all you need to do is right-click on a VM and select migrate, change datastore, select a virtual disk format (if you want to change), select new datastore, click next and then finish. Yes, it is that simple. Now go and do some Storage vMotioning.
Dig Deeper on P2V, V2V and V2P migration
Related Q&A from Larry E. Smith, Jr.
There are several storage protocol options for a VMware vSphere environment. Choosing the best one for your deployment will depend on your resources ... Continue Reading
Both virtual storage appliances and VMware's VSAN are software approaches designed to create affordable shared storage, but they are very different. Continue Reading
The flexibility to move VMs among hosts is a primary advantage to virtualization, making it the perfect approach for your failover strategy. Continue Reading