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:
- Low performance of VM
- Disk consolidation needed
- Out of space on datastore
- Corrupted VM
- The content ID of the parent virtual disk does not match the corresponding parent content ID in the child.
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:
- Enter an alarm name and description.
- Define the type of alarm:
- In the Monitor list, click Virtual Machines.
- Select Monitor for specific conditions or state.
- Select Enable this alarm.
To add a new alarm trigger:
- Click Add.
- In the Trigger Type dropdown, click VM Snapshot Size (GB).
- In the On Condition dropdown, click Is above.
- Double-click the Warning field and enter the desired value.
- Double-click the Alert field and enter the desired value.
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 - 0000
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 and 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.I 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.
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.
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.