PCs

Easy check to see if a VM needs snapshot consolidation

Virtual machine snapshot consolidation can improve performance and correctly manage disk space. Rickatron shows a quick and easy way to see if consolidation is needed.

If you use VMware snapshots, there are a number of considerations that go along with them. The largest consideration is to understand that they will cause increased disk usage and, if forgotten about and left open, they will degrade performance over time. This can be compounded as an individual virtual machine can have multiple snapshots taken for different points in time.

That being said, snapshots are a great technology for VMware virtual machines (as well as other hypervisor technologies). In fact, many technologies leverage virtual machine snapshots for things like backups.

It is important however, to ensure that snapshot usage stays in check. We also have to ensure that nothing goes wrong with a snapshot being taken or removed. If there is any type of anomaly in the process, VMware has a remediation step for the virtual machine called snapshot consolidation. In this technique, any snapshots that are disconnected from the virtual machine, or are otherwise in play on the disk for the virtual machine, are corrected. This will enable future snapshots to be taken and ensure that disk usage as well as snapshot features are correct.

Within the vSphere Client, you can add a column to the view to display if the virtual machine needs to have consolidation performed. Figure A below shows this option added to the list of virtual machines in a cluster.

Figure A

The "Needs Consolidation" value can be selected en masse for the list of VMs.

With this selection displayed, system administrators can easily have a quick view of the virtual machines and identify if a virtual machine needs consolidation.

If one or more virtual machines do require consolidation, you can do it right away. Keep in mind that there will be an increased amount of storage I/O to correct the snapshots on the virtual machine. This may also take a long time depending on a number of factors. More information on the snapshot consolidation process for vSphere 5 can be found at VMware KB 2003638.

What tips and tricks do you employ for the snapshot consolidation process? Share your experiences below.

About

Rick Vanover is a software strategy specialist for Veeam Software, based in Columbus, Ohio. Rick has years of IT experience and focuses on virtualization, Windows-based server administration, and system hardware.

6 comments
jjcdspt
jjcdspt

Hi, yes, and when you have a snapshot based backup like Legato Networker or similar, sometimes these snapshots are not automatically deleted and "loose" connection to the base disk. It happens that when I do snapshot consolidation, it does not consolidate all snapshots and some of them stay on the disk. I can only delete them manually or in alternative vmotion the machine to another storage and delete the folder with the trash snapshots in the old storage. Then, vmotion back to the previous storage. It happens in version 5.

dgilchrist
dgilchrist

Is there any way to properly plan a consolidation so that we make sure we won't run out of disk space during the process? From what I remember, a single snapshot will just absorb into the base disk when deleted. But for any more than one, the VMDK disk file needs to be recreated. If your base disk plus snapshots are 100GB, you need 100GB free to start the process. Problem is, if your datastore only has 90 GB available, VMware will start the consolidation and won't warn you. This was true in ESX 4 - how about in ESX 5?

robo_dev
robo_dev

But perhaps I would be preaching to the choir? At a high level, when I have some small static VMs, where there's little data, I use the Veaam backup utility (sorry the free one) and thus avoid snapshot-hell simply by making sure I have a minty-fresh backup at all times. The VMware Snapshot process is a very misunderstood feature, and it seems that most people only really 'learn' about it when they really hose the server. The snapshot feature is a double-edge sword, of course. It can totally save your hyde when an OS upgrade goes wrong, but if someone misunderstands the feature and thinks they are making incremental backups. It's important to note that VMware changed the way snapshot deletion/consolidation worked with version 4.2...with the older versions it was real easy to really royally hose the server. For many VMware newbies, the mistake is thinking that VMware snapshots are like Windows recovery points. They are not. The safest way you use snapshots is right before making a system change, you take a snapshot, and then get rid of it if things go well. Below is what can happen if you're not careful: www DOT yellow-bricks DOT com/2010/07/05/changes-to-snapshot-mechanism-delete-all/ "Just to give an example, 4 snapshots: Old situation (pre vSphere 4 Update 2) Base disk – 15GB Snapshot 1 – 1GB –> possibly grows to 13GB Snapshot 2 – 1GB –> possibly grows to 12GB Snapshot 3 – 1GB –> possibly grows to 11GB Snapshot 4 – 10GB Snapshot 4 is copied in to Snapshot 3, Snapshot 3 in to Snapshot 2, Snapshot 2 in to Snapshot 1 and Snapshot 1 in to your Base disk. After the copy of Snapshot 1 in to the Base disk all Snapshots will be deleted. Please note that the total amount of diskspace consumed before the “Delete All” was 28GB. Right before the final merge the consumed diskspace is 61GB. This is just an example, just imagine what could happen with a 100GB data disk!"

daboochmeister
daboochmeister

Yeah, you're not kidding ... sometimes, for no apparent reason, they sit at 99% complete for 12+ hours. It's still happening in 5.0, anyone know if that problem is addressed in 5.1? I never found an actual problem # to track for that on vmware.com - maybe they consider it a "feature".

davecoffin
davecoffin

I am wondering if anyone has a solution for scheduling a snapshot consolidation report to be delivered to admins?

Greg Mix
Greg Mix

I remember at VMworld 2011, one of the things VMware engineers wanted to make people understand is that snapshots were never intended to be used as a backup system. VMware will tell you to not leave snapshots running after your comfortable with the changes that were made. So when do you need snapshot consolidation? Right after VM maintenance is done.

Editor's Picks