Wednesday, June 12, 2013

Managing and Utilizing VMware Snapshots

A snapshot is a "moment in time." It can also be a "restore point." Using snapshots, we can roll back to the moment that the snapshot was taken, effectively going back before any changes were made. In this white paper, discover ways to use VMware Snapshots responsibly, issues that could arise from misuse, and how to address problems resulting from misuse, or from common issues even with proper use.

Using snapshots in a vSphere environment is deceptively easy, and there are many problems that can arise from nonchalantly utilizing them.

A snapshot is a "moment in time." It could also be thought of as a "restore point." However, you want to describe it, a snapshot is a safe rollback point so that if there are any issues, we can roll back to the moment in time that the snapshot was initially taken, effectively going back before the change was made.

Care must be taken not just when taking snapshots but in managing snapshots. This white paper outlines ways to use snapshots responsibly, issues that could arise from misuse, and how to address problems resulting from misuse, or from common issues even with proper use.

There are two main problems that people encounter with snapshots: the snapshot goes unchecked, grows and, ultimately, takes up all free space in the datastore, causing the virtual machine (VM) to crash (as well as any other VMs with snapshots on the same datastore). The second problem is a misunderstanding of the buttons inside the snapshot manager, leading people to accidentally roll back too far in time.

We will address these problems in detail, but first let's look at the virtual machine files created when a snapshot is taken.

.vmsd - This file is always part of a virtual machine regardless of whether a snapshot is present. This file describes the snapshots.

.vmsn - This file contains all of the memory that was in the virtual machine at the time the snapshot was taken.

delta.v mdk - This file is a change file, or redo log. It logs all ongoing changes to the virtual machine.

These changes are recorded sequentially, meaning the file starts empty, but as changes get written to the disk, this file grows. The flat.vmdk file is no longer locked and also no longer written to while the snapshot is present. All changes get written to this file.

0001.v mdk - This file (and others similarly named) is a text file linking the delta back to the original flat.vmdk file.

flat.vm dk - This is the preallocated virtual disk file. It is sometimes referred to as a monolithic file, meaning it is the size of your configured virtual disk (unless thin-provisioned).

As time goes on, the delta file will grow. Left unchecked, it can consume all free space on the datastore, eventually crashing if there is no more space. If this situation occurs, there are some options: Commit all changes to the virtual machine and consolidate the snapshots, or move the virtual machine to a different datastore with more available space. If you manually delete the snapshot files from the datastore, your virtual machine will have lost all changes since the snapshot was taken.

If you take a snapshot when an existing snapshot is present, a new series of files will be created (a new delta, text file, and memory snapshot file). The old delta will no longer be modified, and all ongoing changes now get logged in the new delta. The more snapshots there are, the more space is taken up. If there are many snapshots, as a result of misusing snapshots as backups, for example, then a lot of space could be consumed by these snapshots and committing the changes from all of these snapshots may be problematic. If we have taken multiple snapshots, say one each week, and each one is several GB in size, it can take several hours to potentially days to consolidate these snapshots. During the consolidation, space in the datastore could run out, and the VM could still crash. One option would be to consolidate, or commit, one snapshot at a time. Another option would be to simply try to clone this VM to a new virtual machine. The snapshot you are currently running on will be copied to the brand new virtual machine, and the new VM will not include any of the snapshots. Once this is done, the old virtual machine can be destroyed.

Go To

When you right-click a virtual machine and select Snapshot ! Snapshot Manager, you are faced with a deceptively simple interface. The hierarchy of snapshots is listed with a description box to the right, and three seemingly straightforward buttons at the bottom: Go To, Delete, and Delete All. These buttons can be misleading. First, let's explore the Go To button with the following example (Figure 1).


View the original article here

No comments:

Post a Comment