This post is more than 5 years old
49 Posts
0
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.
No Events found!



john_s_main
132 Posts
0
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.
john_s_main
132 Posts
0
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
scott.cardinal-
49 Posts
0
January 30th, 2013 13:00
Thanks for reply, but can I drill down through current report from here and do this?
john_s_main
132 Posts
0
January 30th, 2013 13:00
Nope, that's something different, with a name designed to lure you in, before dashing your hopes
scott.cardinal-
49 Posts
0
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
scott.cardinal-
49 Posts
0
January 30th, 2013 17:00
Thanks and you’re saying do it via this correct?
john_s_main
132 Posts
0
January 30th, 2013 18:00
The function can be used as the source for a column on your report
scott.cardinal-
49 Posts
0
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?
scott.cardinal-
49 Posts
0
January 30th, 2013 18:00
OK I’m getting this…not sure what to put into them though.
scott.cardinal-
49 Posts
0
January 30th, 2013 18:00
Ok so I think this is it? do I uncomment the specifictime range line like I did here?
scott.cardinal-
49 Posts
0
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?
john_s_main
132 Posts
0
January 30th, 2013 18:00
that's the place, yes
scott.cardinal-
49 Posts
0
January 30th, 2013 19:00
I’m so close, I just need to figure out where to drill down to.
john_s_main
132 Posts
0
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.
scott.cardinal-
49 Posts
0
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!