n00b questions for manipulating snapshots

This is for discussing general topics about how to use VirtualBox.
Post Reply
appyface
Posts: 79
Joined: 13. Sep 2009, 21:31
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP W7 Linux

n00b questions for manipulating snapshots

Post by appyface »

I'm using 3.1.2. Kudos to the development team for the major improvements in 3.1.x and being able to restore to different snapshots :)

Improvements aside, I am still confused on how I should approach three actions I need to perform at various times. After asking Mr. Google, searching and reading threads in this forum, reading the VBox help files, and viewing the text behind the snapshot commands, I'm still not clear how to best accomplish the following:

1. Discard all branches of all snapshots and the record of them, and go back to just the disk and state of the original 'base' VM. In other words, after doing this, if I open the VBox GUI I will just see my VM there, no evidence of any snapshots. The VM state is as it was, when the earliest snapshot was taken.
Before: Base, snap1, snap2, snap3, current state
After: Base <-- which is the state when snap1 was taken

2. Similar to #1, but discard all states and any evidence of them, down a branch past a snapshot I select. (Leave other snapshot branches intact, if any.) In other words, erase both the evidence and all states including current, past a specific snapshot on the branch. That snapshot is now the latest state available in that branch.
Before: Base, snap1, snap2, snap3, current state
After: Base, snap1, snap2

3. Select a snapshot in a branch and make this state become the new 'base' VM state, and keep intact any snapshots and current state which follows it on the branch. In other words, it's as if I had continued working in the original VM, up to this point, without taking any snapshots, and then after that I took some. (To keep it simple, it's OK with me if any other branches are completely removed in the process.)
Before: Base, snap1, snap2, snap3, current state
After: Base (same state as snap2), snap3, current state


Could someone please tell me the current 'best practice' methods to achieve each of these actions? If I've missed posts or documentation with specific steps, please point me, I've been reading through many threads asking about these same functions but as yet I don't have any concrete answers. The current 'delete snapshot' command does not seem to fit any of these scenarios, though I admit I do not understand the description of it.

Thank you in advance for your indulgence and your patience in helping a VBox n00b figure out how to accomplish these tasks.

Kind regards,
--appyface
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: n00b questions for manipulating snapshots

Post by MarkCranness »

appyface wrote:1. Discard all branches of all snapshots and the record of them, and go back to just the disk and state of the original 'base' VM. In other words, after doing this, if I open the VBox GUI I will just see my VM there, no evidence of any snapshots. The VM state is as it was, when the earliest snapshot was taken.
Before: Base, snap1, snap2, snap3, current state
After: Base <-- which is the state when snap1 was taken
  • Select the top-most Base snapshot, and 'Restore Snapshot'. The 'Current State' will move to the bottom of the tree.
  • Repeatedly: Select the snapshot just above the 'Current State', and 'Delete Snapshot' it.
    (You will be deleting all of the child snapshots, starting at the bottom and working up to the top.)
  • When you have ONLY one snapshot left, the topmost base snapshot, perhaps do another (superstitious) 'Restore Snapshot' (for luck?) and then 'Delete Snapshot' the Base snapshot.
appyface wrote:2. Similar to #1, but discard all states and any evidence of them, down a branch past a snapshot I select. (Leave other snapshot branches intact, if any.) In other words, erase both the evidence and all states including current, past a specific snapshot on the branch. That snapshot is now the latest state available in that branch.
Before: Base, snap1, snap2, snap3, current state
After: Base, snap1, snap2
  • Select the specific (to be kept) snapshot, and 'Restore Snapshot'. The 'Current State' will move to the bottom of the sub-tree rooted at that kept snapshot.
  • Repeatedly: Select the snapshot just above the 'Current State', and 'Delete Snapshot' it.
    (You will be deleting all of the child snapshots in the sub-tree, starting at the bottom and working up to the top)
  • When you have ONLY the selected (to be kept) snapshot left, stop.
appyface wrote:3. Select a snapshot in a branch and make this state become the new 'base' VM state, and keep intact any snapshots and current state which follows it on the branch. In other words, it's as if I had continued working in the original VM, up to this point, without taking any snapshots, and then after that I took some. (To keep it simple, it's OK with me if any other branches are completely removed in the process.)
Before: Base, snap1, snap2, snap3, current state
After: Base (same state as snap2), snap3, current state
  • If the 'Current State' is not currently in the sub-tree that is to be kept, then select a snapshot in the to-be-kept sub-tree and 'Restore Snapshot'.
  • Delete all snapshots that are not on the same branch as the snapshot that is to be kept. To do this, start at the bottom-most snapshot in each sub-tree and repeatedly 'Delete Snapshot'. Example:

    Code: Select all

    Base - on snap2 branch - Keep
    |
    +-- Delete 7
    |   |
    |   +-- Delete 6
    |       |
    |       +-- Delete 5
    |
    +-- Snap1 - on snap2 branch - Keep
    |   |
    |   +-- Snap2 - keep
    |       |
    |       +-- Snap3 - on snap2 branch - Keep
    |           |
    |           +-- Current State
    |
    +-- Delete 4
        |
        +-- Delete 3
        |   |
        |   +-- Delete 2
        |
        +-- Delete 1
    After deleting you will have:

    Code: Select all

    Base - on snap2 branch - keep
    |
    +-- Snap1 - on snap2 branch - Keep
        |
        +-- Snap2 - keep
            |
            +-- Snap3 - on snap2 branch - Keep
                |
                +-- Current State
  • Repeatedly 'Delete Snapshot' the top-most snapshot, until the selected (to be kept) snapshot is then at the top. Each time you delete, the next in line snapshot will then become the top-most and be the next to be deleted. It may take a long time (tens of minutes or more) to delete each snapshot, depending upon how much the virtual hard disks were changed after the snapshot was taken.
A key point to remember is: Delete Snapshot never changes or deletes the Current State.

Above I sometimes say delete from the bottom up and sometimes say delete from the top down. As far as the end result is concerned, the order or direction does not actually matter, it is just that it will run faster if done in the direction I suggest, because of differencing hard disk data that must be merged as snapshots are deleted.
appyface
Posts: 79
Joined: 13. Sep 2009, 21:31
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP W7 Linux

Re: n00b questions for manipulating snapshots

Post by appyface »

Mark,

Thank you very much for your clear and concise instructions!

I will be trying these procedures out in the coming days and will post back if I have any problems or questions.

Kind regards,
--appyface
Post Reply