Sorry if there is already an answer - just post the link, please. I can't believe that such a simple thing is not already solved, but I wasn't able to find a solution except deleting the children (and losing their data) or merging everything with clonehd (and losing all other snapshots). Thanks!
Snapshots are conceptually just timeline markers, giving you the ability to revert to past moments in the history of the VM. So if you no longer need the latter ability then simply delete the marker. You shouldn't need to concern yourself with exactly how that is done (e.g. whether it involves merging anything or not).
Deleting an old marker doesn't change the data available to the current state, it only removes your ability to revert to a specific earlier state. So, if you delete the oldest snapshot then the VM will keep working as before, with the same data, but it will take up less disk space on the host. You can call this a merge if you like. You can keep deleting the oldest snapshot until you are left with just the current state. Don't ever try to delete the current state! I don't actually use snapshots, so I'm not entirely sure what deleting the current state would do, I only know that it doesn't make much sense to try.
Thanks for the reply. You're right, in this specific situation with a straight timeline and a single vm it is really working when I use the Snapshot Manager (not the Virtual Media Manager) to delete a snapshot. But what if the differencing disk is not connected with any snapshot, e.g. after some cloning, deleting etc.? VMM says "not attached", but the differential disk image is still there and consuming space.
Moreover, the timeline is not always straight. You can have any kind of tree. Another example:
Cloning and deleting what? If you clone VDIs at the basement level (in a VM which uses snapshots) and then mount the clones in the original VM then that would rather thoroughly screw up the VM.
Also, not all difference images are snapshots, though they usually are - which is why I assumed that's what you were talking about (sans any info to the contrary). Linked clones (whether you are the cloned or the clonee), immutable drives, and use of compressed VMDK without unpacking it also involve the use of differenced images. Which of these is the VM actually using?
Cutting to the chase: a full clone of the VM, current state only, will create a clone VM which has no difference image attachments. The original VM can then be deleted. Cloning the VM will change disk and "motherboard" UUIDs, which may be visible to grub boot and IPR signature tools such as Windows activation.
My setup is using linked clones and a complex snapshot tree on each vm. The situation with orphaned differencing images arose after full cloning (including snapshots) a linked clone.
How do I delete these? I cannot do a full clone (current state only) as you suggested because I need the other snapshots.
You cannot delete snap2, because it has two children, snap3 and snap4. VirtualBox would have to do two merges. Snapshots are fragile as they are, you don't need to add any more complexity. So that would be a big "no".
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
reids wrote:I cannot do a full clone (current state only) as you suggested because I need the other snapshots.
Post either a screenshot of the tree, or the <VM_Name>.vbox. Right-click on the VirtualBox Manager on the VM, show in Finder/Explorer/Whatever... Please do not obfuscate the data (UUIDs).
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Situation 1: Everything above the selected vdi is not attached. It comes from the parent vm of a linked clone and was not merged when full cloning the linked clone.
snap1.png (31.69 KiB) Viewed 5784 times
Situation 2: The selected vdi is the same as its parent. It was generated automatically while creating a linked clone. I don't want this duplicate snapshot in my tree.
socratis wrote:You cannot delete snap2, because it has two children, snap3 and snap4. VirtualBox would have to do two merges.
Ah, I see how it works. VirtualBox always merges into the child, not the parent. So I could delete snap1 and then rename snap2 as snap1. However, being able to merge at basement level without thinking about snapshots and so on would add a lot of flexibility. The danger is of course to damage something if you don't know what you're doing - merging into a parent would destroy its other children. With VHD files this is possible anyway.
The questions above still remain: How do I do the merge with a VDI that is not attached (situation 1)? How do I take the empty automatic snapshots out of the chain (situation 2)?