Total Storage Available for Cluster

This post was originally published on this site

Hi All,


I’m trying to retrieve the Total storage available for all Cluster available in the vCenter. Below script retrieve only for one cluster i.e. Cluster1.

I need help to retrieve the Total Storage and available storage value for all the cluster instead of one specific “Cluster 1” value. is it possible to retrieve for all the Cluster in vCenter from Power Cli ?


Import-Module VMware.VimAutomation.Core

Connect-VIServer -Server 10.1x.y.z -user "mydomainusername"


$date = Get-Date


$datastore = Get-Cluster -Name Cluster1 | Get-Datastore | Where-Object {$_.Type -eq 'VMFS' -and $_.Extensiondata.Summary.MultipleHostAccess}


$TotalStorage = ($datastore | Measure-Object -Property CapacityMB -Sum).Sum / 1024

$AvailableStorage = ($datastore | Measure-Object -Property FreeSpaceMB -Sum).Sum / 1024


$endpoint = ""

$payload = @{

"Date" = $Date

"Total Storage" = $TotalStorage

"Available Storage" = $AvailableStorage


Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))


Disconnect-VIServer * -Confirm:$false

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.