Page 1 of 1

How to delete all of the snapshots with single action?

Posted: 18. Jul 2011, 11:31
by abcuser
Hi,
I have 30 snapshots on one of my test machine. Now I have realized that all of this snapshots are eating whole disk. I don't need any of this snapshot anymore, so I would like to delete them all.

But deleting one by one takes 30 minutes to delete single snapshot. Is there any way I can delete all of the snapshots at the single time? This can't be done using GUI - I can't mark multiple snapshots to delete. Any command like "delete all snapshots for VM"?

Is there some heck to manually delete all files and write some settings in one of xml files?

The only think I would like to preserve is "current state" of this virtual machine.

Host: Ubuntu 8.04 LTS (hardy).
Guest: Windows XP sp3.
VirtualBox: v3.2.12 (yes I am still on version 3!)
Regards

Re: How to delete all of the snapshots with single action?

Posted: 18. Jul 2011, 11:47
by mpack
If you clone the current state VDI then what you get is a stand alone merger of all the snapshots plus the base. You can build a new VM around this, of course ensuring that the hardware is identical. Try out the clone for a while to make sure it's ok, then delete the old VM.

Re: How to delete all of the snapshots with single action?

Posted: 20. Jul 2011, 16:46
by twistedlincoln
The ability to delete multiple snapshots at once would be a great feature for the GUI.

Re: How to delete all of the snapshots with single action?

Posted: 25. Jul 2011, 15:34
by qkb
Set the 'current state' to the base VM. If you now start deleting snapshots one-by-one starting from these which have no 'descendants' then it is quite fast: the operation simply deletes the diff VDI.

Re: How to delete all of the snapshots with single action?

Posted: 25. Jul 2011, 15:49
by Perryg
qkb wrote:Set the 'current state' to the base VM. If you now start deleting snapshots one-by-one starting from these which have no 'descendants' then it is quite fast: the operation simply deletes the diff VDI.
That would work only if you were wanting to loose everything and return to the pristine state of the base. Otherwise you will loose everything that has been done since the first snapshot was created. But the OP wants to preserve the current state and your solution would kill it for him.

@abcuser, listen to mpack.

Re: How to delete all of the snapshots with single action?

Posted: 27. Jul 2011, 13:07
by abcuser
Perryg wrote:That would work only if you were wanting to loose everything and return to the pristine state of the base.
I am using VBox for years, so I know this was a bad advice. Now I have just manually delete one by one snapshot it took me 'hell' a lot of the time, but just to make it sure I don't lose anything.

It would be nice feature to mark all the snapshots in GUI and then delete them with single Delete click button.