How does Storage Migration actually work? – as explained in Virtual PC Guy’s Blog – MSDN Blogs

How does Storage Migration actually work? – Virtual PC Guy’s Blog – Site Home – MSDN Blogs.

 

How does Storage Migration (in Windows Server 2012) actually work?

The process followed by Hyper-V internally to perform a storage migration is actually quite simple to explain (though obviously quite tricky to actually make work in code) and is as follows:

Step 1: We start with a virtual machine that is reading and writing to a virtual hard disk file (.VHDX in the diagram, but storage migration is supported for both .VHDX and .VHD files).

image

Step 2: After the user selects to perform a storage migration, we immediately create a new virtual hard disk in the requested destination.  We continue to read and write to the source virtual hard disk – but any new write operations are also mirrored to the new virtual hard disk.

image

Step 3: We perform a single single pass operation to copy the data from the source virtual hard disk to the destination virtual hard disk.  While this copy is happening we still continue to mirror writes to both disks.  We also keep track of uncopied blocks that have already been updated through a mirrored write – and make sure to not needlessly copy that data again.

image

Step 4: Once the copy operation is complete – we switch the virtual machine to be running only on the destination virtual hard disk.

image

Step 5: We delete the source virtual hard disk and the migration is now complete.

image

One important note to make here – we are very careful to not delete the source virtual hard disk until after the virtual machine is successfully running on the destination virtual hard disk.  This way if there is an error at any point in the storage migration – we can always fail back to running off of the source virtual hard disk.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s