VMware Aria Automation Orchestrator

 View Only

 Orchestrator - Get Datastore Clusters

Jump to  Best Answer
KevB's profile image
KevB posted Aug 29, 2024 10:47 AM

Hey everyone. Hoping someone can help me as I seem to be blind lol. I can't find a way to get the datastore clusters. I have the host clusters but I need to now get the datastore clusters. Thanks in advance...

KevB's profile image
KevB  Best Answer

Apparently it's considered a folder :).

This is how you can get them

VcPlugin.getAllDatastoreFolders()
Sravan_k's profile image
Sravan_k

if we are using REST or powerCLI

Get-DatastoreCluster | Select Name

KevB's profile image
KevB

Thanks for checking but this is how I was able to get them...

VcPlugin.getAllDatastoreFolders()
VMware-SimonSparks's profile image
Broadcom Employee VMware-SimonSparks

I have written a solution to this in TypeScript for the Aria Build Tools

https://github.com/vmware/build-tools-for-vmware-aria

    public VcStoragePodGetAll(): VcStoragePod[] {

        let arrVcStoragePod: VcStoragePod[] = this.serverFindAllForType<VcStoragePod>("VC:StoragePod");

        this.objLogger.info(`Found '${arrVcStoragePod.length}' VcStoragePod(s).`);

        arrVcStoragePod.forEach((objVcStoragePod: VcStoragePod): void => {

            let arrVcDatastore: VcDatastore[] = objVcStoragePod.childEntity as VcDatastore[];

            let objVcStoragePodSummary:VcStoragePodSummary = objVcStoragePod.summary;

            this.objLogger.info(`VcStoragePod Name = ${objVcStoragePod.name} has ${arrVcDatastore.length} datastores with a total capacity of ${objVcStoragePodSummary.capacity} and a free space of ${objVcStoragePodSummary.freeSpace}.`);
        });

        this.objLogger.info(`Returning '${arrVcStoragePod.length}' Combined VcStoragePod(s).`);

        return arrVcStoragePod;
    }