Ticket #2000 (closed enhancement: fixed)

Opened 15 years ago

Last modified 12 years ago

Optional rollbackwards when deleting a snapshot

Reported by: TerryE Owned by:
Component: VM control Version: VirtualBox 1.6.4
Keywords: snapshot backup Cc:
Guest type: other Host type: other


This scenario comes up quite a lot when discussing backup strategies for VMs, where the end users require minimum downtime. A small change to the algo for deletion of middle snapshots will allow effective non-stop backups.

Consider the scenario where we have a running VM:

Snapshot 1    BaseSystem.vdi  R/O  10,356 blocks (1MB allocation blocks)
Current       {xxxxxxx1}.vdi  R/W   1,340 blocks

We now do a live snapshot with hangs the VM for ~20sec. (I am omitting the SAV files from this discussion for simplicity, but these don't materially impact timings):

Snapshot 1    BaseSystem.vdi  R/O  10,356 blocks
Snapshot 2    {xxxxxxx1}.vdi  R/0   1,340 blocks
Current       {xxxxxxx2}.vdi  R/W       0 blocks

We can do a D/R restore from Snapshot 1 + 2, and since the BaseVDI has already been backed up, the (only large file) {xxxxxxx1}.vdi that needs to be gzipped (say) which will take less than a minute, so in a reasonably quiescent system Current ({xxxxxxx2}.vdi) will only have perhaps 10 blocks in it. So now we wish to delete Snapshot 2 to restore our status quo:

Snapshot 1    BaseSystem.vdi  R/O  10,356 blocks
Snapshot 2    {xxxxxxx1}.vdi  R/0   1,340 blocks  <=== To be deleted.
Current       {xxxxxxx2}.vdi  R/W      10 blocks

Currently to do this you need to do 3 steps:

  • Suspend savestate the VM which takes about 15 secs, say
  • Delete Snapshot 2 which copies ~1,330 blocks from {xxxxxxx1}.vdi to {xxxxxxx2}.vdi which takes about 90 secs, say
  • Resume the VM which takes about 15 secs, say

My point is two fold:

  1. Given we can do the savestate in pause mode, why can't we do the snapshot delete in pause-mode as well?
  2. If we have the option to do the delete in the reverse direction copying the 10 blocks from {xxxxxx x2}.vdi to {xxxxxxx1}.vdi, this will take a second or so.

This approach of allowing dynamic backwards deletion of snapshots will allow VMs to be backed up on the fly with two pauses of perhaps 15 + a few seconds, which for most systems can be considered non-stop. If we allow a savestate -nomemory option (that is recovery to this snapshot will force a reboot -- which is probably fine for recovery purposes, the pause will fall to seconds. The current functionality requires stopping the system for an number of minutes.

It is also fairly trivial to do this back copy in three steps to ensure that the VDI is always maintains integrity.

PS. You should allow Host and Guest types N/A

Change History

comment:1 Changed 12 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

As of version 3.2.0, VBox supports deleting of snapshots while the VM is still running.

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use