This post is more than 5 years old

185512

January 30th, 2013 13:00

How to associate esx cluster with Datastore report

Hi all,

i am running a repore that shows data stores less that 50 gig free. The storage team would like a coloum for the esx clusters associated with the luns. I can't see to find this and is it possible.

thanks in advance,

Scott.

132 Posts

January 30th, 2013 14:00

I would create a WCF Function, script type, with a parameter of timeRange, and a new context parameter of datastore of type VMWDatastore, required, not a list.  Set the output to a common:string.

add the following script:

qs = server.QueryService

query = "!VMWCluster where esxServers.datastores.uniqueId = '${datastore.uniqueId}'"

clusters = server.QueryService.queryTopologyObjects(query)

clusterNames = clusters?.collect{cluster-> cluster?.name}?.join(', ')

return clusterNames

you can then use this in your report, feeding it the context entry for the current line's datastore.

132 Posts

January 30th, 2013 13:00

VMWDatastores are associated with VMWESXServers, which are in turn associated with VMWDatastores, but not the other way around.

So, to find the VMWCluster(s) associated with a datastore, you would run a query something like this with the scope being the datastore in question:

#!VMWCluster where esxServers.datastores contains $scope#?.getTopologyObjects()?.getAt(0)?.name

January 30th, 2013 13:00

Thanks for reply, but can I drill down through current report from here and do this?

132 Posts

January 30th, 2013 13:00

Nope, that's something different, with a name designed to lure you in, before dashing your hopes

January 30th, 2013 14:00

Thanks again,

Any way you can break down these steps? You’re saying to create a whole new report? Sorry I’m new to vfoglight and learning.

So, to find the VMWCluster(s) associated with a datastore, you would run a query something like this with the scope being the datastore in question:

#!VMWCluster where esxServers.datastores contains $scope#?.getTopologyObjects()?.getAt(0)?.name

January 30th, 2013 17:00

Thanks and you’re saying do it via this correct?

132 Posts

January 30th, 2013 18:00

 

The function can be used as the source for a column on your report

January 30th, 2013 18:00

This is what I have. now how do I add it to the report? Do I edit the current report?

January 30th, 2013 18:00

OK I’m getting this…not sure what to put into them though.

January 30th, 2013 18:00

Ok so I think this is it? do I uncomment the specifictime range line like I did here?

January 30th, 2013 18:00

Thanks but this is my current report, are you saying I can go in and add this? Where do I drill down to so I can add it?

132 Posts

January 30th, 2013 18:00

that's the place, yes

January 30th, 2013 19:00

I’m so close, I just need to figure out where to drill down to.

132 Posts

January 30th, 2013 19:00

Ah..I should have asked before.  Apologies.

You can't use functions with drag and drop reports, it would have to be via a WCF report.

I'll check back a bit later, and help you with a simple WCF report.

January 31st, 2013 13:00

great I've never made a WCF and would like to know how. I use the drag and drop but I'm new to this. thanks!

No Events found!

Top