VMware Cloud Community
orian
Hot Shot
Hot Shot
Jump to solution

Get Datastores Configuration Using VRO

Hello everyone Smiley Happy

Has anyone tried to retrieve information about datastores configuration using VRO?

I need to generate a report on all datastores in the VCenter that shows whether they are in Fixed \ Most Recently Used \ Round Robin multi path policy configuration.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Here is some sample code showing how to print multipath policy for all logical units in a host:

var lunits = host.config.storageDevice.multipathInfo.lun;

for each (var lun in lunits) {

  System.log(lun.policy.policy);

}

To get all the hosts related to a given datastore, use host scripting attribute of the datastore scripting object. Note that this attribute returns array of hosts, not a single host object.

View solution in original post

3 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Here is some sample code showing how to print multipath policy for all logical units in a host:

var lunits = host.config.storageDevice.multipathInfo.lun;

for each (var lun in lunits) {

  System.log(lun.policy.policy);

}

To get all the hosts related to a given datastore, use host scripting attribute of the datastore scripting object. Note that this attribute returns array of hosts, not a single host object.

orian
Hot Shot
Hot Shot
Jump to solution

Thank you Ilian!

0 Kudos
orian
Hot Shot
Hot Shot
Jump to solution

Hi,

Another small question ...
How can I get the name of the datastore of every multi path policy?

0 Kudos