perttisaa
Contributor
Contributor

List DeviceMaxQueueDepth per cluster

Jump to solution

I'll try to list "DeviceMaxQueueDepth" per naa (in cluster).

I have vCenters, vCenter 6.0 with ESXi 6.0, vCenter 6.5 with ESXi 6.5 and vCenter 6.7 with ESXi 6.7.

This script works against ESXi 6.0 clusters but not 6.5 and 6.7.  Is it possible to have script that

works with all versions?

$clusterName = 'ClusterName'

foreach($esx in (Get-Cluster -Name $clusterName | Get-VMHost)){

$esxcli = Get-EsxCli -vmhost $esx -V2

$obj = $esxcli.storage.core.device.list.CreateArgs()

$obj.device = $_.DeviceName

$esxcli.storage.core.device.list.Invoke($obj) | Select Device, DeviceMaxQueueDepth

}

br, PeteS

1 Solution

Accepted Solutions
LucD
Leadership
Leadership

Since ESXi 6.0 the MaxQueueDepth is a property.

Not sure why you are doing it that way.

This seems to work for me

$clusterName = 'ClusterName'

foreach ($esx in (Get-Cluster -Name $clusterName | Get-VMHost)) {

    $esxcli = Get-EsxCli -vmhost $esx -V2

    $esxcli.storage.core.device.list.Invoke() |

    Select-Object @{N = 'VMHost'; E = { $esxcli.VMhost.Name } }, Device, DeviceMaxQueueDepth

}


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

View solution in original post

2 Replies
LucD
Leadership
Leadership

Since ESXi 6.0 the MaxQueueDepth is a property.

Not sure why you are doing it that way.

This seems to work for me

$clusterName = 'ClusterName'

foreach ($esx in (Get-Cluster -Name $clusterName | Get-VMHost)) {

    $esxcli = Get-EsxCli -vmhost $esx -V2

    $esxcli.storage.core.device.list.Invoke() |

    Select-Object @{N = 'VMHost'; E = { $esxcli.VMhost.Name } }, Device, DeviceMaxQueueDepth

}


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

View solution in original post

perttisaa
Contributor
Contributor

Thank's Luc!

0 Kudos