What you need to know about Windows Server Virtualization O8 (code named Viridian) Snapshot Performance

First let my say how happy I am to have real bits in your hands. The next generation virtualization product from Microsoft has just shipped with the Windows Server 2008 RC0 (not the final product but getting close). Check out this blog for some external to Microsoft perspective https://www.eweek.com/article2/0,1895,2189866,00.asp

 What are virtual machine snapshots?

A snapshot refers to the process of saving a "frozen in time” image of a virtual machine (VM). This means the current contents of the VM memory, disk, ... are saved as they appear the instant you request the snapshot (well almost). This is a really cool feature and in a way is like transaction memory (different topic go "live" it -- hey I work for Microsoft J ) where you can go backwards in time to a snapshot and the machine is as it was.

What you need to know – Gotcha 1 – Slightly less performance

One gotcha with snapshots is when you click the snapshot button two things happen (there are also WMI interfaces if you want to use those). First the contents of memory are saved in a compressed format to disk and a "delta" drive is made on your existing Virtual Hard Disk (VHD). On a 1GB main memory VM this took me less than 2 - 6 seconds on a pretty snappy box with a single SATA drive. The gotcha is now all disk access essential hits two drives for reads. When a read happens first the VM looks into the AVHD file and then if not present into the VHD file. Writes just go to the AVHD file.

What you need to know – Gotcha 2 – Regaining performance but when?

Having an extra hard disk to check for a read is pretty interesting but what happens when the snapshots are removed? Ideally it would be nice to get rid of all the intermediate AVHD files (one for each snapshot on a path to the root VHD. Snapshots can happen on snapshots which creates a tree of points in time) to improve performance – no more multi-file lookups + accounting overhead. Well the process of getting rid of the intermediate AVHD is called merging and this is what happens. Each AVHD is merged into its parent. What's interesting is this merging is asynchronous and today there is no merge now button. Merging happens when the systems is idle to optimize for throughput. This means if you machine is forever loaded the merge may never happen and you are stuck in a sub-optimal mode.

Fortunately there is a way to make a merge happen immediately if not a little twisted. To get an immediate synchronous merge you can delete the VM and then recreate it with the left over VHD. The level over VHD has all the children from the VM merged in.

Keep in mind there is only one VM for a whole snapshot tree. The VM is targeted to a point in the tree and is that path to the root of the snapshots. This when a delete happens you have a well defined machine / hard disk.

What you need to know – Gotcha 3 – No snapshots on passthrough drives

Another cool feature of Viridian is the ability to have passthrough drives. This allows a virtual machine to use a physical disk rather than use a VHD. This should result in better performance. The gotcha is virtual machines using passthough drives don't have a VHD so there is not way to create an AVHD delta file (at least we dont today) which means no snapshots!

Hope these tips help and if you try this out let me know what you find.

Enjoy –Tony (Windows Viridian / Hypervisor Team)

[[Since this is a CTP all these behaviors might change and there are no promises or warrantees it will continue to work this way]]