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
Assigned VMs column is the supermetric column I am trying to build and needs to be Total Machines - Spare Machines
Any ideas?
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}
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"
Even just using: { VDI Desktop Pool : Desktop VMs|Number of Desktops , depth=1} gives that error
I'd recommend to recreate the formula using ctrl-space and checking the output of each part.
Yeah, that's exactly what I did 😕
is VDI Desktop pool an object or object type?
If it is an object type you will need a 'sum'
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})
Please remove. something happened to the reply and double posted..
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?
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.
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: