Huge Discounts on Mobiles, Books, Cameras, Computers etc: @Flipkart

Friday, May 14, 2010

Virtual Machines & Snapshots

Recently I was getting a lot of errors on my VMWare ESXi 3.5 server, that there is not enough space for the redo log etc. When I created the VMs, there was enough space left on the VM Server and suddenly I am out of space and all my VMs are either complaining or not working. Did some dig up and found that some snapshots were created, which was never committed and hence they were growing and eating all my disk space! I always thought the snapshot takes only a little space and it is a one time cost. But only now I came to know that creating a snapshot keeps on consuming more disk space to preserve the previous state and to keep note of the deltas that happened there after. So if you created a snapshot, either revert or delete(commit) it soon, unless you must retain the snapshot and have plans to revert to it. I recovered around 150GB or more after deleting all my snapshots..

Screenshot of datastore, with snapshots:

Screenshot, after removing snapshots:

Understanding Snapshots
Snapshots let you preserve the state of a virtual machine so you can return to the same state repeatedly. A snapshot captures the entire state of a virtual machine at the time you take the snapshot. This includes:
•  Memory State – Contents of the virtual machine’s memory
•  Settings State – Virtual machine settings
•  Disk State – State of all the virtual machine’s virtual disks

Snapshots operate on individual virtual machines. In a team of virtual machines, taking a snapshot preserves the state of only the active virtual machine. When you revert to a snapshot, you return these items to the state they were in at the time you took that snapshot. If you want the virtual machine to be suspended, powered on, or powered off when you start it, ensure it is in the state you want when you take that snapshot.
Snapshots let you revert repeatedly to the same state without creating multiple virtual machines. With snapshots, you create backup and restore positions in a linear process. You can also preserve a baseline before diverging a virtual machine in a process tree.

Snapshots can be used as restoration points during a linear or iterative process, such as installing update packages, or during a branching process, such as installing different versions of a program. Taking snapshots ensures that each installation begins from an identical baseline.

Multiple Snapshots
“Multiple snapshots” refers to the ability to create more than one snapshot of the same virtual machine. To take snapshots of multiple virtual machines, for example, taking snapshots for all members of a team, requires that you take a separate snapshot of each team member.

Multiple snapshots are not just a new way of saving your virtual machines. With multiple snapshots, you can save many positions to accommodate many kinds of work processes.

Although you can take snapshots to 32 levels, the time it takes to commit or delete those snapshots increases as the levels get deeper. The required time is directly proportional to the amount of data (committed or deleted) and the virtual machine’s RAM size.

Managing a Snapshot
The Snapshot Manager lets you review all snapshots for the active virtual machine and act on them directly.
In addition to the Snapshot tree, the Snapshot Manager dialog box contains the following areas:
•  Details displays the selected snapshot’s name and description. These fields are blank if you have not selected a snapshot.
•  Command buttons: Go to, Delete, Delete All, Edit
•  You are here icon represents the current operational state of the virtual machine. The icon is always selected and visible when you open the Snapshot Manager. You cannot go to or select the You are here state because it represents the current and active state.

The You are here icon represents a state that is never a snapshot itself but rather the virtual machine state after the parent snapshot has been taken. A snapshot is always a static record of a virtual machine state. The You are here state can be operational and changing. Even when you create a snapshot of a powered off or suspended virtual machine, the state is not identical to the snapshot.

To go to a snapshot
1.  Select a snapshot by clicking it.
2.  Click the Go to button to restore the virtual machine to the snapshot.
     The Go to command lets you restore the state of any snapshot.
3.  Click Yes in the confirmation dialog box.
4.  Click Close to exit the Snapshot Manager.

To permanently remove a snapshot from VirtualCenter
1.  Select a snapshot by clicking it.
     Note: Clicking Delete commits the snapshot data to the parent and removes the selected snapshot.
2.  Click the Delete button.
3.  Click Yes in the confirmation dialog box.
4.  Click Close to exit the Snapshot Manager.

To delete all snapshots
Note: Clicking Delete All commits all the immediate snapshots before the You are here current active state to the base disk and removes all existing snapshots for that virtual machine.
1.  Click the Delete All button to permanently remove all snapshots.
2.  Click Yes in the confirmation dialog box.
3.  Click Close to exit the Snapshot Manager.

Snapshots are not meant for long term, so make a decision soon and based on the decision either merge the snapshot(delete will merge & commit) or revert to previous state. Never use snapshot for backup, as the files are inter-dependent and if any of them is gone, whole VM is gone. Too many snapshots negatively impacts the performance of a virtual machine; and a single snapshot can take up as much disk space as the virtual machine itself

More info:


No comments:

Post a Comment