Skip to content

Instantly share code, notes, and snippets.

@simonjgreen
Created February 19, 2017 09:19
Show Gist options
  • Save simonjgreen/6faab430add6e418c979ed2efb126103 to your computer and use it in GitHub Desktop.
Save simonjgreen/6faab430add6e418c979ed2efb126103 to your computer and use it in GitHub Desktop.
PowerCLI filter for retrieving VMDKs and their associated IOPS Limits
filter Get-IOPSLimit {
$_ | % {
$VmHdds = Get-HardDisk -VM $_.Name | select Name, ExtensionData, Filename, CapacityKB
foreach ($VmHdd in $VmHdds) {
$row = "" | select VmName, HddName, ScsiID, Datastore, CapacityGB, CurrentIOLimit
$row.VmName = $_.Name
$row.HddName = $VmHdd.Name
$row.ScsiID = $([string]$VmHdd.extensiondata.controllerkey).substring(3,1) +":"+ $([string]$VmHdd.extensiondata.unitnumber)
$row.Datastore = $($VmHdd.Filename.TrimStart("[")).split("]")[0]
$row.CapacityGB = $VmHdd.capacitykb / 1024 / 1024
$row.CurrentIOlimit = $VmHdd.ExtensionData.StorageIOAllocation.limit
$row
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment