Hello
I'm looking for a way to find all datastore clusters in a Vcenter Host without looping all datastores.
I didn't find any attribute or method returning this and the only way I found was looping the datastores while getting it's parent.
This script is an example of what I use now:
var storagePods = new Array();
var storagePodNames = new Array();
var datastores = new Array();
datastores = sdkConnection.getAllDatastores();
for (d in datastores)
{
if (datastores[d].parent.vimType == "StoragePod")
{
if (storagePodNames.indexOf(datastores[d].parent.name) <= -1)
{
storagePodNames.push(datastores[d].parent.name);
storagePods.push(datastores[d].parent);
}
}
}
There has to be a way to get this and I was hoping someone could show me the way how.
PowerCLI has a Cmdlet Get-DatastoreCluster to get all datastoreclusters, but I can't see the code it runs.
Vcenter server version: 5.0.0.0 Build 755629
Orchestrator version: 4.2.1 Build 555