I came up with the PowerCLI script, It will give the HBA and NIC driver details.
Output holds the below details.
vCenter
ESX Name
Storage Adapter Version
Storage Vendor Name
Network Adapter Version
Network Vendor Name
Module Name
ESX_Version
H/W Model
In the script I collect driver details by ESXCLI commands. While collecting I was having problem find the driver name of the network and storage. By default it should be network driver should be enic and storage driver should be fnic, but in different according to dell driver and some hardware we have LPFC and many other drivers present. Please find some driver names below.
Storage = fnic,Network = enic
Storage = lpfc,Network = bnx2
Storage = qlnativefc,Network = bnx2
Storage = qlnativefc,Network = tg3
Storage = qla2xxx,Network = tg3
Storage = lpfc,Network = bnx2
So while making the script we need to keep in mind that we are getting the right driver name before getting the driver version.
To know the driver version
$nic_details = Get-VMHostNetworkAdapter -VMHost ($vc_name1.Name)
$nic_module = $nic_module.ExtensionData.Driver
Below is the output of the Output of ‘$nic_module.ExtensionData’
Key: key-vim.host.PhysicalNic-vmnic0
Device: vmnic0
Pci: 06:00.0
Driver: enic
LinkSpeed: VMware.Vim.PhysicalNicLinkInfo
ValidLinkSpecification: {VMware.Vim.PhysicalNicLinkInfo}
Spec: VMware.Vim.PhysicalNicSpec
WakeOnLanSupported: False
Mac: 00:25:b5:a8:01:92
FcoeConfiguration :
VmDirectPathGen2Supported : True
VmDirectPathGen2SupportedMode : upt
ResourcePoolSchedulerAllowed: True
ResourcePoolSchedulerDisallowedReason :
AutoNegotiateSupported: False
To get the driver version:
$HBA_version = $esxcli.system.module.get($hba_module).version
We can get the same details from SSH
esxcli system module get --module <ModuleName>
Please find the full script below.