Can't Delete Snapshot

Discussions related to using VirtualBox on Linux hosts.
Post Reply
yupthatguy
Posts: 73
Joined: 4. Jul 2015, 07:48

Can't Delete Snapshot

Post by yupthatguy »

Hi there,

Hoping this is a quickie question... I can't delete an old snapshot and I am confused as to how to proceed. This is the error message that I receive:

Code: Select all

Failed to delete the snapshot Pre-Total-Webmail-Redirect of the virtual machine VminRoot2.

Unable to merge storage '/root/VDI-Files/VminRoot2.vdi'. Not enough free storage space.

Result Code: NS_ERROR_OUT_OF_MEMORY (0x8007000E)
Component: SessionMachine
Interface: IMachine {85632c68-b5bb-4316-a900-5eb28d3413df}
I use a hybrid machine and my VDI is located on the root / SSD drive with my OS which 20GB of free space... meanwhile the machine itself and other snapshots are on my HDD drive /home which has 279GB of free space... I don't understand why I am getting the error.

Any tips?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can't Delete Snapshot

Post by mpack »

Like it says: not enough host disk space. Deleting a snapshot requires lots of working disk space on the host, so free up a lot of space and it will work.

Top tip: nobody should be using snapshots if disk space is a consideration AT ALL, because the next stage after the above error is disk corruption. Hope you have good backups!

What I would suggest is that you clone the VM (current state only) in order to get rid of snapshots. If you set the Machine Folder preference before you start then you can control what volume the clone is created in. The VM can also be moved to a final location later, and the old snapshot-ridden version of the VM can be deleted.
yupthatguy
Posts: 73
Joined: 4. Jul 2015, 07:48

Re: Can't Delete Snapshot

Post by yupthatguy »

If I temporarily relocate the vdi to my hdd with 279 GB along with its VM.. surely that is enough space? (i.e. move vdi, delete snapshot, return vdi to ssd) It is also quite surprising/disappointing that 20 GB wouldn't be enough for a 40 GB vdi to delete a single snapshot.. but oh well.. :cry:
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Can't Delete Snapshot

Post by scottgus1 »

After you take a restorable and integrity-confirmed backup of the full VM folder and any disk files residing outside the VM folder, you can then right-click the VM in the main Virtualbox window list and choose Move and select a folder on the other disk, then the VM will be moved to the other disk, where you should have enough space to delete the snapshot.

Simply moving only the disk file and child snapshot themselves to another disk will not work. Virtualbox needs to know where the files are in its own registry to successfully delete the snapshot. And moving them to another disk without having Virtualbox handle the move will break the registry.
yupthatguy wrote:quite surprising/disappointing that 20 GB wouldn't be enough for a 40 GB vdi to delete a single snapshot
I don't know the mechanics behind deleting a snapshot, but I'd surmise that a safe method is to make a copy of the original disk file while adding in the data from the snapshot, then delete the original and snapshot. So you'd need space at least equal to the full size of the original disk available on the host drive.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Can't Delete Snapshot

Post by fth0 »

yupthatguy wrote:surely that is enough space?
To give you an easy (and somewhat simplified) example:

Let's say, you create a VM and fill the virtual disk image (VDI) with 20 GB. Then you take a snapshot and fill the differencing VDI (called Current State) with another 10 GB. If you now delete the snapshot, you want to get a merged VDI with the complete 30 GB of contents. During the merge, a power loss could occur, and VirtualBox doesn't want to loose the contents of the two VDI files in that case. In consequence, the resulting VDI file is completely merged first, and you need 20 + 10 + 30 GB of disk space during the merge.

Now for the maximum space required: If you create a VDI with a capacity of 50 GB and later take snapshots, each VDI can grow up to 50 GB, and you would additionally need up to 50 GB free space when deleting a snapshot.

You can read more about the details in 5.5. Differencing Images.
yupthatguy
Posts: 73
Joined: 4. Jul 2015, 07:48

Re: Can't Delete Snapshot

Post by yupthatguy »

Got it.. problem solved.. thanks fellas... I used Vbox media manager to move the vdi to the hdd, deleted the snapshot, and then moved it it. -diiferencing... understood.
Post Reply