Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

PowerCli DataStore Audit?

$
0
0

Hello,

 

I was wondering if someone could help me with a script.  I need to do an audit of our datastores with capacity, provisioned, and available.  I did find a snippet of code which returns the information I need, but is there a way to indicate which cluster these DataStores are assigned to?

 

Here is the code I'm using.

 

 

$report
= @() get-datastore
| % { 
$info = "" | select DataCenter, Name, Capacity, Provisioned, Available 
$info.Datacenter = $_.Datacenter 
$info.Name = $_.Name 
$info.Capacity = [math]::Round($_.capacityMB/1024,2) 
$info.Provisioned = [math]::Round(($_.ExtensionData.Summary.Capacity - $_.ExtensionData.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted)/1GB,2) 
$info.Available = [math]::Round($info.Capacity - $info.Provisioned,2) 
$report += $info }#$report | sort Available | format-table –auto

 

Ideally I'd like to have a spreadsheet with a seperate worksheet for each Cluster, but having a single sheet with all datastores and their cluster would be fine as well.

 

Thx


Viewing all articles
Browse latest Browse all 175326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>