I have seen several examples of generating a report that list the CapacityTB and FreeSpaceTB for a individual Datastores within a DataStoreCluster, but I cannot determine how to just generate:
1. The total CapacityTB of a data store cluster
2. The total FreeSpaceTB of a data store cluster
3. Determine a Provisioned % of a data store cluster, e.g FreeSpaceTB / CapacityTB
I had been using an example that Lucd posted and lightly modified:
foreach ($vc in $VIServer) {
Get-DatastoreCluster -Server $vc |
Select @{N = 'vCenter'; E = {$vc.Name}},
@{N = 'Datacenter'; E = {(Get-Datastore -RelatedObject $_ | select -First 1).Datacenter.Name}},
@{N = 'DSC'; E = {"some DataStoreCluster"}},
CapacityGB,
@{N = 'FreespaceTB'; E = {[math]::Round($_.FreespaceTB, 2)}},
@{N = 'Freespace%'; E = {[math]::Round($_.FreespaceTB / $_.CapacityTB * 100, 1)}},
@{N = 'ProvisionedSpaceTB'; E = {
[math]::Round(($_.ExtensionData.Summary.Capacity - $_.Extensiondata.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted) / 1TB, 2)}
},
@{N = 'UnCommittedTB'; E = {[math]::Round($_.ExtensionData.Summary.Uncommitted / 1TB, 2)}},
@{N = 'VM'; E = {((Get-View -Id $_.ExtensionData.ChildEntity).VM.Count | Measure-Object -Sum).Sum}}
}
But it only returns individual DataStores, when I what I really want is to see total for the DataStoreCluster.
I would really love to just limit it to the DataStoreClusters within a specific Cluster of the DataCenter. I'm exhausted my very limited PowerShell skills.