Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 178304

get Datastore Overprovisioned% in percentage

$
0
0

Hi,

 

I try to generate a report where I can see the overprovisioned in percentage. but the math does not work. Can someone help me out here?

 

 

$dsrz1 = get-datastore | where-object {$_.name -match “RZ1_”} | get-view

$dsrz1rreport = @()

foreach($ds1 in $dsrz1){

   

  $ds1 = $dsrz1 | select -expandproperty summary | select name,

@{N=”Capacity (GB)”; E={[math]::round($_.Capacity/1GB,2)}},

@{N=”FreeSpace (GB)”;E={[math]::round($_.FreeSpace/1GB,2)}},

@{N='Overprovisioned%';E={[math]::Round(100/$_.Capacity*$_.ProvisionedSpaceGB,1)}},

@{N='Freespace%';E={[math]::Round($_.Freespace/$_.Capacity*100,1)}},

@{N=”Provisioned (GB)”; E={[math]::round(($_.Capacity – $_.FreeSpace + $_.Uncommitted)/1GB,2) }}| sort -Property Name

 

    $dsrz1rreport += $ds1

       

      

}

$dsrz1rreport


Viewing all articles
Browse latest Browse all 178304

Trending Articles



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