Is there any way to remove last snapshot ( merge last snapshot into VM without powering off VM) using command line in ESX 4? (I don't want to remove all snapshots using vmware-cmd removesnapshots).
If you want to do this via the classic ESX Service Console, you can take a look into vimsh for your snapshot operation:
[root@himalaya ~]# vmware-vim-cmd vmsvc/snapshot.remove Insufficient arguments. Usage: snapshot.remove vmid [removeChildren] [snapshotLevel] [snapshotIndex] Remove a snapshot on the vm.
I forget offhand which way the index level grows, you may want to do some testing but I think you just need to modify the last param snapshotIndex and it'll either start 0 and grow or the opposite value.
A more elegant solution is to use the vSphere SDK/VI SDK which allows you to just remove a particular snapshot by name RemoveSnapshot_Task() http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.Snapshot.html#remo... but this will require you to run a script outside of the ESX Service Console on either a Windows/Linux or on vMA
VMware vExpert 2009
If you find this information useful, please award points for "correct" or "helpful".