VMware Cloud Community
stuartgmilton
Enthusiast
Enthusiast
Jump to solution

Lists Datastores split by Cluster - possible?

Hi all,

I'm trying to list all datastores called *SWAP* but I'd like them split by Cluster.

Is this possible?  Or am I trying the wrong thing.

In effect our SWAP datastores are memory which can be allocated to VMs.  In effect I want a report that tells us how much memory is left on each cluster.

Cheers,
Stuart

0 Kudos
1 Solution

Accepted Solutions
stuartgmilton
Enthusiast
Enthusiast
Jump to solution

Accomplished this by using the following code.

foreach($cluster in Get-Cluster){

    Get-VMHost -Location $cluster | Get-Datastore | where {$_.name -like “*SWAP*”} | %{

    

Code goes in here

    }

}

View solution in original post

0 Kudos
2 Replies
jandraux
Contributor
Contributor
Jump to solution

So you have a datastore and named it SWAP okay.

Anyway check the vmware pubs docs: CLICK HERE

Once you're taken to that page click: "Create Datastore Cluster"

0 Kudos
stuartgmilton
Enthusiast
Enthusiast
Jump to solution

Accomplished this by using the following code.

foreach($cluster in Get-Cluster){

    Get-VMHost -Location $cluster | Get-Datastore | where {$_.name -like “*SWAP*”} | %{

    

Code goes in here

    }

}

0 Kudos