Opened 15 years ago
Last modified 15 years ago
#3813 new defect
Discarding a Snapshot should not decrease space left on the device before increasing it
Reported by: | Andres G. Aragoneses | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 2.1.2 |
Keywords: | Cc: | ||
Guest type: | other | Host type: | other |
Description
This is very related to the ticket http://www.virtualbox.org/ticket/3811 . That one is to avoid making the VM unusable. This one is to allow the user save disk space by discarding Snapshots instead of finding something else to remove on the partition (because what usually happens is that the user runs out of space *because* of not noticing how much space VirtualBox Snapshots take).
Change History (3)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Frank, thanks for your message.
The main reason I filed this bug is because it was the underlying problem of a bigger problem: the case in which you almost ran out of disk space, and realise that you have a lot of snapshots. You know that having less snapshots means (generally) using less disk space, so the user logically may try (as it happened to me) to discard them to save disk space, resulting in the opposite situation or, even worse, corrupting the disk image because the operation required more disk space than it found.
comment:3 by , 15 years ago
So I guess that solving ticket 3811 with a warning message to the user (telling her that there's no enough disk space to complete the operation) would eventually render this bug obsolete.
Sounds quite impossible to me. Such operations needs to be abortable. When a snapshot is discarded, the content of the snapshot is merged with the previous snapshot or with the base image. If that operation fails for some reason (e.g. out of disk space), the whole operation will be rolled back (at least this is the idea).
So discarding a snapshot means that a point in time is removed but the snapshot handling requires that this information (the corresponding differential image) is merged with the previous image. And after this merge, the differential image can be removed. It can even happen that removing a snapshot will free zero bytes -- this is the case if after the snapshot only new disk sectors were occupied.