Skip to content

[generate_dump] Collect get_component_versions.py on the NVIDIA BMC - #4841

Open
nikamirrr wants to merge 1 commit into
sonic-net:masterfrom
nikamirrr:bmc-techsupport-component-versions
Open

nikamirrr wants to merge 1 commit into
sonic-net:masterfrom
nikamirrr:bmc-techsupport-component-versions

Conversation

@nikamirrr

@nikamirrr nikamirrr commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

What I did

collect_mellanox() (scripts/generate_dump:1630) and collect_nvidia_bluefield() (:2239) both save get_component_versions.py output into the techsupport tarball as component_versions. collect_nvidia_bmc_dump() did not, so a BMC techsupport was missing a file its switch counterpart has.

That was correct until the tool reached the BMC in sonic-net/sonic-buildimage#29339, which added aspeed support and reports HW_MANAGEMENT and KERNEL there.

How I did it

 collect_nvidia_bmc_dump() {
     trap 'handle_error $? $LINENO' ERR
+    # Ahead of the early return taken when the hw-mgmt dump script is absent.
+    save_cmd "get_component_versions.py" "component_versions"
     local timeout_cmd="timeout --foreground ${TIMEOUT_MIN}m"

Placement is deliberate: the function returns early when /usr/bin/hw-management-bmc-generate-dump.sh is missing (:2261-2264), so appending at the end of the function would make the capture hostage to that script's presence. Hence the comment, so a later cleanup does not move it.

The output filename matches the mellanox and BlueField paths, so tooling that reads component_versions works unchanged across platforms.

How to verify it

On an NVIDIA BMC:

# show techsupport
# tar tzf /var/dump/sonic_dump_<host>_<ts>.tar.gz | grep component_versions

component_versions should be present and contain the component/compilation/actual table.

Manually tested on an NVIDIA BMC (Aspeed AST2700) running an image built from the
202608 branch: after show techsupport, the tarball contains component_versions with
the HW_MANAGEMENT and KERNEL rows. Without this change the file is absent from a BMC
techsupport. On an image whose get_component_versions.py does not support the platform, save_cmd records the command failure and the dump completes normally — the same behaviour as any other save_cmd whose command is unavailable.

Backport

No community backport requested. The change is needed on a 202608-based branch, which is
not a community release branch here; it will arrive there through the normal merge from
master rather than a cherry-pick.

Previous command output (if the output of a command-line utility has changed)

N/A — no CLI output changes; this only adds a file to the techsupport tarball.

New command output (if the output of a command-line utility has changed)

N/A

collect_mellanox() and collect_nvidia_bluefield() both save
get_component_versions.py output as "component_versions", but
collect_nvidia_bmc_dump() did not, so a BMC techsupport tarball was
missing the file its switch counterpart has.

The tool only became available on the BMC with sonic-buildimage
"[aspeed] Support get_component_versions.py on the SONiC BMC" (#29339);
until then the omission was correct.

Placed ahead of the early return taken when the hw-management BMC dump
script is absent, so the capture does not depend on that script.

Signed-off-by: Nikolay Mirin <nmirin@nvidia.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request label(s) for branch(es): msft-202608, but is missing required test information. Please make sure you tick the tested branch(es) in the Tested branch section and provide test evidence (e.g., 202608: <test result>) in the Test result section as well in your PR description.

---Powered by SONiC BuildBot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants