VMware Cloud Community
MattG
Expert
Expert
Jump to solution

Create a Super Metric for VMs that show how many VMs are on the parent host

One of the properties of a VM is Parent Host.  I would like to pass this info to a VM Super Metric and use it to gather how many VMs are on the associated VM's Parent Host.   This SM would then be associated with my VMs.

Is this possible?

-MattG

-MattG If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
1 Solution

Accepted Solutions
MattG
Expert
Expert
Jump to solution

I figured this out:

avg(${adaptertype=VMWARE, objecttype=HostSystem, attribute=summary|total_number_vms, depth=-1})

Since I had to use a Host object type I didn't think it would show as a Super Metric in the VM metrics....it does!

-MattG

-MattG If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos
2 Replies
MattG
Expert
Expert
Jump to solution

I figured this out:

avg(${adaptertype=VMWARE, objecttype=HostSystem, attribute=summary|total_number_vms, depth=-1})

Since I had to use a Host object type I didn't think it would show as a Super Metric in the VM metrics....it does!

-MattG

-MattG If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
sxnxr
Commander
Commander
Jump to solution

This works great for me also but is there a way that when i select a VM to show the total number of VM in its parent cluster.

I have tried with different depths

avg(${adaptertype=VMWARE, objecttype=ClusterComputeResource, attribute=summary|max_number_vms, depth=-1})

Trying to get capacity stats as well

avg(${adaptertype=VMWARE, objecttype=HostSystem, metric=cpu|alloc|actual.capacity.normalized, depth=1})

but they all come out as 0

0 Kudos