Today we'll show a built-in tool which can inform you about any VMs that runs on snapshots within your VMware vSphere environment. The built-in tool is simply vCenter Alarms. I know that there are many third-party tools that can inform you about snapshots. One of them is for example Snapwatcher which I reviewed a way back. I'll list some other tools in this post as well, but today's focus will be on vCenter Alarms. I realized that vCenter alarms are not used as they could and many admins have also asked questions about alarms. So I think that a post about How to Create vCenter Alarm for VMs running on Snapshots is a good topic for today.
You have the possibility to create Alarms at different levels, but it makes more sense to create an alarm at the datacenter level rather at a host level. You can also create the alarm at the very top, which is vCenter level. The Alarm level hierarchy looks like this: vCenter > Datacenter > Cluster > Host(s) > Datastore > Folder > Resource Pool > Virtual Machine. You needs to be logged in as a user (or admin) which has certain permissions on all relevant objects. If not you're simply won't be able to create alarm.
How-to Create vCenter Alarm for VMs running on Snapshots – The steps:
Note that you can configure alarms through C# client (Windows) or through vSphere Web client, and that you don't see alarms when connecting directly to your ESXi host.
Step 1: Connect to vCenter and select your Datacenter object > Right Click in the white space area on the right > New Alarm.
You can also directly right-click the datacenter object > Menu Alarm > Add Alarm.
Step 2:
As you can see, there is four tabs. You need to configure 2-3 of them, but let's have a look at all of them.
- General – Enter name for your new alarm (VM with snapshots in my case) and description (optional)
- Triggers – Right click in the free area under Trigger type and select Add Trigger > under Conditions select Is Above. Chose settings with 1Gb and 10 Gb.
- Reporting tab – The reporting tab allows to setup repeating and range, if necessary. You can leave as is or enter a value.
Actions TAB – the last tab allows us to setup which action will be taken by vCenter server. Usually for this case it's best to get the information to your inbox, but there are other options (if setting up different kind of alamr you may want to have a closer look).
Additionally, I also documented the steps through a very quick video. Check it out.
Note that for the e-mail notification to work correctly you must configure SMTP configuration on vCenter. You'll find it at the Menu Administration > vCenter server Settings > Mail.
What if I don't have a vCenter server?
Not always you have all your ESXi hosts “hooked” to your vCenter server. In this case, you can have some third party tools or PowerCLI scripts.
In case you don't have vCenter server in your environment it means that:
- You're just running lab/test environment with ESXi hosts licensed with Free ESXi License
- You've licensed your ESXi hosts with paid license, but you don't have a central management. And no High Availability(HA), vMotion, DRS/DPM etc.
Well in those cases you can still use third party tools which can determine if you have any snapshots, but you have to determine this on a per-host level. The example here is with RVTools.
Other tools allowing to detect snapshots:
- vCheck PowerCLI script
- vCenter Orchestrator (which has a built-in workflow to detect alarms). Getting started with Orchestrator is here.
- Veeam One Reporter (licensed)
- Veeam Backup and Snapshot hunter feature, which allows removing snapshot from VMs reporting that they have no snapshots within vSphere! A snapshot delta files present in the datastore. Get Veeam Trial Here.
Enjoy.. -:) Stay tuned through RSS, and social media channels (Twitter, FB, YouTube)
Andy says
Is there a way to put a delay on this so I don’t get a pile of alarms when VEEAM runs?
techvet says
Foglight for Virtualization also has a report to do the same. A former colleague also wrote a homegrown script
vikrant says
I am sharing steps for creating vCenter Alarm for VMs running on Snapshots. Below is the steps.
Go to vSphere Client:
•Click File > Prerequisites > Alarm.
•Click Inventory > object_type > Alarm > Add Alarm.
•Right-click the object and select Alarm > Add Alarm.
•In the Alarms tab, click the Definitions tab, right-click in the pane, and click New > Alarm.
•Click on the object in the inventory and press Ctrl+A.
Then go to Alarm Settings – General tab
To create a new alarm:
1.Enter an alarm name and description.
2.Define the type of alarm:
a.In the Monitor list, click Virtual Machines.
b.Select Monitor for specific conditions or state.
3.Select Enable this alarm.
Alarm Settings – Triggers tab
State triggers are set off as soon as a state threshold or condition is achieved. You cannot define condition lengths for state alarms.
Note: You cannot use a virtual machine’s Total Size on Disk or VM Snapshot Size triggers in combination with any other triggers.
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.
Define tolerance ranges and trigger frequencies for condition or state triggers.
Alarm Settings – Actions tab
To define an action:
1.Fill in the Configuration tab with the details required for the configured Action.
2.Select if you want the action to be executed with a specific frequency, or just when there is a status change from normal to warning, warning to alert, alert to warning, and warning to normal.
3.Click OK and the alarm is ready.
vSphere Web Client:
1.Log in to the vSphere Web Client with an administrative user.
2.Click Hosts and Clusters.
3.Right-click the object you want to add the alarm to.
4.Navigate to Alarms > New Alarm Definition…
5.
6.Enter an alarm name and description.
7.Select the Monitor dropdown and click Virtual Machines.
8.Under Monitor for select specific conditions or state, for example CPU usage.
9.Select Enable this alarm.
10.Press Next.
11.Click Add.
12.In the Trigger Type dropdown, click VM Snapshot Size (GB).
13.In the Operator dropdown, click Is above.
14.Double-click the Warning Condition field and enter the desired value.
15.Double-click the Critical Condition field and enter the desired value.
16.Press Next.
17.Click Add.
18.Select the action you want to occur when the alarm is triggered.
19.Set the Repeat actions every time if needed.
20.Set the actions for state changes as needed.
21.Click Finish.
Additional Information