Page 1 of 1

Discard Snapshot /w 2 HDD? For backup?

PostPosted: 27. Aug 2009, 04:34
by leeand00
I click on Snapshot 2 on one of my development Virtual Machines. I want to discard Snapshot2 so I click on the "Discard selected snapshot of the virtual machine" button, but when I go I get the error:

"Failed to discard the snapshot Snapshot 2 of the virtual machine OSB Development Box."

"Hard disk 'C:\Documents and Settings\Andrew\.VirtualBox\VDI\OSB Development Box.vdi' has more than one child hard disk (3)."

So how do I merge it if I want to say....back up the virtual box?

Re: Discard Snapshot /w 2 HDD? For backup?

PostPosted: 26. Oct 2009, 18:22
by Catclaw
I need help on this topic also. Tahnk you

Re: Discard Snapshot /w 2 HDD? For backup?

PostPosted: 27. Oct 2009, 02:44
by MarkCranness
The '...has more than one child hard disk (n).' message likely occurs because the VDI is being used by more than one VM (currently, or was/is used by another VM's snasphot).

To see which VMs may or may not have the VDI attached, use File>Virtual Media Manager, select the VDI file and expand the tree below it (use * on the numeric keypad).

Is the VDI currently being used by multiple VMs?

  • If No, then you should be able to Remove some of the child {hexUUID} VDI files immediately under the main VDI in the tree, until there is only one child {hexUUID} VDI left and then the snapshot can be discarded.
    Select each child {hexUUID} file in turn and note what it says below 'Attached to:'.
    If it says 'Not Attached', then that file can be Removed.

  • If Yes, then you will have to decide which VMs will have their Current State (as relates to that base VDI) discarded and which VM will have it's Current State preserved (if any).
    (This is because the snapshot you are trying to discard is snapshotting/protecting the base hard disk and it needs to be protected if it is to be shared by multiple VMs.)

    For all VMs that will have their Current State discarded (as relates to that base VDI), do the following:
    • In Virtual Media Manager, find the immediate child {hexUUID} file that is attached to the VM
    • Does that file have its own '+' sign and a tree under it?
    • If Yes, then view the VM's snapshots, and Discard the last (current, bolded) snapshot, (preceeded by a Revert if appropriate...) and repeat until the child does not have a tree
    • Select the (treeless) immediate child and use 'Release' followed by 'Remove' to delete that file (this does a 'Revert' on the Current State, as it relates to this base VDI)
    In the VM that will have it's Current State preserved, you should now be able to Discard snapshots as normal.

    Backup/whatever you need to do with the base VDI, take a snapshot on the main VM and then reattach to the VMs that were 'Released' above.
NOTE: Discarding a snapshot that has a base hard disk attached will copy the following snapshot onto the hard disk, or will copy the Current State onto the hard disk, Confirming/Accepting/Commiting the changes in that snapshot/Current State.

If you only want to backup the Current State of the a (main) development machine, then you can 'VBoxManage clonehd' the Current State to a new VDI and then backup that.
(See: Clonehd'ing a Snapshot or Current State)

Re: Discard Snapshot /w 2 HDD? For backup?

PostPosted: 15. Nov 2009, 15:54
by undecidable
thank you - helped me also.
(Thought I was in an infinite loop - kept creating new dummy snapshots whenever I tried to delete the current snapshot)

Re: Discard Snapshot /w 2 HDD? For backup?

PostPosted: 22. Jan 2010, 23:50
by DaveTS
Why does it keep unattached VDI's?

Seems an unnecessary complication, but then I'm new to VB having used VMWare, where to delete a snapshot all you have to do is select the snapshot and choose between Delete (where it performs a merge with the child) and Delete Snapshot And Children, and apart from a quick confirmation message that's all there is to it. Or is there some benefit to keeping all these apparently discarded VDI's?

Re: Discard Snapshot /w 2 HDD? For backup?

PostPosted: 12. May 2011, 20:33
by jackyyaplt
I agreed with DaveTS, I am using V4.0.6 and it is still the same behaviour... From a user perspective, I do not need to know and also do not want to know how these are managed or how many childs are there. I am only concerned with the snapshots that I have created. If I have created 2 snapshots, then there should be only 2 snapshots for me to delete, not the number of childs, etc. VMWare does this really well. Should we also have it in VB? :wink: