[Webinar] Learn how to a build a cloud-first strategyRegister Now


Best order in which I should commit ESX snapshots

Posted on 2009-02-19
Medium Priority
Last Modified: 2012-05-06
I have a customer running multiple ESX hosts, versions 3.02 and 3.5.  They have been taking VM snapshots on a regular basis, but have never deleted/committed the old snapshots. So, they now have VMs with 10-12 snapshots each, some of which are a year or more old.  They are taking up a lot of disk space, and presumably causing performance issues.

Obviously they need to remove the snapshots.  My questions are as follows:
1) Is there a preferred order of deletion - what would be more efficient - (and safest!), delete the oldest snapshot first and work forward, or delete the newest snapshot first and work backward?
2) Would you recommend that the VM be powered down when deleting snapshots? This is what I have done in the past, but would like your input.
3) Can you suggest any documentation or white paper on best practices for snapshot management?  I need to tell them not to keep the snapshots for so long, but would like to be able to hand them some "authoritative" documentation.
4) Other thoughts for snapshot management?
Question by:bereanbs
LVL 32

Expert Comment

ID: 23680551
  1. If they are happy with the current configuration, I would commit the most recent snapshot and delete the rest.
  2. You do not have to power down the Guest OSs to delete snapshots.
  3. Here is a paper on snapshot management from VMWare http://www.google.ca/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fwww.vmware.com%2Ffiles%2Fpdf%2Fvcb_best_practices.pdf&ei=r1GdScfGIcyatwe-v6DkBA&usg=AFQjCNGjXzxwoT1rcVIU9SCATBvljL2plw&sig2=Rq_Um7f1lUbHVThB5EGVrA
  4. The recommended practice for snapshots is to only keep the snapshot until you satisfied with the Guest permance after some system update or application install/update.  This should not be for more that 2-3 weeks.

Author Comment

ID: 23680732
Can you clarify the difference between "commit" and "delete"? In my VI client, under SNAPSHOT | SNAPSHOT MANAGER, I only see options to delete, or to delete all.
LVL 32

Expert Comment

ID: 23680792
Commit means to Make the snapshot configuration permanent(no removing it).

Delete would mean to delete a snapshot but leave the OS running with the current configuration.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 32

Expert Comment

ID: 23680808
Keep in mind a snapshot is a "picture" take of the system "before" you made changes.  Changes that you made is taken effect immediately.  However, if you find your system is unstable after the changes, the snapshot allows you to revert to they way your system was before your changes were made.

Author Comment

ID: 23680863
Ok, so "commit" would be what I am doing if I "go to" or "revert to" a particular snapshot?
Back to my original question then, if I want to delete *all* of my snapshots, are you recommending that I start with the most recent and work backwards one at a time? (I have see corruption issues when I tried to delete a bunch of snapshots at once using the "delete all" option, so I've stayed away from that.)

Expert Comment

ID: 23681002
Snapshots are an incredibly useful tool but should not be considered a long term method of retention as the delta files will grow up to the size if the original disk if necessary or of course until they run the lun out of space..if this occures things get very messy..
To keep thing simple and ensure you don't manage to roll back a guests state I would just use the delete all button.
This will commit all existing snapshots combining them into the original VMDK file.
It may take some time to complete on each guest but will be your safes method.
If the delta files are large you may see time outs when you commit "delete all". Don't worry, be patient and confident it will functoin correctly.
Don't commit "delete all" on to many guest sessions at a time as commiting snapshots can put considerable load on the service console and generate considerable disk IO.
Take you time, be patient, maybe 2 guests at a time..
Of course the guest can stay up while your doing this, no need to shut them down. If it doesn't matterthat you shut down the guest sessions then do it. They will commit quicker..

Expert Comment

ID: 23684497
Always important to remember the reverse logic that applies with VMware snapshots
Deleting a snapshot commits the delta vmdk (all changes since the snapshot was taken) to the original.
Reverting a snapshot discards the delta (all changes since the snapshot was taken) and reverts it to a previous state.

As Markzz says,  Virtual Center can often show a timeout with the deletion of large snapshots (which you will have if they've been keeping them for ages) The process will still be running in the background.  Just monitor the VM's folder in the datastore and watch the delta files disappear to guarantee yourself that it's working.

Use something like RVTools V2.3 (http://www.robware.net/) or a powershell script to identify long standing snapshots,  this one is good as it adds the snapshot counter into VI Client http://www.peetersonline.nl/index.php/vmware/add-snapshot-information-to-the-vi-client-using-powershell/ 

Author Comment

ID: 23684748
I hate to be repetitive here, but the most important part of my question is...
If I want to delete *all* of my snapshots, are you recommending that I start with the most recent and work backwards one at a time?   Or does the order of deletion not matter?
Basically, I am looking to clean up VMs that have large numbers of snapshots, some going back a LONG time, and I want to do it as quickly and **safely** as possible.
LVL 32

Expert Comment

ID: 23684776
If you are going to do that, don't do more than one VM at a time.  Depending on the number of snapshots it can take a while.  Better to screw up one guest than 10 at the same time.
LVL 22

Accepted Solution

robocat earned 2000 total points
ID: 23685433

>I want to do it as quickly and **safely** as possible.

As far as safe is concerned:

the biggest issue is running out of space during snapshot deletion. If this happens, things can get really ugly. If you have plenty of free space, go ahead and choose to delete all snapshots. If you're not sure, it's safer to delete snapshots one by one. Also if the snapshots are *really* big, it might also be safer to delete the snapshots one by one.

As far as quick is concerned: if you choose to delete all snapshot at once, esx knows how to consolidate the snapshots in the most efficient way. If you delete one by one, start with the oldest snapshot first.


Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
Teach the user how to configure vSphere Replication and how to protect and recover VMs Open vSphere Web Client: Verify vsphere Replication is enabled: Enable vSphere Replication for a virtual machine: Verify replicated VM is created: Recover replica…
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question