VMware – How to Delete ESXi VM Snapshots Using Minimal Space

snapshotvmware-esxivmware-vsphere

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?

Best Answer

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.