Skip to content

Commit b3eee6f

Browse files
tpcarmanclaude
andcommitted
Add I/O Device Identifiers subsection to VMHost Hardware report (#126)
Adds a new NOTOCHeading5 subsection under each host's Hardware section displaying VID, DID, SVID, and SSID in lowercase hex for HCL validation. Uses PCI address mapping via Get-VMHostNetworkAdapter/Get-VMHostHba instead of VMkernelName (unpopulated on ESXi 8). Guards null PCI keys to handle software HBAs (iSCSI, software NVMe) without physical PCI addresses. Adds 7 new localisation keys to all 5 locale files (en-US, en-GB, es-ES, fr-FR, de-DE). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bad5239 commit b3eee6f

File tree

7 files changed

+80
-0
lines changed

7 files changed

+80
-0
lines changed

AsBuiltReport.VMware.vSphere/Language/de-DE/VMwarevSphere.psd1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,13 @@ GetAbrVSphereVMHostHardware = ConvertFrom-StringData @'
536536
PCIDeviceError = Error collecting PCI device information for {0}. {1}
537537
PCIDriversFirmwareError = Error collecting PCI device driver & firmware information for {0}. {1}
538538
HardwareError = Error collecting host hardware information for {0}. {1}
539+
IODeviceIdentifiers = E/A-Gerätekennungen
540+
VendorID = VID
541+
DeviceID = DID
542+
SubVendorID = SVID
543+
SubDeviceID = SSID
544+
TableIODeviceIdentifiers = E/A-Gerätekennungen - {0}
545+
IODeviceIdentifiersError = Fehler beim Sammeln der E/A-Gerätekennungen für {0}. {1}
539546
'@
540547

541548
# Get-AbrVSphereVMHostSystem

AsBuiltReport.VMware.vSphere/Language/en-GB/VMwarevSphere.psd1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,13 @@ GetAbrVSphereVMHostHardware = ConvertFrom-StringData @'
536536
PCIDeviceError = Error collecting PCI device information for {0}. {1}
537537
PCIDriversFirmwareError = Error collecting PCI device driver & firmware information for {0}. {1}
538538
HardwareError = Error collecting host hardware information for {0}. {1}
539+
IODeviceIdentifiers = I/O Device Identifiers
540+
VendorID = VID
541+
DeviceID = DID
542+
SubVendorID = SVID
543+
SubDeviceID = SSID
544+
TableIODeviceIdentifiers = I/O Device Identifiers - {0}
545+
IODeviceIdentifiersError = Error collecting I/O device identifier information for {0}. {1}
539546
'@
540547

541548
# Get-AbrVSphereVMHostSystem

AsBuiltReport.VMware.vSphere/Language/en-US/VMwarevSphere.psd1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,13 @@ GetAbrVSphereVMHostHardware = ConvertFrom-StringData @'
536536
PCIDeviceError = Error collecting PCI device information for {0}. {1}
537537
PCIDriversFirmwareError = Error collecting PCI device driver & firmware information for {0}. {1}
538538
HardwareError = Error collecting host hardware information for {0}. {1}
539+
IODeviceIdentifiers = I/O Device Identifiers
540+
VendorID = VID
541+
DeviceID = DID
542+
SubVendorID = SVID
543+
SubDeviceID = SSID
544+
TableIODeviceIdentifiers = I/O Device Identifiers - {0}
545+
IODeviceIdentifiersError = Error collecting I/O device identifier information for {0}. {1}
539546
'@
540547

541548
# Get-AbrVSphereVMHostSystem

AsBuiltReport.VMware.vSphere/Language/es-ES/VMwarevSphere.psd1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,13 @@ GetAbrVSphereVMHostHardware = ConvertFrom-StringData @'
536536
PCIDeviceError = Error collecting PCI device information for {0}. {1}
537537
PCIDriversFirmwareError = Error collecting PCI device driver & firmware information for {0}. {1}
538538
HardwareError = Error collecting host hardware information for {0}. {1}
539+
IODeviceIdentifiers = Identificadores de dispositivos de E/S
540+
VendorID = VID
541+
DeviceID = DID
542+
SubVendorID = SVID
543+
SubDeviceID = SSID
544+
TableIODeviceIdentifiers = Identificadores de E/S - {0}
545+
IODeviceIdentifiersError = Error al recopilar identificadores de E/S para {0}. {1}
539546
'@
540547

541548
# Get-AbrVSphereVMHostSystem

AsBuiltReport.VMware.vSphere/Language/fr-FR/VMwarevSphere.psd1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,13 @@ GetAbrVSphereVMHostHardware = ConvertFrom-StringData @'
536536
PCIDeviceError = Error collecting PCI device information for {0}. {1}
537537
PCIDriversFirmwareError = Error collecting PCI device driver & firmware information for {0}. {1}
538538
HardwareError = Error collecting host hardware information for {0}. {1}
539+
IODeviceIdentifiers = Identifiants des périphériques d'E/S
540+
VendorID = VID
541+
DeviceID = DID
542+
SubVendorID = SVID
543+
SubDeviceID = SSID
544+
TableIODeviceIdentifiers = Identifiants E/S - {0}
545+
IODeviceIdentifiersError = Erreur lors de la collecte des identifiants E/S pour {0}. {1}
539546
'@
540547

541548
# Get-AbrVSphereVMHostSystem

AsBuiltReport.VMware.vSphere/Src/Private/Get-AbrVSphereVMHostHardware.ps1

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,50 @@ function Get-AbrVSphereVMHostHardware {
280280
}
281281
}
282282
#endregion ESXi Host PCI Devices Drivers & Firmware
283+
284+
#region ESXi Host I/O Device Identifiers
285+
try {
286+
# Build PCI address -> VMkernel name mapping (VMkernelName is unpopulated on ESXi 8)
287+
# Guard against null keys — software HBAs (iSCSI, software NVMe) have no PCI address
288+
$IOPciToDevice = @{}
289+
Get-VMHostNetworkAdapter -VMHost $VMHost -Physical | ForEach-Object {
290+
if ($_.PciId) { $IOPciToDevice[$_.PciId] = $_.DeviceName }
291+
}
292+
Get-VMHostHba -VMHost $VMHost | ForEach-Object {
293+
if ($_.Pci) { $IOPciToDevice[$_.Pci] = $_.Device }
294+
}
295+
(Get-VMHost $VMHost | Get-View -Property Config).Config.GraphicsInfo | ForEach-Object {
296+
if ($_.pciId) { $IOPciToDevice[$_.pciId] = $_.deviceName }
297+
}
298+
$VMHostIODevices = $esxcli.hardware.pci.list.Invoke() |
299+
Where-Object { $IOPciToDevice.ContainsKey($_.Address) } |
300+
Sort-Object -Property Address
301+
if ($VMHostIODevices) {
302+
Section -Style NOTOCHeading5 -ExcludeFromTOC $LocalizedData.IODeviceIdentifiers {
303+
$VMHostIODeviceInfo = $VMHostIODevices | ForEach-Object {
304+
[PSCustomObject]@{
305+
$LocalizedData.Device = $IOPciToDevice[$_.Address]
306+
$LocalizedData.Model = $_.DeviceName
307+
$LocalizedData.VendorID = [String]::Format("{0:x4}", $_.VendorID)
308+
$LocalizedData.DeviceID = [String]::Format("{0:x4}", $_.DeviceID)
309+
$LocalizedData.SubVendorID = [String]::Format("{0:x4}", $_.SubVendorID)
310+
$LocalizedData.SubDeviceID = [String]::Format("{0:x4}", $_.SubDeviceID)
311+
}
312+
}
313+
$TableParams = @{
314+
Name = ($LocalizedData.TableIODeviceIdentifiers -f $VMHost)
315+
ColumnWidths = 13, 31, 14, 14, 14, 14
316+
}
317+
if ($Report.ShowTableCaptions) {
318+
$TableParams['Caption'] = "- $($TableParams.Name)"
319+
}
320+
$VMHostIODeviceInfo | Sort-Object $LocalizedData.Device | Table @TableParams
321+
}
322+
}
323+
} catch {
324+
Write-PScriboMessage -Message ($LocalizedData.IODeviceIdentifiersError -f $VMHost.Name, $_.Exception.Message)
325+
}
326+
#endregion ESXi Host I/O Device Identifiers
283327
}
284328
} catch {
285329
Write-PScriboMessage -Message ($LocalizedData.HardwareError -f $VMHost.Name, $_.Exception.Message)

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
### Added
1818

19+
- Add I/O Device Identifiers subsection to VMHost Hardware report, displaying VID/DID/SVID/SSID in lowercase hex for HCL validation ([#126](https://github.com/AsBuiltReport/AsBuiltReport.VMware.vSphere/issues/126))
1920
- Modular architecture: each report section is now a dedicated private function (`Get-AbrVSphere*`)
2021
- Internationalization (i18n) support via `Language/` `.psd1` files (`en-US`, `en-GB`, `es-ES`, `fr-FR`, `de-DE`)
2122
- Pester test suite (`AsBuiltReport.VMware.vSphere.Tests.ps1`, `LocalizationData.Tests.ps1`, `Invoke-Tests.ps1`)

0 commit comments

Comments
 (0)