Hello,
I'm looking for a storage report encompassing my entire vcenter. I want datastores, but also anything not in a datastore, like RDMs or storage which has not been used or defined as a DS. I want ESX host installation boot drives, and everything. I figured that this would require pulling from each ESXi host but then I would get duplicates. I want Total Space, Used Space, Free Space. Kind of what is in the Summary tab for vCenter, but not just datastores. Not sure if a foreach loop would be necessary.
I tried using Bing, but there is no -ViewType called StorageDevice:
$storageDevices = Get-View -ViewType StorageDevice | Select-Object -ExpandProperty ScsiLun
$totalCapacity = ($storageDevices.Capacity.Block * $storageDevices.Count / 1TB)
$totalUsed = ($storageDevices.Capacity.Block - $storageDevices.FreeSpace.Block * $storageDevices.Count) / 1TB
$totalFree = ($storageDevices.FreeSpace.Block * $storageDevices.Count / 1TB)
Write-Host "Total Capacity: $totalCapacity TB"
Write-Host "Total Used: $totalUsed TB"
Write-Host "Total Free: $totalFree TB"
Any help would be appreciated.