VMware Cloud Community
KingRaymond
Contributor
Contributor

I cannot seem to build a supermetric.

Here is the forumla:

sum(count({ VDI Desktop Pool: Desktop VMs|Number of Desktops, depth=1})-count({VDI Desktop Pool: Desktop VMs|Spare (powered on) Desktops, depth=1}))

 The output needs to be Total Machines - Spare Machines in the following screenshot

unknown.png

Assigned VMs column is the supermetric column I am trying to build and needs to be Total Machines - Spare Machines

Any ideas?

 



Labels (3)
Reply
0 Kudos
10 Replies
sennevanlaer
Enthusiast
Enthusiast

Hi

it seems to me the 'sum' operator is not needed/misused in your formula. 

Also the count operator counts instances, it will not return "the number of desktops", but instead how many object have that metric.

My recommendation is to build such a formula piece by piece!

{ VDI Desktop Pool: Desktop VMs|Number of Desktops, depth=1}-{VDI Desktop Pool: Desktop VMs|Spare (powered on) Desktops, depth=1} 

 

Reply
0 Kudos
KingRaymond
Contributor
Contributor

Hi There, 

Thanks so much for your response, but I think I might have tried that before - and I get a "Cannot convert aggregated result to a number"

KingRaymond_0-1651747847052.png

 

Even just using: { VDI Desktop Pool : Desktop VMs|Number of Desktops , depth=1} gives that error

Reply
0 Kudos
sennevanlaer
Enthusiast
Enthusiast

I'd recommend to recreate the formula using ctrl-space and checking the output of each part.

 

Reply
0 Kudos
KingRaymond
Contributor
Contributor

Yeah, that's exactly what I did 😕

Reply
0 Kudos
sennevanlaer
Enthusiast
Enthusiast

is VDI Desktop pool an object or object type?

If it is an object type you will need a 'sum'

sennevanlaer_0-1651748970357.png

 

 

 

Reply
0 Kudos
KingRaymond
Contributor
Contributor

Hi,

 

Correct, it is an object type. Doing the 'sum' results in a "0". So unless its the wrong fields to be looking at, there is something else I am missing. 

 

In the below image, as you can see, I can getting information from the Pool in horizon - Maximum Machines = 20, Total Machines = 18. Assigned VMs should be as per: sum({ VDI Desktop Pool : Desktop VMs|Number of Desktops , depth=1})-sum({ VDI Desktop Pool : Desktop VMs|Spare (powered on) Desktops , depth=1})

 

Capture.PNGCapture1.PNGCapture2.PNG

 

Reply
0 Kudos
KingRaymond
Contributor
Contributor

Please remove. something happened to the reply and double posted.. 

Reply
0 Kudos
sennevanlaer
Enthusiast
Enthusiast

I don't know about the structure of those objects... maybe you need to play with the "depth" parameter?

Do the separate parts give appropriate results?

Reply
0 Kudos
KingRaymond
Contributor
Contributor

Nope, unfortunately the different depths didn't. I am going to open a case with VMware today to see if I can get some assistance there. 

Reply
0 Kudos
KingRaymond
Contributor
Contributor

I managed to get the supermetric to work with the numbers I need - kind of. 

Basically, the information I needed had no metric or object for it. The only other way for me to do this was to do a count on a property value that will exist on all VMs. 

However, even this seems problematic :(. 

This metric seems to be counting everything. CustomTags with value OR not 

count({ Virtual Machine: Summary|Custom Tag:HZOwner|Value, depth=1)}

I have 260 VMs. 240 of them have the value populated, 20 dont, yet the count is still 260 and not 240. I really ONLY need to count the HZOwner|Value IF it has a value. 

Super Metric:


Null Value:

With Value:

 

Reply
0 Kudos