Sunday, November 14, 2010

Using snapshots with VirtualBox 3.2.10

Before I am going to install the OSB on my Oracle Enterprise Linux virtual machine with SOA Suite 11g I want to experiment a little with snapshots.  Snapshots give me the possibility to store a working state of my virtual machine. So when the installation does not work I can restore to this previous working state.
In the virtualbox console there is a tab named Snapshots. Here a list is shown with all snapshots and the current state of your virtual machine. First I want to take a snapshot of the current state. You can do this by pressing the right most image button or right clicking on the Current State.
In the popup I entered some details.
In the list a new item is added before the current state as seen below.  
A snapshot has been created now.
So far so good. Now I did some changes to my current state (I deleted a directory). So let’s see I can go back to the previous state and see if the directory is restored again. To do this I right clicked on the snapshot and selected Restore Snapshot.
A window popped up warning me my virtual machine will be rolled back to the moment of the snapshot. I pressed Restore as this is exactly what I want.
After some processing (progress shown in a window I did not capture) my snapshot was restored. When I opened my virtual machine the previously deleted directory was restored so it worked.
In this case I restore to the first snapshot before the current state. When I would have restored to a snapshot skipping some snapshots how do I get rid of  these skipped snapshots that have become obsolete. To test this I created three snapshots and restored the first one.
To get rid of the two obsolete snapshots I want to delete them as I do not want to return to anymore. This was very easy, just delete the two snapshots by right clicking on one of these snapshots and select Delete Snapshot.  
So suppose my installation went ok. I do not need the snapshot anymore and want to remove it. This can be done by merging the snapshot (or snapshots if you have created more) and the current state.

In some other post I read you have to work your way down from the most recent snapshot to the latest and merge them by executing Delete Snapshot (Ctrl+Shift+D).

Resulting in a nice clean empty list.

I can only conclude working with snapshots is easy with virtualbox. I feel safe enough to do my installation of OSB knowing I can always return to a working state.

No comments:

Post a Comment