VMware Cloud Community
markmcgilly
Enthusiast
Enthusiast

Alert on number of snapshots

Hi

I'm looking for a way to alert in vROps when a VM has above a certain number of snapshots. Our backup software can leave snapshots behind and from time to time they build up until the limit of 31 is hit.

I can see all the snapshots under All Metrics - Disk Space - <Datastore Name> - Snapshot - snapshot-xx

pastedImage_0.png

Any suggestions on how I would alert on the quantity of snapshots?

Tags (2)
Reply
0 Kudos
8 Replies
lannguyen
VMware Employee
VMware Employee

Create a Super Metric using the Count formula.  The formula is below.  Add your metric in the middle of the brackets.  This will give you a count of snapshot.  After that you can create an alert based on the Super Metric.

count(snapshot_metric)

Personal blog VMignite.com
aaghabekyan
VMware Employee
VMware Employee

Hi Mark,

Below are the Super Metric formulas wich count the number of existing snapshots, then you can create a symptom and Alert based on the supermetrics.

count(${adaptertype=VMWARE, objecttype=VirtualMachine, attribute=diskspace|snapshot|accessTime, depth=6})

count(${adaptertype=VMWARE, objecttype=VirtualMachine, attribute=diskspace|snapshot|used, depth=6}) - count(${adaptertype=VMWARE, objecttype=VirtualMachine, metric=diskspace|snapshot|used, depth=6})

markmcgilly
Enthusiast
Enthusiast

Hi aaghabekyan

Your post has got me part of the way to the solution. Thanks!
When looking at a VM object all the supermetrics are 0
When I look at vSphere World there starts to be numbers. Is this because of the depth=6?

I had to enable collection of diskspace|snapshot|accessTime


I'd hoped to be able to alert when an individual VM had say more than 16 snapshots. Is this possible?
I'm not concerned about the overall number of snapshots which is what count(${adaptertype=VMWARE, objecttype=VirtualMachine, attribute=diskspace|snapshot|accessTime, depth=6}) seems to get me

Thanks
Mark

Reply
0 Kudos
aaghabekyan
VMware Employee
VMware Employee

Yes exactly, the supermetrics are 0 for VM object because of the depth=6, and supermetrics provided by myself make a sense for vSphere World object only.

Reply
0 Kudos
markmcgilly
Enthusiast
Enthusiast

Ah ok, that's a shame that it only works at a higher level in the hierarchy.

Thanks for your efforts

Reply
0 Kudos
Oulyanov
VMware Employee
VMware Employee

1. you can get it work with the object below just decreasing the depth (eg depth = 5 would count on vCenter)

2. Remember that snapshot metrics shown under All metrics *could* also include metrics for the snapshots that are already removed in vSphere...

Reply
0 Kudos
lannguyen
VMware Employee
VMware Employee

Mark you first need to create the supermetric, than create a new symptom and select that super metric and then create the rule to greater 15.  Then you will create an Alert Definition after that.  Here is an example of how to create a new Alert definition.  vROPS – How to get an alert and email notification when a VM is down | VMignite.com

Personal blog VMignite.com
Reply
0 Kudos
markmcgilly
Enthusiast
Enthusiast

I've tried playing around with the depth

When I look at a VM I know has several snapshots this supermetric is 0

count(${adaptertype=VMWARE, objecttype=VirtualMachine, attribute=diskspace|snapshot|accessTime, depth=0})

Reply
0 Kudos