VMware Cloud Community
bairstowscott
Contributor
Contributor
Jump to solution

collect storage target info

Hi

Is it possible to collect the target wwn info for example 10:11:01:60:c7:20:0b:11 of the datastores attached to the host?

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try something like this

foreach($esx in Get-VMHost){
 
foreach($lun in (Get-ScsiLun -VmHost $esx -LunType disk)){
   
Get-ScsiLunPath -ScsiLun $lun |
   
Select @{N="RuntimeName";E={$lun.RuntimeName}},
   
@{N="LUN";E={$lun.lunID}},
   
@{N="CanonicalName";E={$lun.CanonicalName}},
   
@{N="Target WWN";E={$_.SanId}}
  }
}


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

View solution in original post

Reply
0 Kudos
2 Replies
bairstowscott
Contributor
Contributor
Jump to solution

This highlighted number is what I want

Capture.PNG

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Try something like this

foreach($esx in Get-VMHost){
 
foreach($lun in (Get-ScsiLun -VmHost $esx -LunType disk)){
   
Get-ScsiLunPath -ScsiLun $lun |
   
Select @{N="RuntimeName";E={$lun.RuntimeName}},
   
@{N="LUN";E={$lun.lunID}},
   
@{N="CanonicalName";E={$lun.CanonicalName}},
   
@{N="Target WWN";E={$_.SanId}}
  }
}


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

Reply
0 Kudos