Created
February 19, 2017 09:19
-
-
Save simonjgreen/6faab430add6e418c979ed2efb126103 to your computer and use it in GitHub Desktop.
PowerCLI filter for retrieving VMDKs and their associated IOPS Limits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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