Tools for monitoring and deleting VMware snapshots

By | January 4, 2015

Recently we have discussed about snapshot best practices and recommendations. In this article I will show how to monitor and detect (orphaned) snapshots.

Nowadays, I think everybody has faced at least once with problems caused by snapshots (or orphaned snapshot). These problem could be:

Fortunately, there are tools including native VMware features or 3rd free/paid softwares to detect/monitor snapshots as follows:

Find command run on ESXi host directly or on vMA

There is a possibility to run a standard unix command directly on ESXi host to find snapshots:

find /vmfs/volumes/ -iname „*delta.vmdk”

The delta disk represents the difference between the current state of the virtual disk and the state that existed at the time that the previous snapshot was taken.

So if *delta.vmdk files exist = snapshots exists.

VMware vCenter snapshot trigger

VMware vCenter provides a way to monitor snapshots. You can create an alarm and trigger for VMs running from snapshots following steps:

To create a new alarm:

  1. Enter an alarm name and description.
  2. Define the type of alarm:
    1. In the Monitor list, click Virtual Machines.
    2. Select Monitor for specific conditions or state.
  3. Select Enable this alarm.

vcenter-snapshot-monitor-alarm

To add a new alarm trigger:

  1. Click Add.
  2. In the Trigger Type dropdown, click VM Snapshot Size (GB).
  3. In the On Condition dropdown, click Is above.
  4. Double-click the Warning field and enter the desired value.
  5. Double-click the Alert field and enter the desired value.

vcenter-snapshot-monitor-trigger

Veeam One Reporter

Veeam ONE Reporter (licensed version) allows you to automatically discover snapshots in your VMware infrastructure.

If you need monitor also "orphaned snapshots", you need to re-configure Veeam One. You need to specify the following Custom Filter in the report parameters: VMDK file - Contains - 0000veeam_one_snapshot_monitor

The Veeam management pack for SCOM

The Veeam Management Pack (MP) for Microsoft SCOM is a licensed pack which extends System Center with deep VMware monitoring, management and capacity planning. Veeam MP provides the Virtual Machine Snapshot Usage Analysis which tracks snapshot usage for virtual machines. Both age (of the oldest snapshot) and size (total for all snapshots) are monitored. By default, thresholds are as follows:

  • Snapshot Age > 48h
  • Snapshot Size > 2048 MB

If you need to search also "orphaned snapshots", you should override the default thresholds on this monitor Veeam_Snapshot_Monitorand change Snapshot Size threshold to > 0.

RVTools

RVTools is a free windows application which uses the VI SDK to display information about your virtual machines and ESX hosts.  RVTools provides information about VMs with snapshots and allows to export reports to .csv or .xls file.RVTools-tabI often use this tool to gather information e.g. during the completing and analyzing information from VMware infrastructure.

vCenter Orchestrator

VMware vCenter Orchestrator (vCO) is a free process-automation platform that provides a library of extensible workflows to allow you to create and run automated, configurable processes to manage the VMware vSphere infrastructure as well as other VMware and third-party technologies. We could write many articles about vCenter Orchestrator so let's focus on only snapshots. vCO includes workflows to monitor snapshots and perform below operations:

  • Remove all snapshots - removes all existing snapshots without reverting to a previous snapshot.
  • Remove old snaphosts - gets all snapshots that are older than a given number of days and prompts the user to select which ones to delete.
  • Remove snapshots of a given size - gets all snapshots that are larger than a given size and prompts the user to confirm deletion.
  • Remove excess snapshots - finds virtual machines with more than a given number of snapshots and optionally deletes the oldest snapshots. Sends the results by email.vcenter-orchestrator-snapshot-operations

Powershell scripts

If you like scripting, the powershell is a tool for you 😉 You can write a script to detect snapshots or use already written, like this script described here.

3rd backup solutions

Today, it is not a seldom problem that snapshots (specially orphaned) are created  by backup software. Fortunately, e.g. Symantec NetBackup provides usefull option for the VMware: "Orphaned snapshot handling". If a virtual machine snapshot exists that a NetBackup backup previously created: NetBackup removes the old snapshot, creates an updated snapshot, and proceeds with the virtual machine backup.NetBackup-orphaned-snapshot

Conclusion

Monitoring snapshots is an important activity and should be ensured by automatic tools. Surely, there are more tools for snapshot management than mentioned in this article. If you use another one, please leave a name of a tool as a comment.