How do I delete ESXi vm snapshots using the least additional space possible?

We have a tree of about 15 snapshots of a virtual machine that runs Win2k8, as you may guessed our datastore is soon to run out of space. My objective is to delete all the snapshots, as it seems it was a huge mistake to use snapshots for backup purposes.

Now my question is how do we delete the snapshots so that the least amount of space on datastore is used for the merging process, since there is not much space left. Do we start deleting the tree from bottom up, ie. start with deleting the most recent snapshot and move up, or do we start deleting the oldest snapshots and move downward?


To minimize space used during consolidation:

  1. Shut down the VM. This way the swap file (size of the configured-reserved RAM) is deleted, and you don't need to worry about the temporary snapshot file that is created when deleting snapshots will eat away at your free space while you are deleting snapshots.

  2. Delete from the OLDEST snapshot first. E.G. the one closest to the base. Once that snapshot has been committed, you will increase your disk space. If you start with the newest snapshot, the one furthest from the base, you roll the deleted snapshot changes into the previous snapshot, and it will get larger as you move toward the base. If you are running ESXi 4.0 update 2 or later, it will do this in order for you. If you are running ESXi prior to 4.0 update 2, it will do the opposite PLUS maintain all of the snapshots until it finishes PLUS maintain the temporary snapshot to record activity while the snapshots are being removed. Thus, if you are running a version prior to 4.0 Update 2, it is CRITICAL that you manually delete the oldest first, and work your way to the newest one at a time.

Personally, when I am in that situation, I use this procedure no matter which version of ESXi I'm working on:

  • Shut down the VM.
  • Delete the snapshots one at a time beginning with the oldest snapshot, the one closest to the base, and progressing toward the latest, the one furthest from the base.

WHY would you have a 'tree of about 15 snapshot'? I know you can but that doesn't mean it's a smart way of doing things, ever heard of a clone or a backup - they're for keeping longer-term point in time copies of VMs, snapshots are just abused by the untrained as they think they're 'free' - they're not.

Either way it's your mess and there's no real way out of it other than to just live with the time it's going to take to delete them all manually from newest to oldest.


This article on VMWare's site indicates that the best approach is to delete the earliest snapshot first (if below ESX4.0U2) or not worry about it:

For versions prior to VMware ESX 4.0 Update-2, the task of consolidating all snapshots (Remove All Snapshots task) caused unique changes stored only in the second snapshot delta disk to be copied upward through the snapshot chain and into the first snapshot, or its "parent". This effect is recursive for each preceding parent file.

Example: You have a base disk of size 8 GB and 2 levels of snapshots, each of 4 GB each. During a Remove All Snapshot Tasks, the first snapshot delta disk file can grow, worse-case scenario, to 8 GB, as all new blocks from the second snapshot are written. Any common changes stored in both snapshot levels do not require additional space.

From ESX4.0 Update 2 onwards, the snapshot mechanism has changed. VMware ESX now incorporates improved consolidation procedures which lessen the demand of free space. You are able to consolidate virtual machine delta disks even while minimal free space on your datastore is available.

If you're only deleting some of the snapshots or need to do it by hand, I would recommend deleting the earliest snapshot first to minimize disk usage, else you could get the situation arising in the example above.


Another option is to clone the VM to another datastore if you have one available. All snapshots are collapsed during cloning.

If you have run out of space and cannot delete all snapshots, clone the virtual machine to a different datastore (you can select a different destination for each virtual disk in the clone wizard). All of the snapshots are committed to the clone virtual machine.

Delete All snapshot operation results in a Consolidate Helper snapshot when a datastore has insufficient disk space

Also, I suggest this as required reading for whomever is responsible for the operation of these servers. (Often being developers.)

Best practices for virtual machine snapshots in the VMware environment