Add ESXi support to platform in-band collectors - #282
Open
spiral6 wants to merge 7 commits into
Open
Conversation
Enable os, bios, dimm, kernel, storage, and device_enumeration collectors on ESXi via esxcli/smbiosDump. kernel reuses the existing `uname -a` path (ESXi reports the release in the same field). dimm shares a _parse_dmi_sizes helper across dmidecode (Linux) and smbiosDump (ESXi). device_enumeration counts GPU PF/VF by device ID, adding devid_ep/devid_ep_vf to SystemInfo. Validated on ESXi 9.1.0 and Linux; Linux/Windows paths unchanged.
ESXi busybox lspci lacks per-device (-s) and bus-path (-PP) options, so dump all extended config space once via `lspci -e`, split by BDF, and select the GPU/VF BDFs resolved from `esxcli hardware pci list` by SKU device ID (system_info.devid_ep/_vf). Extract a shared _cfg_space_from_hex parser (used by the Linux per-BDF path too). Upstream-bridge traversal is skipped on ESXi (GPU + VF only). Depends on the SystemInfo devid_ep/devid_ep_vf fields.
ESXi has no dmesg ring buffer; read the kernel log from /var/log/vmkernel.log (and vmkernel.<n>[.gz] rotations) instead of `dmesg`. Validated on ESXi: reads vmkernel.log; Linux path unchanged.
Make the dmesg analyzer format-aware so it handles ESXi vmkernel.log as well
as Linux dmesg:
- Extract ESXi ISO8601 dot-ms/Z timestamps (e.g. 2026-08-20T09:35:58.380Z) via
ESXI_TIMESTAMP_PATTERN, set on __init__ so event grouping and date-range
filtering both use it; Linux keeps the base comma-form pattern.
- filter_dmesg is now an instance method and reuses the base timestamp extractor,
so a single code path honors whichever pattern is active.
- Add ESXi mxGPU (gim/amdgpuv) RAS ERROR_REGEX entries (Block-capitalized
correctable/uncorrectable, ECC Fatal Error, Whole GPU reset); these are inert
on Linux logs.
- Unknown-error detection keys off the driver-internal severity in the message
body ("gim/amdgpuv error/warn") on ESXi, where the vmkernel -ALERT/-INFO
tokens are unreliable; Linux keeps the "kern :err:" form.
Validated on real ESXi vmkernel.log (7.2 MB) and Linux dmesg (no regression),
plus synthetic RAS lines confirming per-OS phrasing is discriminated correctly.
- filter_dmesg: keep it a classmethod (public API used as DmesgAnalyzer.filter_dmesg(content, ...) in tests). Recognize both Linux comma-form and ESXi dot-ms/Z timestamps via a combined pattern instead of the instance TIMESTAMP_PATTERN; normalize the trailing Z so fromisoformat accepts it on Python < 3.11. - Collector: restore the exact Linux "No /var/log/dmesg files found (including rotations)." wording for the no-rotations event and add an ESXi-specific vmkernel.log variant, rather than a generic reword. Restores test_dmesg_filter and test_collect_rotations_no_files; full dmesg collector+analyzer suite (57 tests) green.
Pre-commit black (line-length 100) flagged formatting in the ESXi branches. Expand the branch-selection ternaries to explicit if/else (pcie devid resolve, storage percent, dmesg cmd/log-label selection) and let black normalize the two long single-line constants (dmesg CMD_LOGS_ESXI, analyzer ESXI_TIMESTAMP_PATTERN). No behavior change; black --check and ruff clean, dmesg+storage suites green.
Hoisting the percent computation reused the name "percent", which the Linux branch later binds to a str from split() before re.sub()/float() — mypy flagged the float-vs-str conflict. Rename the ESXi-branch value to usage_percent.
spiral6
marked this pull request as ready for review
September 11, 2026 18:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable the platform in-band collectors on ESXi via esxcli/smbiosDump, plus pcie and dmesg:
Validated on ESXi 9.1 and Linux; Linux/Windows paths unchanged.
pre-commit (black/ruff/mypy) green; full unit suite passes.