VMware Cloud Community
krbulmer
Contributor
Contributor

Right Size recommendation Super Metric - help?

Hi,

I'm trying to create a supermetric that is the sum of the "Recommended number of vCPUs to Remove" and apply this to a custom group of VM's.  I only want to create the sum of the machines that are flagged with the CPU Is Oversized flag though... not all the VM's in the collection (as the VM's that are undersized have a negative number for vCPUs to remove).

To get the sum of all vCPUs to remove for the entire group the supermetric is simple:

sum(${adapterkind=VMWARE, resourcekind=VirtualMachine, attribute=cpu|numberToRemove, depth=1})

I can't find a way to do this summation for just the ones flagged as oversized for CPU.  Since the CPU oversize flag is either a 1 or 0 I tried doing a sum of (recommended vcpus to remove * cpu oversized flag) but I can't get it to accept any format I've tried.

something like this doesn't work:

sum(${adapterkind=VMWARE, resourcekind=VirtualMachine, attribute=cpu|numberToRemove, depth=1}*${adapterkind=VMWARE, resourcekind=VirtualMachine, attribute=cpu|numberToRemove, depth=1})

When I try I get "Cannot convert aggregated result to a number".

I can get this detail in a custom view with filtering but I want the data as a supermetric to include in a custom dashboard and to be able to track this summation over time.

Any ideas?

Thanks,

Ken

Tags (1)
Reply
0 Kudos
2 Replies
greco827
Expert
Expert

Have you tried changing "attribute" to "metric"?

If you find this or any other answer useful please mark the answer as correct or helpful https://communities.vmware.com/people/greco827/blog
Reply
0 Kudos
krbulmer
Contributor
Contributor

That makes no difference.  The syntax for the metrics themselves are correct as they were populated by picking the metric from the metric picker in the wizard.  As soon as I try to multiply those two metrics and then calculate the sum across all the objects in the group - that's when it's not even allowing me to enter it as a valid formula.

This is valid if I want to create a super metric that does that multiplication as a new metric for the individual VM's:

${this,metric=cpu|numberToRemove}*${this,metric=cpu|oversized}

I guess I could create that as a super metric and then create another super metric that is a sum of the first one for all the objects in the group.

Reply
0 Kudos