Virtualization Pro

Dec 4 2008   7:58PM GMT

How large can virtual machine snapshots grow?

Eric Siebert Eric Siebert Profile: Eric Siebert

On a recent VMTN roundtable podcast the subject of how large a single snapshot can become came up, and whether or not the snapshot can exceed the size of the original virtual machine disk file. I’ve always stated that a single snapshot can never grow larger then the original disk file but others had thought they had seen instances where this had happened. After the discussion, a bunch of us did some testing to reconfirm this, and our results all showed that the snapshot never grew larger then the original disk file despite the amount of data that was changed after the snapshot was taken.

Why is this? When a snapshot is created, the original disk becomes read-only, and a separate delta file is created that contains all the disk changes that are made thereafter. The delta file does not contain an ongoing history or transaction log of all the changes to data on the disk, it simply updates disk blocks as they are changed. If a particular block is changed it is written to the delta file, but if that same block is changed again later on the existing block is simply updated with the new data and a new block is not written to the delta file.

For example, if you took a snapshot of a VM with a 10 GB virtual disk, that snapshot could never grow larger than 10 GB, although it might grow slightly larger if every single disk block was changed because of the extra overhead space included in the snapshot disk file. The initial snapshot starts out small (16 MB) and grows in 16 MB increments up to the maximum size of the original virtual disk as changes are made to it.

In most cases the snapshot will not grow as large as the original disk, because typically operating system and application files are not changed once they are installed and therefore those disk blocks are not changed. If you performed a disk defragment inside the operating system, however, this could quickly and easily grow the size of the snapshot as files are being moved around on the disk which results in them being rewritten in a new location and, subsequently, the disk blocks are updated accordingly.

Now this only applies to a single snapshot. It is possible for the combined disk space total of multiple snapshots to exceed the size of the original disk file. The reason for this is that previous snapshots become read-only when new ones are created. If a particular disk block was updated from a previous snapshot, it would be written as a new block in later snapshots. That same disk block could then exist in multiple snapshots, which could make the combined total of the snapshots greater then the original disk file.

Even though copies of a single disk block can exist in multiple snapshots when it comes time to delete the snapshots, only the latest disk block is written back to the original disk and all of the others are discarded. Likewise, if you revert to a particular snapshot, then the existing disk block is discarded if it has been updated since the snapshot that you are reverting to, and the disk block from that snapshot is used instead.

This may all sound a bit confusing but the moral of this story is that a single snapshot can never exceed the size of the original disk file. For more information on snapshots be sure and check out the three-part series that I wrote about them:

How VMware snapshots work (Pt. 1)
Deleting virtual machine snapshots without wasting disk space (Pt. 2)
Troubleshooting VMware snapshots (Pt. 3)

4  Comments on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Nickmanderson
    Quick question. Say I have a 10gb .vmdk file with 9gb being used. Now say I create a snapshot...so, can this snapshot get to be 10gb or will it only grow to 1gb? Any help with this is much appreciated. Thanks.
    55 pointsBadges:
    report
  • Eric Siebert
    It can potentially be 10GB if every single block of data is changed on the disk after the snapshot is taken. Snapshots only grow when data is changed on the original vmdk file after the snapshot is taken. It's more about which data changes on the disk rather then how much data is changed. For example if the same 1GB block of data is changed over and over and nothing else is changed then the snapshot will only be 1GB in size. If 5Gb of data is changed one time then the snapshot will be 5GB in size but if that data is changed again and resides on those same disk blocks then the snapshot will still only be 5GB. Hope that helps.
    1,605 pointsBadges:
    report
  • WkdPanda
    Ok, you guys need to do some more testing. I have a Win2k3/Exch03 server that was snapped in Nov 08. ESX lost track of the snaps, so they are still there, but not seen. Right now, [B]I have 500Gb of disks, and 650Gb of snaps[/B]! Yes, larger than the original, and yes, I have had VMware support (those wonderful guys in IRE) on the phone while looking at it. It takes 2.5 hours to cold boot the system, because of the snaps.
    0 pointsBadges:
    report
  • Eric Siebert
    You say "snaps" as stated in the post multiple snapshots can grow larger than the original disk size but a single snapshot can never grow larger than the original disk size: "Now this only applies to a single snapshot. It is possible for the combined disk space total of multiple snapshots to exceed the size of the original disk file. " What are your disk sizes/snapshot sizes and how many snapshots do you have?
    1,605 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: