Automation

 View Only
  • 1.  collect storage target info

    Posted May 17, 2013 03:52 AM

    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?



  • 2.  RE: collect storage target info

    Posted May 17, 2013 04:26 AM

    This highlighted number is what I want



  • 3.  RE: collect storage target info
    Best Answer

    Posted May 17, 2013 05:36 AM

    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}}
      }
    }