VMware Cloud Community
stuarty18742011
Contributor
Contributor

Script to List Datastore Multipath Policy and IOPS value


Guys,  looking for a script to list Multipath Policy and IOPS value for our datastores.  I can find many that will give me the mp policy but not the IOPS value.

Any help would be much appreciated...

Tags (2)
5 Replies
LucD
Leadership
Leadership

Which IOPS value did you have in mind ?

Do you mean to calculate it from the Realtime performance data, as I did in Get the maximum IOPS ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
stuarty18742011
Contributor
Contributor

Hey Luc,  I'm looking for the value that we have set on the datastore

We have an Active \ Active array so we set the mutipath to Round Robin, then set to IOPS=1

as per this article...

VMware KB: Adjusting Round Robin IOPS limit from default 1000 to 1

0 Kudos
LucD
Leadership
Leadership

Try like this

foreach($esx in Get-VMHost){

    $esxcli = Get-EsxCli -VMHost $esx

    $esxcli.storage.nmp.device.list() |

    Select @{N='VMHost';E={$esx.Name}},Device,

        @{N='PathPolicy';E={($_.PathSelectionPolicyDeviceConfig | Select-String -Pattern 'policy=(?<policy>\w+),' -AllMatches).Matches.Groups[1].Value}},

        @{N='IOPS';E={($_.PathSelectionPolicyDeviceConfig | Select-String -Pattern 'iops=(?<iops>\d+),' -AllMatches).Matches.Groups[1].Value}}

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

stuarty18742011
Contributor
Contributor

Perfect LucD... this is exactly what I'm looking for ...

0 Kudos
VijayKumarMyada
Enthusiast
Enthusiast

in this script how to add Datacenter name, host connected to list of datastores, and host is in which cluster.

0 Kudos