Greetings all-- looking for some advice on creating a supermetric for getting the number of hosts in a cluster that are in maintenance mode.
What I'm really trying to do is to create a supermetric that derives the number of "Host Failures Cluster Tolerates" that's set in vCenter's Cluster HA Admission Control setting. Seems this isn't a metric or property vROps collects. So what I'm trying to do is derive it based on the configuration|dasconfig|admissionsControlPolicy|memoryFailoverResourcesPercent the vCenter feeds vrops and I'm doing that this way:
ceil(({ This Resource: configuration|dasconfig|admissionControlPolicy|memoryFailoverResourcesPercent }/100)*{ This Resource: summary|total_number_hosts })
But, what I'm realizing is vCenter dynamically changes that number when you put hosts into maint mode; and, rather than statically set that percentage (using the override option in vCenter), I'd rather dynamically just remove the number of hosts in maint mode from the equation. Make sense?
Any help would be greatly appreciated.
Thanks,
Think I just figured it out...
${this, metric=summary|total_number_hosts} - Count(${adaptertype=VMWARE, objecttype=Hostsystem, depth=1, metric=runtime|maintenanceState, where = "!contains inMaintenance"})
Then apply the SM to ClusterComputeResource object type and the policy. Seems to work.
Think I just figured it out...
${this, metric=summary|total_number_hosts} - Count(${adaptertype=VMWARE, objecttype=Hostsystem, depth=1, metric=runtime|maintenanceState, where = "!contains inMaintenance"})
Then apply the SM to ClusterComputeResource object type and the policy. Seems to work.
...and this is the full chain/supermetric that ultimately does what I wanted.
ceil(({ This Resource: configuration|dasconfig|admissionControlPolicy|memoryFailoverResourcesPercent }/100)*({ This Resource: summary|total_number_hosts }-{ This Resource: Super Metrics|Number of Hosts in Cluster in MaintMode }))
Sure would be nice if vROps just HAD the metric that corresponds to the host failure to tolerate setting in vCenter's Cluster object. 😕
This formula doesn't seem to account for hosts that are powered off. Any ideas how I could adapt it to produce a count of only the powered on hosts that aren't in maintenance mode?