Here is the most awesome ESX script known to mankind (by mankind I mean me) ever in the history of time (by ever I mean at least this week).
SnapVMX by Mr Ruben Garcia
I’ve being driving myself crazy over the last week trying to manually re-chain some horribly complicated and completely broken snapshots. This script (under a GPL3 license) analyses the complete snapshot chain and tells you exactly where there are broken links or missing files. It even reports exactly how much space you’ll need on the home datastore to commit them all. All automagically.
I was going to follow the link to this script with a detailed explanation of how snapshots work, how they commonly break and of course how to fix up the mess. However, it seems the author of the SnapVMX script has also written a paper (under a Creative Commons license) explaining the details more effectively than I could. It’s great read if you want to learn more about the inner workings.
Troubleshooting Virtual Machine snapshot problems by Mr Ruben Garcia
It even explains how to commit the individual disks of a VM, if room is tight on the datastore. And has this nice flowchart to help suppress the inevitable panics when the snapshots go South.
Rubian – if you make it VMworld this year, please make yourself known to me to redeem your free beer token.
Forbes – love it, any thoughts on entering our ESXi scripting contest ? Chance to win up to $2500 – for contest details visit http://vmware.com/go/scriptomania
Hi Pablo,
I’d love to take the credit, but I’m just the messenger. All credit should really go to Ruben Garcia who created the script. Also, the script needs a python runtime environment. It might work with the vMA, but I know if anyone has tested it with ESXi hosts.
Anyway, all props to Ruben.
SnapVMX now works on ESXi too.
See the documentation for instructions.
Fantastic, thanks!
Hi Forbes,
I’m glad that you liked the guide and the script.
A few days ago I reviewed, updated and expanded the troubleshooting guide.
Additions:
– Full procedure explanation with examples of how to commit manually to the Base Disk
– References to ESXi 3.5/4.0 and ESX 4.0 with differences and commands.
– List of weird issues (knowledge gained from experience)
– Small animation explaining the ‘delete all’ process.
– More links to patches.
– Recommendations to prevent issues.
– More pictures for “clone VM” stressing the possibility of putting the disks on different Datastores.
– Reviewed flowchart to make it a bit simpler.
– vmkfstools -q tricks.
Ah! Thanks for the compliment.
Thanks for letting us know, I’ve had a quick look at some of the changes and it looks great.
If I might be so bold, a suggestion for your site would be to have the script as a separate downloadable sh file. A couple of readers noticed that the formatting kept getting messed up when they copy/pasted from their browser.
P.S. I love the animated gif.
I have included the downloadable file as requested and some other stuff.
I’m always willing to improve the pages, so feel free to ask.
Regards.
Thanks Ruben, that’s great. Do you have a URL for the downloadable file as I couldn’t spot it?
File:
http://geosub.es/vmutils/SnapVMX.Documentation/SnapVMX.source.code.txt
Command to retrieve and load it:
# wget http://geosub.es/vmutils/SnapVMX.Documentation/SnapVMX.source.code.txt && source SnapVMX.source.code.txt
Don’t miss these patches.
http://vmutils.blogspot.com/2010/07/possibly-end-of-snapshots-story.html
They introduce a great improvement that changes drastically the snapshots troubleshooting and the most important, prevent the problem.
Nice write up! These patches are very good news.
Thanks for letting us know.