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
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
}
}
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"
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
}
}