tdubb123
Expert
Expert

command to find dead lun paths

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

Reply
0 Kudos
LucD
Leadership
Leadership

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

tdubb123
Expert
Expert

thats awesome. thanks Lucd.

Reply
0 Kudos
tdubb123
Expert
Expert

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

}



Reply
0 Kudos