nutsandbolts

VMware Fusion 201: Snapshots

I previously gave a tip about how to make effective use of snapshots, but what about how they actually work? As I mentioned, one of the key things to understand about snapshots is that they only store the differences between the current state and the original state. Technically-minded people will recognize this as copy-on-write.

Base
Let’s suppose you have a sparse virtual disk as shown. You then take a snapshot and do a little bit of work – modify the file at the far right and shorten the one before it. Once you take a snapshot, the original base disk is no longer written to, but is still read from. Most of the virtual disk is still pointing at the base file, but what you did change now refers to the snapshot. Snapshot_1
By itself, snapshot 1 is not enough to represent the virtual disk, nor is the base disk. Snapshot 1 might not even contain complete files, but only parts of files that have changed.

If you take another snapshot and make more changes, a similar process happens – now neither snapshot 1 nor the base file are written two, but are still referenced. New changes go to snapshot 2.Snapshot_2

Hopefully you can see why each snapshot can take up as much space as is allocated to the virtual disk – you might overwrite every single block, and Fusion needs to keep both the original (in case you want to revert to the snapshot) and the new data.

With a preallocated virtual disk, it’s nearly the same story. Only the base disk changes to a 1-to-1 mapping, but each snapshot is still sparse.