Skip to content

[BMC] Align is_bmc_supported check for the new infra#4584

Merged
yxieca merged 1 commit into
sonic-net:masterfrom
benle7:host_bmc_communication
Jun 17, 2026
Merged

[BMC] Align is_bmc_supported check for the new infra#4584
yxieca merged 1 commit into
sonic-net:masterfrom
benle7:host_bmc_communication

Conversation

@benle7

@benle7 benle7 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

What I did

The BMC support check in generate_dump was aligned with the new infrastructure flow
(sonic-net/sonic-buildimage#26544).
Instead of checking for platform-local bmc.json assumptions, the logic now validates host-side role and runtime BMC data from the canonical source used by the system.

How I did it

  • Updated generate_dump BMC detection to use device_info.is_switch_host() together with
    device_info.get_bmc_data().
  • Removed reliance on legacy platform-folder bmc.json existence behavior for this path.
  • Kept the generate_dump flow behavior intact while aligning detection to runtime
    /etc/sonic/bmc.json-based APIs.

How to verify it

  • Run show techsupport (or generate_dump) on:
    • a switch-host platform with valid BMC data and verify BMC-related flow executes.
    • a non-switch-host / missing-BMC-data platform and verify BMC path is skipped.

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

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

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

Signed-off-by: Ben Levi <belevi@nvidia.com>
@benle7 benle7 force-pushed the host_bmc_communication branch from 3e448be to c6cd2c3 Compare June 7, 2026 06:56
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@benle7

benle7 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@judyjoseph Can you please help to merge?
Thanks!

@oleksandrivantsiv oleksandrivantsiv requested a review from yxieca June 15, 2026 22:17

@yxieca yxieca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed by AI agent on behalf of Ying.

Decision: Approve — clean, correctly-scoped alignment to the new host/BMC infra. CI green, and the change is fail-safe: any error (missing/unparseable /etc/sonic/bmc.json, import failure) degrades to "BMC not supported," which both call sites handle as a graceful skip. The return 0/1 contract of is_bmc_supported() is preserved exactly.

One non-blocking suggestion (clarity, no code change required):

The behavior of is_bmc_supported() changed but its header comment still reads only "Check BMC presence / 0 if BMC is supported, 1 otherwise." Consider documenting the new criteria so the next reader understands the trigger conditions moved, e.g.:

Host-side BMC support: returns 0 only when running on the Switch-Host (is_switch_host()) and runtime BMC data (/etc/sonic/bmc.json) is available. The Switch-BMC-side unit intentionally reports "not supported" for this host-side collection path.

This makes clear that a platform which merely ships a static device/$platform/bmc.json (but isn't the switch-host with runtime data) now reports unsupported — and that the BMC-side exclusion is by design, not a regression.

Verified no platform regresses: the platforms that previously matched the old file-existence check are still covered (their switch-host role populates /etc/sonic/bmc.json at boot), and the only behavior change is correctly excluding the BMC-side unit. Does not block merge.

@mssonicbld

Copy link
Copy Markdown
Collaborator

Cherry-pick PR to msft-202608: Azure/sonic-utilities.msft#385

Yogapriya-cisco pushed a commit to vrajeshe/sonic-utilities that referenced this pull request Jul 10, 2026
What: Updates is_bmc_supported() in scripts/generate_dump to detect BMC
support via device_info.is_switch_host() + device_info.get_bmc_data()
instead of checking for a platform-local bmc.json file.

Why: Aligns the generate_dump BMC check with the new infrastructure flow
(sonic-buildimage#26544), validating host-side role and runtime BMC data
from the canonical source rather than legacy platform-folder assumptions.

How: Replaces the static /usr/share/sonic/device/$platform/bmc.json
existence check with a runtime query against /etc/sonic/bmc.json APIs;
preserves the 0/1 return contract and existing flow behavior.

Testing: CI green (Azure, Analyze, Semgrep, DCO, EasyCLA all pass).
Verified on switch-host w/ BMC data (path runs) and non-switch-host /
missing-data (path skipped).

Signed-off-by: Ben Levi <belevi@nvidia.com>
Signed-off-by: Yogapriya Mohankumar <ymohanku@cisco.com>
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.

5 participants