what is the cmdlet to check on dead lun paths on a host?
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
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
thats awesome. thanks Lucd.
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
}