VMware Cloud Community
tdubb123
Expert
Expert
Jump to solution

command to find dead lun paths

what is the cmdlet to check on dead lun paths on a host?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try like this.

If you leave out the Where-clause, you'll get the state of all paths.

Get-VMHost | % {

     $server = $_

      ($_ | Get-View).config.storagedevice.multipathinfo.Lun | %{$_.Path} | `

      select Name, PathState | `

      where {$_.PathState -eq "dead"} | `

      Add-Member -PassThru NoteProperty Server $Server.Name | `

      Select Server, Name, PathState

}


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

View solution in original post

3 Replies
LucD
Leadership
Leadership
Jump to solution

Try like this.

If you leave out the Where-clause, you'll get the state of all paths.

Get-VMHost | % {

     $server = $_

      ($_ | Get-View).config.storagedevice.multipathinfo.Lun | %{$_.Path} | `

      select Name, PathState | `

      where {$_.PathState -eq "dead"} | `

      Add-Member -PassThru NoteProperty Server $Server.Name | `

      Select Server, Name, PathState

}


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

tdubb123
Expert
Expert
Jump to solution

thats awesome. thanks Lucd.

0 Kudos
tdubb123
Expert
Expert
Jump to solution

hi Luc

couldnt you have done this instead?

Get-VMHost | % {

      ($_ | Get-View).config.storagedevice.multipathinfo.Lun | %{$_.Path} | `

      select Name, PathState | `

      where {$_.PathState -eq "dead"} | `

      Add-Member -PassThru NoteProperty Server $_.Name | `

      Select Server, Name, PathState

}



0 Kudos