Discard Snapshot /w 2 HDD? For backup?

This is for discussing general topics about how to use VirtualBox.
Post Reply
leeand00
Posts: 47
Joined: 2. Dec 2008, 03:53

Discard Snapshot /w 2 HDD? For backup?

Post 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?
Catclaw
Posts: 1
Joined: 26. Oct 2009, 17:15
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: winxp

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

Post by Catclaw »

I need help on this topic also. Tahnk you
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

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

Post 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)
undecidable
Posts: 1
Joined: 10. Sep 2009, 08:14
Primary OS: Ubuntu 8.04
VBox Version: PUEL
Guest OSses: WXP W2000

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

Post by undecidable »

Mark
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)
DaveTS
Posts: 1
Joined: 22. Jan 2010, 23:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows, various versions

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

Post 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?
jackyyaplt
Posts: 11
Joined: 12. May 2011, 20:28
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows 7 x64

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

Post 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:
Post Reply