scott.cardinal-

updated

14 years ago

0

185535

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.

  • john_s_main

    132 Posts

    346

    0

    Posted 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

    346

    0

    Posted 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

  • 346

    0

    Posted 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

    346

    0

    Posted January 30th, 2013 13:00

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

  • 346

    0

    Posted 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

  • 346

    0

    Posted January 30th, 2013 17:00

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

  • john_s_main

    132 Posts

    324

    0

    Posted January 30th, 2013 18:00

     
    

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

  • 324

    0

    Posted 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?

  • 346

    0

    Posted January 30th, 2013 18:00

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

  • 346

    0

    Posted January 30th, 2013 18:00

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