VMware Cloud Community
vinivirtus
Enthusiast
Enthusiast
Jump to solution

Error in script execution PowerCLI change IOPS

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

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
vinivirtus
Enthusiast
Enthusiast
Jump to solution

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:

View solution in original post

0 Kudos
3 Replies
vinivirtus
Enthusiast
Enthusiast
Jump to solution

Vmware community

managed to solve the problem, follow the attached script I am using, however now I wonder how I can do to issue a report of information of all LUN IOPS of my environment?

Anyone know how it can be done because I'm hours searching Google and nothing.

0 Kudos
MKguy
Virtuoso
Virtuoso
Jump to solution

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
-- http://alpacapowered.wordpress.com
vinivirtus
Enthusiast
Enthusiast
Jump to solution

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:

0 Kudos