Automation

 View Only
Expand all | Collapse all

PowerCli to get HBA Firmware details

  • 1.  PowerCli to get HBA Firmware details

    Posted May 10, 2015 05:46 AM

    Dear,

    Kindly share a PowerCLI script to find out the Fiber Channel HBA Firmware Version, Driver Version, BIOS version and FCODE version.

    Regards

    Rajesh



  • 2.  RE: PowerCli to get HBA Firmware details

    Posted May 10, 2015 07:35 AM


  • 3.  RE: PowerCli to get HBA Firmware details

    Posted May 10, 2015 10:42 AM

    Dear,

    Really appriciate your efforts.

    Is there any way to get the details as you can see the attachment. We have a requirement to have something like this.

    VMHost, HBA, HBA Model, FC Firmware Version, , FC Driver Version, BIOS Version, FCODE Version.

    Regards

    Rajesh



  • 4.  RE: PowerCli to get HBA Firmware details

    Posted May 10, 2015 11:29 AM

    Did you actually try the script I pointed to ?

    As far as I can tell, it has all that information.

    If not, let me know which info is missing



  • 5.  RE: PowerCli to get HBA Firmware details

    Posted May 11, 2015 04:58 AM

    Dear,

    Appricite your efforts.

    I have run the script and found all the details inside. Is there any way to have the details in a table format so that it is easy to have in exel.

    Thanks

    Rajesh



  • 6.  RE: PowerCli to get HBA Firmware details

    Posted May 11, 2015 05:39 AM

    Dear,

    Adding to that, my HBA is QLogic, but the script output shows Broadcom. Could you please check the attachments ?

    Regards

    Rajesh



  • 7.  RE: PowerCli to get HBA Firmware details

    Posted May 11, 2015 06:56 AM

    To save the result to a CSV file, you can use the Export-Csv cmdlet.

    Something like this

    $report = Get-Datacenter | % {   

          $datacenter=$_ 

          foreach($esx in Get-VMhost -Location $datacenter){ 

            $esxcli = Get-EsxCli -VMHost $esx 

            $nic = Get-VMHostNetworkAdapter -VMHost $esx | Select -First 1 | select -ExpandProperty Name 

            $hba =Get-VMHostHBA -VMHost $esx -Type FibreChannel | where {$_.Status -eq "online"} |  Select -First 1 |select -ExpandProperty Name 

            Get-VMHostHBA -VMHost $esx -Type FibreChannel | where {$_.Status -eq "online"} | 

            Select @{N="Datacenter";E={$datacenter.Name}}, 

                    @{N="VMHost";E={$esx.Name}}, 

                    @{N="HostName";E={$($_.VMHost | Get-VMHostNetwork).HostName}}, 

                    @{N="version";E={$esx.version}}, 

                    @{N="Manufacturer";E={$esx.Manufacturer}}, 

                    @{N="Hostmodel";E={$esx.Model}}, 

                    @{Name="SerialNumber";Expression={$esx.ExtensionData.Hardware.SystemInfo.OtherIdentifyingInfo |Where-Object {$_.IdentifierType.Key -eq "Servicetag"} |Select-Object -ExpandProperty IdentifierValue}}, 

                    @{N="Cluster";E=

                        if($esx.ExtensionData.Parent.Type -ne "ClusterComputeResource"){"Stand alone host"

                        else

                            Get-view -Id $esx.ExtensionData.Parent | Select -ExpandProperty Name 

                        }}}, 

                    Device,Model,Status, 

                    @{N="WWPN";E={((("{0:X}"-f $_.NodeWorldWideName).ToLower()) -replace "(\w{2})",'$1:').TrimEnd(':')}}, 

                    @{N="WWN";E={((("{0:X}"-f $_.PortWorldWideName).ToLower()) -replace "(\w{2})",'$1:').TrimEnd(':')}}, 

                  # @{N="Fnicvendor";E={$esxcli.software.vib.list() | ? {$_.Name -match ".*$($hba.hbadriver).*"} | Select -First 1 -Expand Vendor}}, 

                    @{N="Fnicvendor";E={$esxcli.hardware.pci.list() | where {$hba -contains $_.VMKernelName} |Select -ExpandProperty VendorName }}, 

                    @{N="fnicdriver";E={$esxcli.system.module.get("fnic").version}}, 

                    @{N="enicdriver";E={$esxcli.system.module.get("enic").version}}, 

                   # @{N="Enicvendor";E={$esxcli.software.vib.list() | ? {$_.Name -match ".net.*"} | Select -First 1 -Expand Vendor}} 

                     @{N="Enicvendor";E={$esxcli.hardware.pci.list() | where {$nic -contains $_.VMKernelName} |Select -ExpandProperty VendorName }} 

                     #@{N="Enicvendor";E={$esxcli.network.nic.list() | where {$vmnic.name -eq $_.vmnic1} | select -First 1 -ExpandProperty Description }} 

          } 

    }

    $report | Export-Csv report.csv -NoTypeInformation -UseCulture



    Last year QLogic acquired some of the Broadcom ethernet assets.

    I suspect you might be seeing the driver provided vendor and the card manufacturer.



  • 8.  RE: PowerCli to get HBA Firmware details

    Posted May 11, 2015 07:51 AM

    Dear,

    Worked fine for the excel, but the Driver version filed found empty, Could you please check the attachment and advice.

    Regards

    Rajesh



  • 9.  RE: PowerCli to get HBA Firmware details

    Posted May 11, 2015 03:02 PM

    Did you replace 'fnic' and 'enic' with the modules you have on your HW ?

    Run the following to get an overview of what PCI devices are present, and to get the correct names.

    $esxName = 'MyEsx'

    $esxcli = Get-EsxCli -VMHost $esxName

    foreach($dev in $esxcli.hardware.pci.list()){

        if($dev.ModuleName -ne 'None'){

            $esxcli.system.module.get($dev.ModuleName) |

            Select @{N='Device';E={$dev.DeviceName}},@{N='DeviceClass';E={$dev.DeviceClassName}},Module,Version

        }

    }



  • 10.  RE: PowerCli to get HBA Firmware details

    Posted May 12, 2015 04:26 AM

    Dear,

    Please find the attched. I have run the script exactly on Vcenter without making any changes.

    Regards

    Rajesh



  • 11.  RE: PowerCli to get HBA Firmware details

    Posted May 12, 2015 05:11 AM

    You will have to change 'MyEsx' with the name of your ESXi host/



  • 12.  RE: PowerCli to get HBA Firmware details

    Posted May 12, 2015 08:08 AM

    Dear ,

    Output for the script is attached. Please check.

    Regards

    Rajesh



  • 13.  RE: PowerCli to get HBA Firmware details
    Best Answer

    Posted May 12, 2015 09:12 AM

    Based on that output it looks like you need replace the enic and fnic with elxnet and qlnativefc.



  • 14.  RE: PowerCli to get HBA Firmware details

    Posted May 12, 2015 09:38 AM

    Excellent.

    I got the required details.

    Regards

    Rajesh



  • 15.  RE: PowerCli to get HBA Firmware details

    Posted Jun 04, 2015 03:38 PM

    You are a genius!



  • 16.  RE: PowerCli to get HBA Firmware details

    Posted Mar 25, 2016 02:10 PM

    Luc, once again great script!!  However one critical piece of information that is missing is the firmware version of the HBA.

    I know I can get the firmware via SSH by using the following methods:


    ##  Brocade (BR-xxx)  ##

    cd /proc/scsi/bfa

    ls -h

    cat # | grep Version

    ##  Qlogic & Emulex  ##

    /usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -a | more

    Is there anyway via PowerCli (maybe $esxcli.xxxx ???) to obtain the HBA firmware versions without the use of plink?

    Thanks!!!



  • 17.  RE: PowerCli to get HBA Firmware details

    Posted Mar 25, 2016 02:40 PM

    Afaik, not at this point in time.

    The only way I know is through the use of plink.exe (SSH) I'm afraid.



  • 18.  RE: PowerCli to get HBA Firmware details

    Posted Oct 16, 2017 04:09 PM

    looking for guidance on powercli one-liner for retrieving the HBA firmware version ..it can be retrieved from ESxi shell # esxcli –server=”servername or IP” –user=”username” –password”root password” ssacli cmd -q “controller slot=0 show config detail”

    Source reference : https://support.hpe.com/hpsc/doc/public/display?sp4ts.oid=420496&docLocale=en_US&docId=emr_na-c05331132

    Another source below  shows he is close to get it , but I m even struck too not able to get the output with powercli #$esxcli.ssacli.cmd('"-q "controller all show status""')

    https://community.hpe.com/t5/Operating-System-VMware/Problems-using-Get-ESXCLI-with-HPSSACLI/td-p/6412828



  • 19.  RE: PowerCli to get HBA Firmware details

    Posted Oct 16, 2017 05:24 PM

    Did you try like this?

    If that doesn't work, I advise to ask the question on the HP forum, this is a HP extension, nothing to do with PowerCLI

    $esxcli = Get-EsxCli -VMHost MyEsx

    $esxcli.hpssacli.cmd('"-q "controller slot=0 show config detail""')



  • 20.  RE: PowerCli to get HBA Firmware details

    Posted Mar 04, 2020 07:02 AM

    This is providing only the driver version, have any of you guys used this to get firmware version of the HBA?



  • 21.  RE: PowerCli to get HBA Firmware details

    Posted Mar 04, 2020 07:26 AM

    Have you tried the solution in Re: Host firmware, hba driver, NIC version etc,

    It does require SSH access to each ESXi node.



  • 22.  RE: PowerCli to get HBA Firmware details

    Posted Dec 02, 2021 10:29 PM

     , Can you please help me on rearranging this output:

    I am getting the result 2 times as below. Not sure what parameter can be changed in the script to avoid the repetition. I have rearranged the script just for showing the output only fnic and enic. But getting the result as below.

    NeenaJim_0-1638484032029.png

    PS C:\Scripts> Get-Datacenter | % {
    $datacenter=$_
    foreach($esx in Get-VMhost -Location $datacenter){
    $esxcli = Get-EsxCli -VMHost $esx
    $nic = Get-VMHostNetworkAdapter -VMHost $esx | Select -First 1 | select -ExpandProperty Name
    $hba =Get-VMHostHBA -VMHost $esx -Type FibreChannel | where {$_.Status -eq "online"} | Select -First 1 |select -ExpandProperty Name
    Get-VMHostHBA -VMHost $esx -Type FibreChannel | where {$_.Status -eq "online"} |
    Select @{N="HostName";E={$($_.VMHost | Get-VMHostNetwork).HostName}},
    @{N="fnicdriver";E={$esxcli.system.module.get("nfnic").version}},
    @{N="enicdriver";E={$esxcli.system.module.get("nenic").version}}
    }
    }