The snapshot capabilities in VMware (and other hypervisors) make it really convenient to test applications. You can take a snapshot, install an application, do some testing, and then revert the snapshot. Effectively, bringing your guest virtual machine back to before the application was installed, and thus not leaving all the debris typical of uninstalling an application. But, the more snapshots you create, the slower the guest virtual machine runs. For a high transaction guest, like an Exchange email server for example, having snapshots linger can be a big performance bottleneck. Worse, its hard to find those lingering snapshots via the iSphere GUI, when you have a large number of guests. This blog discusses how to add an alert in vCenter that informs you about snapshots.
- Create a new alarm:
- Run the vSphere client
- Login to the vSphere client
- Highlight your data center
(Note: you can alternatively add the new alert into a particular cluster or host) - Goto the Alarms tab | Definitions view
- Right-click the empty space and select the “New Alarm…” menu item
- Populate the General tab:
- Give the alarm a name (e.g. Test Snapshot Alarm)
- Give the alarm a description
- Leave the default Monitor type of “Virtual Machines”
- Select “Monitor for specific conditions…”
- Check the “Enable this alarm” checkbox
- Populate the Triggers tab:
- Goto the Triggers tab
- Click the Add button
- Select “VM Snapshot Size (GB)” from the “Trigger Type” drop down
- Set the warning condition to 1 (or more if you want)
- Set the alert condition to 10 (which means 10GB)
- Skip the Reporting tab:
- (Nothing to do here — leave the defaults)
- Populate the Actions tab:
- Goto the Actions tab
- Click the Add button
- Select “Send a notification email” from the Actions drop down list
- Enter a valid email address in the Configuration field
(Note: this presumes you have SNMP email settings setup in vCenter) - Select Once for green to yellow transitions
- Select Once for yellow to red transitions
- Click the OK button
Since 1GB is a very small limit for snapshot size, you will be notified via email quite quickly after any running guest gets a new snapshot. On the other hand, since 10GB is a more significant size, you will probably have several days before the second notification gets generated. Obviously, you can tweak the alert sizes to reflect your own environments.