Skip to content

Instantly share code, notes, and snippets.

@jbfriedrich
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbfriedrich/48fdf25bc4516f4a235e to your computer and use it in GitHub Desktop.
Save jbfriedrich/48fdf25bc4516f4a235e to your computer and use it in GitHub Desktop.
Powershell script to create a list with read and write IOPS for every Virtual Machine (average and peak values)
##
# Get a list with average and peak IOPS from all VMs
# Found at: https://www.linkedin.com/grp/post/3992597-5937675088978534402
##
Get-VM | Sort | Select @{N="Name"; E={$_.Name}}, @{N="AvgWriteIOPS"; E={[math]::round((Get-Stat $_ -stat "datastore.numberWriteAveraged.average" -RealTime | Select -Expand Value | measure -average).Average, 1)}}, @{N="PeakWriteIOPS"; E={[math]::round((Get-Stat $_ -stat "datastore.numberWriteAveraged.average" -RealTime | Select -Expand Value | measure -max).maximum, 1)}}, @{N="AvgReadIOPS"; E={[math]::round((Get-Stat $_ -stat "datastore.numberReadAveraged.average" -RealTime | Select -Expand Value | measure -average).Average, 1)}}, @{N="PeakReadIOPS"; E={[math]::round((Get-Stat $_ -stat "datastore.numberReadAveraged.average" -RealTime | Select-Expand Value | measure -max).maximum, 1)}} | Format-Table -autosize | Out-File iops.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment