I'm excessively using VirtualBox snapshots (for use in CI-builders), so typically I have a number of snapshots on a single VM. Often I find my self "forking" a new snapshot from an existing one, e.g. for updating the system:
base └── A └── A1
Once the udpate completes, I replace the parent snapshot with its child, by simply removing
A, VirtualBox will then merge the changeset
base └── A1
However, sometimes I want to create a new snapshot subtree, that originally forks of some snapshot, and gets a life of its own:
base └── A ├── A1 └── B └── B1
Now: this gets ugly pretty soon (as i keep updating the subtree), and eventually i like to clean up the snapshot tree, so it becomes:
base ├── A1 └── B1
Unfortunately, VirtualBox does not allow me to delete snapshot
A with the following error:
Snapshot 'A' of the machine 'vagrantbox' cannot be deleted, because it has 2 child snapshots, which is more than the one snapshot allowed for deletion.
In theory I do not see any problems with deleting snapshot
A: VirtualBox simply has to perform the snapshot merging twice (
base->A->B). This will probably grow the snapshot size, but I can happily live with that (and hopefully i will get better performance by reducing the FS-layers)
So: how can I rebase a snapshot to a parent, while leaving sibling snapshots intact?