Skip to content

PowerCLI Script to get ESXi Network/Storage Firmware and Driver Version

For a healthy vSphere virtualization infrastructure and to receive support from VMware it is important to verify that IO devices are listed in VMwares Compatibility Guide/Hardware Compatibility List (HCL) with their correct driver and firmware version. Gathering firmware details and comparing them to the HCL is very time-consuming. I made a small script that automatically gathers the following information:

  • IO Devices (NICs, HBAs and RAID Controllers)
  • Driver Version
  • Firmware Version
  • Official HCL Link

Download: io-devices-report.ps1 (Hosted at GitHub)

Usage:

  1. Get PowerCLI 6.3 R1 or later
  2. Change the device scope (Line 13) to the desired value.

    Example:
    $device = Get-VMHost esx01.virten.lab - Check a single Host
    $device = Get-Cluster NUCluster | Get-VMHost - Checks all hosts in a cluster
    $device = Get-VMHost - Checks all hosts in the vCenter
  3. Connect to a vCenter Server
    PS> Connect-VIServer vc.virten.lab
  4. Optional: Change the output format (Line 91-108). CSV and HTML output is active by default.
  5. Run the script
  6. Verify the output with the provided links.

Additional Information

  • The runtime is about 20-40 seconds per host.
  • The script downloads my JSON-based IOHCL (1.4 MB).
  • The "Supported" attribute only states that is device has been found in the HCL. You still have to check ESXi version and Firmware/Driver version.
  • The script uses Get-EsxCli -V2 which requires at least PowerCLI 6.3 R1
  • QLogic and Emulex firmware can only be identified with SSH as explained here. If you know a workaround, please comment.
  • If you found any issues, feel free to comment and I will try to provide a fix.

Example Output

18 thoughts on “PowerCLI Script to get ESXi Network/Storage Firmware and Driver Version”

  1. Thank you, first of all.
    I have been trying to get QLogic/Emulex HBA firmware versions. It seems this information cannot be retrieved. Only through SSH.
    Your script doesn't retrieve this information either.
    Any idea?
    Thanks.

  2. The various device IDs in the JSON file are zero padded. Device lookup will fail for some devices because you don't zero pad in the conversions on lines 34-37.

    Something like: $Info.vid = [String]::Format("{0:x4}", $device.VendorId)

      1. Also need to move the "$esxcli =" at line 49 outside the "if" at line 47. Otherwise $esxcli is potentially NULL in the "elseif" branch in lines 80 and 82.

        1. I've also found that I have a MegaRAID controller that has a driver named "lsi_mr3" but the VIB has lsi-mr3 in the name and thus no VIB is found. Thus $driverVib at line 86 is from the previous iteration of the loop and not blank as expected.

  3. Hi, Firstly great script, thank you

    Is the error related to JPA's comment is fixed?
    "I've also found that I have a MegaRAID controller that has a driver named "lsi_mr3" but the VIB has lsi-mr3 in the name and thus no VIB is found. Thus $driverVib at line 86 is from the previous iteration of the loop and not blank as expected."

    I am having the same issue, PERC details are not fetched.

    Message: [NoMatchError];
    InnerText: [NoMatchError] No VIB matching VIB search specification 'lsi_mr3'.
    Please refer to the log file for more details.EsxCLI.CLIFault.summary

    Message: [NoMatchError];
    InnerText: [NoMatchError] No VIB matching VIB search specification
    'megaraid_perc9'. Please refer to the log file for more
    details.EsxCLI.CLIFault.summary

  4. The way to get LPFC is with this
    $esxcli.Storage.san.fc.list.Invoke() |
    select @{N = 'HostName'; E = {$esxcli.VMHost.Name}},

    I try to figure out the way to fit in the report.

  5. Hi,

    I found this script on one of the online forums, but first you have to have PowerCli 6.5 or later.

    1- Start PowerCli.

    2- Connect to your vCenter using Connect-VIServer command.

    3- Copy the below script to a notepad file and then rename it to .ps1

    4- From the PowerCli shell, go to the destination of your ps1 script and then execute.

    This script has exported HBA and VNICs firmware and driver versions info for all of my HPE ESXI hosts.

    If you want specific cluster or specific host, change the first line of the script with one of the following;

    Example:
    $vmhosts = Get-VMHost fqdn-of-your-esxihost - Check a single Host
    $vmhosts = Get-Cluster you-cluster-name | Get-VMHost - Checks all hosts in a cluster
    $vmhosts = Get-VMHost - Checks all hosts in the vCenter

    Script is below:

    ################################################

    $vmhosts = Get-VMHost

    $report = @()

    foreach ($ESXHost in $vmhosts) {

    $esxcli = Get-EsxCli -vmhost $ESXHost

    $nicfirmware = $esxcli.network.nic.list()

    $fcfirmware = $esxcli.storage.san.fc.list()

    $driversoft = $esxcli.software.vib.list()

    foreach($nicfirmwareselect in $nicfirmware)

    {

    $NetworDescription = $nicfirmwareselect.Description

    $NetworDriver = $driversoft | where { $_.name -eq ($nicfirmwareselect.Driver) }

    $NetworkName = $nicfirmwareselect.Name

    $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)).DriverInfo.FirmwareVersion

    $report += "" |

    select @{N = "Hostname"; E = { $ESXHost.Name } },

    @{N = "Hardware-Model"; E = { $ESXHost.Model } },

    @{N = "device"; E = { $NetworkName } },

    @{N = "driver"; E = { $NetworDriver.Version } },

    @{N = "firmware"; E = { $NetworkFirmware } },

    @{N = "description"; E = { $NetworDescription } }

    }

    foreach($fcfirmwareselect in $fcfirmware)

    {

    $fcDescription = $fcfirmwareselect.ModelDescription

    $fcDriver = $driversoft | where { $_.name -eq ($fcfirmwareselect.DriverName) }

    $fcName = $fcfirmwareselect.Adapter

    $fcFirmware = $fcfirmwareselect.FirmwareVersion

    $report += "" |

    select @{N = "Hostname"; E = { $ESXHost.Name } },

    @{N = "Hardware-Model"; E = { $ESXHost.Model } },

    @{N = "device"; E = { $fcName } },

    @{N = "driver"; E = { $fcDriver.Version } },

    @{N = "firmware"; E = { $fcFirmware } },

    @{N = "description"; E = { $fcDescription } }

    }

    }

    $report | Export-Csv -Path 'C:\ESXI HBA & NIC info.csv'

    ########################################################################

Leave a Reply to jpa Cancel reply

Your email address will not be published. Required fields are marked *