RAJESH3311
Enthusiast
Enthusiast

PowerCli to get HBA Firmware details

Jump to solution

Dear,

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

Regards

Rajesh

1 Solution

Accepted Solutions
LucD
Leadership
Leadership

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


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

View solution in original post

0 Kudos
21 Replies
LucD
Leadership
Leadership
0 Kudos
RAJESH3311
Enthusiast
Enthusiast

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

0 Kudos
LucD
Leadership
Leadership

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


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

0 Kudos
RAJESH3311
Enthusiast
Enthusiast

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

0 Kudos
RAJESH3311
Enthusiast
Enthusiast

Dear,

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

Regards

Rajesh

0 Kudos
LucD
Leadership
Leadership

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.


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

0 Kudos
RAJESH3311
Enthusiast
Enthusiast

Dear,

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

Regards

Rajesh

0 Kudos
LucD
Leadership
Leadership

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

    }

}


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

0 Kudos
RAJESH3311
Enthusiast
Enthusiast

Dear,

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

Regards

Rajesh

0 Kudos
LucD
Leadership
Leadership

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


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

0 Kudos
RAJESH3311
Enthusiast
Enthusiast

Dear ,

Output for the script is attached. Please check.

Regards

Rajesh

0 Kudos
LucD
Leadership
Leadership

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


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

0 Kudos
RAJESH3311
Enthusiast
Enthusiast

Excellent.

I got the required details.

Regards

Rajesh

0 Kudos
ryanhulce
Contributor
Contributor

You are a genius!

0 Kudos
touimet
Enthusiast
Enthusiast

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

LucD
Leadership
Leadership

Afaik, not at this point in time.

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


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

bvinnu
Contributor
Contributor

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-c05331...

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/64...

LucD
Leadership
Leadership

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""')


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

0 Kudos
hussainbte
Expert
Expert

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

If you found my answers useful please consider marking them as Correct OR Helpful Regards, Hussain https://virtualcubes.wordpress.com/
0 Kudos