Automation

 View Only
  • 1.  List DeviceMaxQueueDepth per cluster

    Posted Mar 24, 2020 01:53 PM

    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



  • 2.  RE: List DeviceMaxQueueDepth per cluster
    Best Answer

    Posted Mar 24, 2020 02:25 PM

    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

    }



  • 3.  RE: List DeviceMaxQueueDepth per cluster

    Posted Mar 24, 2020 02:29 PM

    Thank's Luc!