1 2 Previous Next 23 Replies Latest reply on Jan 26, 2020 6:53 PM by Narayanan_5245 Go to original post
      • 15. Re: Get HBA devices/paths list with Powercli
        bmmikee01 Lurker

        That did it, it seems to be running great now.  Thanks again! 

        • 16. Re: Get HBA devices/paths list with Powercli
          vin01 Hot Shot

          Hi LucD

           

          This works for me.. but here i need for cluster not for the single host  so what changes i should do for the below script  and also can we get lun name also..

           

          Get-VMHost  | %{

               $esxImpl = $_

               $esx = Get-View $esxImpl

               $esxImpl | Get-VMHostHba | %{

                    $hba = $_

                    Get-ScsiLun -Hba $hba | %{

                         $lun = $_

                         $row = "" | Select Host,HBA,Device

                         $row.Host = $esxImpl.Name

                         $row.HBA = $hba.Name

                         $row.Device = ($esx.Config.StorageDevice.ScsiLun | where{$_.Key -eq $lun.Key} ).DisplayName

                         $row

                    }

               }

          }

          Regards
          Vineeth.K
          • 17. Re: Get HBA devices/paths list with Powercli
            Greg86 Lurker

            Hi LucD,

             

            Sorry to bump an old thread but I really like this script but I was wondering how I could also get the LUN ID and the Capacity information as well.

            • 18. Re: Get HBA devices/paths list with Powercli
              chiaramontef Lurker

              Is there a way to get this to work with powerpath devices?  I can run the script fine on clusters that don't have powerpath, but when trying to run it against any cluster that has powerpath and I get this error over and over:

               

              Get-ScsiLun : 2/25/2018 12:02:30 PM    Get-ScsiLun        Value cannot be null.

              Parameter name: array

              At D:\scripts\frank\storage\test4.ps1:6 char:11

              +           Get-ScsiLun -Hba $hba | %{

              +           ~~~~~~~~~~~~~~~~~~~~~

                  + CategoryInfo          : NotSpecified: (:) [Get-ScsiLun], VimException

                  + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetScsiLun

               

              Thanks,

              • 19. Re: Get HBA devices/paths list with Powercli
                Narayanan_5245 Novice

                Hi LUCD,

                 

                Thanks for the script, if possible can  you help to guide how to include LUN path state and number of target/devices in the same script. as this need to get the storage path report all the hosts in the vCenter.

                 

                Regards

                Narayanan.

                • 20. Re: Get HBA devices/paths list with Powercli
                  LucD Guru
                  vExpertCommunity WarriorsUser Moderators

                  Not to sure how you want to display that in a report?

                  Targets is on the HBA level, while Paths is normally on the Device level.

                  Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                  • 21. Re: Get HBA devices/paths list with Powercli
                    Narayanan_5245 Novice

                    Apology for the delay reply. Exactly i am looking for Storage path pre-and post checks report (csv format) of ESX host & Storage activities on vCenter level.

                     

                    ESX host Name,HBA Adapter,Type,Status,Device,LUN, LUN NAA ID,Targets,LUN Path State (Active or Standby).

                     

                    Thanks in advance

                     

                    Regards

                    Narayanan.

                    • 22. Re: Get HBA devices/paths list with Powercli
                      LucD Guru
                      vExpertUser ModeratorsCommunity Warriors

                      That doesn't really answer my previous question.
                      Like I said earlier, I understand what you want to display, but how do you see the relation between LUN and path?

                       

                      Btw, what do you already have and what is missing from your script?

                      Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                      • 23. Re: Get HBA devices/paths list with Powercli
                        Narayanan_5245 Novice

                        Hi LuCD,

                         

                        Got the expected output using the below script lines which clearly gives the path state (Active or standby) and the vmbha runtime information.

                         

                        Get-VMHost -PipelineVariable esx | Get-ScsiLun -LunType disk -PipelineVariable lun | Get-ScsiLunPath |

                         

                         

                        Select @{N='ESX';E={$esx.Name}},

                         

                         

                            @{N='LUN';E={$lun.CanonicalName}},

                         

                         

                            LunPath,State | Export-Csv "C:\HBA1.csv" -NoTypeInformation -UseCulture

                         

                         

                        Thank you

                         

                        Regards

                        Narayanan.

                        1 2 Previous Next