I am trying to get the vendor id and device id for nic and hba adapters but why I am seeing different values when compared with $esxcli.hardware.pci.list() and esxcfg-info
Here is the script I used
$esxcli = Get-EsxCli -VMHost $esx
$nic = Get-VMHostNetworkAdapter -VMHost $esx | select -ExpandProperty Name
$hba = Get-VMHostHba -VMHost $esx -Type FibreChannel | ? { $_.Status -eq "online" } | select -ExpandProperty Name
$elxnet = $esxcli.software.vib.list() | ? { $_.name -eq "elxnet" }
$esxcli.hardware.pci.list() | ? { ($nic -contains $_.VMKernelName) -or ($hba -contains $_.VMKernelName) } | ForEach-Object -Process {
New-Object PSObject -Property (
[ordered]@{
Name = $esx.Name
Device = $_.DeviceName
VendorName = $_.VendorName
VendorID = ( $_.VendorID)
DeviceID = ($_.DeviceID)
SubVendorID = ($_.SubVendorID)
nicFWversion = ($esxcli.network.nic.get("vmnic0").driverinfo.version)
stFWversion = ($elxnet.version.substring(0, 14))
})
}
}
Output
Esxi Shell output:
It seems a problem with the powershell command. If you use 'esxcli hardware pci list' at the host the output is correct:
0000:1b:00.0
Address: 0000:1b:00.0
Segment: 0x0000
Bus: 0x1b
Slot: 0x00
Function: 0x0
Vendor Name: VMware Inc.
Device Name: vmxnet3 Virtual Ethernet Controller
Configured Owner: VMkernel
Current Owner: VMkernel
Vendor ID: 0x15ad
Device ID: 0x07b0
SubVendor ID: 0x15ad
SubDevice ID: 0x07b0
Device Class: 0x0200
In the csv the fields are empty :
"R750 vSAN Ready Node","vmnic0","4.1.13.0-4vmw.802.0.0.22380479","bc 1.39 ncsi 1.5.42.0","Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet","0","0","0","0"