nazgul201110141
Contributor
Contributor

vcpu count on templates

I want to get all template vms on a cluster and then count the vcpu that they are using.

already tried a lot with creation of a supermetric but i cannot get it to give the correct figures.

if i go to a template vm i can get all the info i need so the metrics are available.

anybody that can show me how i can achieve this or have already created a supermetric for it

0 Kudos
4 Replies
BrettK1
Enthusiast
Enthusiast

I tagged all our templates and created a Custom Group with the only membership criteria being that one tag.

I then have a Summary View to show vCPU, RAM, Disk (I use this for other custom groups really), and this seems to be displaying the correct numbers for me.  This isn't 'traceable over time' like a supermetric, but should work for a point in time spot checking.

0 Kudos
nazgul201110141
Contributor
Contributor

thnx for the reply,

I found this as well ( after some digging ) and so i know that it is all in there and giving the correct numbers, but to be able to do some calculations i need it to be a supermetric. ( i think )

i tried this, but it always gives 0

sum(${adaptertype=VMWARE, objecttype=VirtualMachine, metric=config|hardware|num_Cpu, depth=3, where = (${metric=summary|config|isTemplate} == 1)})

0 Kudos
BrettK1
Enthusiast
Enthusiast

Ah, you do want to use it for other calculations, so yes, supermetric it is I suppose!

I don't have a solution, but I can say when I ran your supermetric against my Templates Custom Group, it returned "0".
When I removed the "where" statement, it returned the correct number.  As everything in the Template Custom Group IS a template (isTemplate = true for all of them), the results should be the same if the where is firing correctly.  As I haven't worked with those for any of my supermetrics thus far I can't suggest where the problem is in that portion, but hopefully that helps narrow it down (or possibly using custom groups gives an alternate method for gathering the data).

nazgul201110141
Contributor
Contributor

Indeed it works without the where and on a custom group, that's why i know it should work and think that there is, maybe, a bug in the where if i run it against a vm folder or cluster or ...

0 Kudos