Community'm wanting to run the script below, however when run got the following error in the output.
Please could you help me?
######## SCRIPT ##########
$hostesxi = Get-Content -Path "C:\Users\vsilva\Desktop\hostsinfo.csv"
$DiskID = Get-Content -Path "C:\Users\vsilva\Desktop\diskiops.csv"
Connect-VIServer -Server $hostesxi -User "myuser" -Password "mypassword"
### $esxcli.system.hostname.get() ###
$esxcli = Get-EsxCli -VMHost $hostesxi
$esxcli.storage.nmp.device.list() | where {$_.Device -match $DiskID}| % $esxcli.storage.nmp.psp.roundrobin.deviceconfig.set(0,$null,$_.Device,1,"iops",0)
------------------------------------------------------------------------------------------------------
######BUG OUT#######
Cannot find an overload for "set" and the argument count: "6".
At C:\Users\vsilva\Desktop\changeiops.ps1:9 char:1
+ $esxcli.storage.nmp.device.list() | where {$_.Device -match $DiskID}| % $esxcli. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Thank you all,
More could solve my problem report in a way that for me this exellent, shall be attached to the finalized script sharing with the community.
Bye.
:smileylaugh:
now I wonder how I can do to issue a report of information of all LUN IOPS of my environment?
Try the following snippet:
foreach ($h in (Get-VMHost)) {
$esxcli = Get-EsxCli -VMHost $h
$rrdisks = ($esxcli.storage.nmp.device.list() | ? {$_.PathSelectionPolicy -eq 'VMW_PSP_RR'})
$rrconfig = @()
foreach ($disk in $rrdisks) {
$rrconfig += $esxcli.storage.nmp.psp.roundrobin.deviceconfig.get($disk.Device)
}
$rrconfig | Select $h.Name, Device, LimitType, IOOperationLimit, ByteLimit | FT -autosize
}
Sample output:
esxhost01 | Device | LimitType IOOperationLimit ByteLimit | |
------------------------ ------ | --------- ---------------- --------- | ||
naa.6000e3b8ccef32630000000000085634 Bytes | 1000 | 8800 | |
naa.6000eb694cef45630000000000012389 Bytes | 1000 | 8800 |
esxhost02 | Device | LimitType IOOperationLimit ByteLimit | |
------------------------ ------ | --------- ---------------- --------- | ||
naa.6000e3b8ccef32630000000000085634 Bytes | 1000 | 8800 | |
naa.6000eb694cef45630000000000012389 Bytes | 1000 | 8800 |