I'm trying to determine how many devices are attached to each host in my environment. When I call (get-scsilun -vmhost XXX).count on a 4.1 host, it takes around 4 seconds to complete. When I make the same call against a 5.1 host, it takes around 74 seconds. What can I do to improve my 5.1 host calls?
Thanks!
Yes, the Get-ScsiLun cmdlet tends to be a bit slow.
An alternative is to use the Get-EsxCli cmdlet.
Something like this
$esxcli = Get-EsxCli -VMHost MyEsx
$esxcli.storage.core.device.list() | Measure-Object | Select -expandproperty count
That should give the same result, but a lot faster
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes, the Get-ScsiLun cmdlet tends to be a bit slow.
An alternative is to use the Get-EsxCli cmdlet.
Something like this
$esxcli = Get-EsxCli -VMHost MyEsx
$esxcli.storage.core.device.list() | Measure-Object | Select -expandproperty count
That should give the same result, but a lot faster
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference