VMware Cloud Community
jedijeff
Enthusiast
Enthusiast
Jump to solution

Trying to find Number active paths per Lun

I am trying to find the number of active paths to just a single Lun, for monitoring whether I had a fiber connection go down. I keep getting boxed in a corner, because at first just using a Get-view of a host and fish around in the multipathsection. But really I want to simply test 1 Lun on all my hosts to see how many active paths each host has to it. And it appears any of the Get-ScsiXX commands you cannot specify a single lun.

Am I getting confused somewhere?

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Did you try it like this

$canonicalname = "naa.600507540180809ef0000000000001ba" 
$esx = Get-VMHost -Name MyEsx
Get-ScsiLun
-VMHost $esx -CanonicalName $canonicalname |
Select
CanonicalName,
  @
{N="Active Paths";E={Get-ScsiLunPath -ScsiLun $_ | where {$_.State -eq "active"} |  Measure-Object | Select -ExpandProperty Count}}


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

View solution in original post

3 Replies
LucD
Leadership
Leadership
Jump to solution

Did you try it like this

$canonicalname = "naa.600507540180809ef0000000000001ba" 
$esx = Get-VMHost -Name MyEsx
Get-ScsiLun
-VMHost $esx -CanonicalName $canonicalname |
Select
CanonicalName,
  @
{N="Active Paths";E={Get-ScsiLunPath -ScsiLun $_ | where {$_.State -eq "active"} |  Measure-Object | Select -ExpandProperty Count}}


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

jedijeff
Enthusiast
Enthusiast
Jump to solution

aha! Yes I bet that will work. I was trying to figure out how to do this with naa ID. Let me try this first thing in the morning, I will post back.

0 Kudos
jedijeff
Enthusiast
Enthusiast
Jump to solution

Tested. Works great!

0 Kudos