Skip to content

[action] [PR:4638] [techsupport] Skip switch-only collectors on Switch-BMC#388

Merged
mssonicbld merged 1 commit into
Azure:202608from
mssonicbld:cherry/msft-202608/4638
Jul 1, 2026
Merged

[action] [PR:4638] [techsupport] Skip switch-only collectors on Switch-BMC#388
mssonicbld merged 1 commit into
Azure:202608from
mssonicbld:cherry/msft-202608/4638

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator

What I did

generate_dump (the engine behind show techsupport) ran the full switch data-plane collection unconditionally. On a SONiC Switch-BMC — a control-plane-only platform with no ASIC/SDK, no front-panel ports, no FRR/vtysh, no swss/bgp/syncd containers, no STP, and an ARM/aspeed SoC that lacks some sysfs paths and tools — this produced a large number of spurious errors and irrelevant/empty sections in the techsupport bundle.

This change makes generate_dump Switch-BMC aware so show techsupport completes cleanly on a Switch-BMC, while behavior on regular switches is unchanged.

Part of the SONiC Switch-BMC enablement.

How I did it

  • Add an IS_SWITCH_BMC flag, set from switch_bmc=1 in platform_env.conf (mirroring the existing IS_SUPERVISOR handling).
  • Gate switch-only collectors on it so they self-skip on a Switch-BMC: FRR/BGP/EVPN/BFD, ASIC/SDK health events, front-panel interface/transceiver, gearbox, STP, swss/bgp docker logs, hdparm, the SAI dump, and the port-counter snapshots.
  • Keep platform-agnostic collectors: the generic show ip interface L3 summary (incl. management), LLDP, NAT/conntrack, and platform info.
  • Harden generic fallbacks so absent/empty paths no longer error:
    • record_missing_path replaces the broken echo > $TARDIR/$f fallback in save_proc/save_sys;
    • save_pstore handles absent/empty/populated without a failing glob;
    • sed_if_exists guards optional secret-scrub files.

How to verify it

On an AST2700-based SONiC Switch-BMC (switch_bmc=1):

  1. show techsupport → completes with exit 0, no spurious data-plane errors, and a valid gzip tarball under /var/dump.
  2. Confirm the switch-only sections are skipped (no FRR/BGP/STP/transceiver errors) while the platform/LLDP/NAT/management-interface sections are present.

On a regular (non-Switch-BMC) switch the behavior is unchanged: IS_SWITCH_BMC=false, so every collector runs exactly as before, and the empty-port-config path stays fatal.

Validated on a live AST2700 SONiC Switch-BMC: multiple full show techsupport runs (default, --silent, --debug-dump), all exit 0 and gzip-valid; the non-BMC fatal paths confirmed unchanged.

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

On a Switch-BMC, show techsupport previously emitted many collector failures to the console/log (e.g. FRR/vtysh, STP/stpctl, front-panel interface transceiver, swss/bgp docker-log lookups) and wrote empty/error sections into the bundle.

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

On a Switch-BMC, show techsupport now completes with exit 0 and no spurious errors; the inapplicable switch-only sections are omitted, and the platform/LLDP/NAT/management sections are retained.

Signed-off-by: Sonic Build Admin sonicbld@microsoft.com

#### What I did

`generate_dump` (the engine behind `show techsupport`) ran the full switch data-plane collection unconditionally. On a SONiC **Switch-BMC** — a control-plane-only platform with no ASIC/SDK, no front-panel ports, no FRR/vtysh, no swss/bgp/syncd containers, no STP, and an ARM/aspeed SoC that lacks some sysfs paths and tools — this produced a large number of spurious errors and irrelevant/empty sections in the techsupport bundle.

This change makes `generate_dump` Switch-BMC aware so `show techsupport` completes cleanly on a Switch-BMC, while behavior on regular switches is unchanged.

Part of the SONiC Switch-BMC enablement.

#### How I did it

- Add an `IS_SWITCH_BMC` flag, set from `switch_bmc=1` in `platform_env.conf` (mirroring the existing `IS_SUPERVISOR` handling).
- Gate switch-only collectors on it so they self-skip on a Switch-BMC: FRR/BGP/EVPN/BFD, ASIC/SDK health events, front-panel interface/transceiver, gearbox, STP, swss/bgp docker logs, `hdparm`, the SAI dump, and the port-counter snapshots.
- Keep platform-agnostic collectors: the generic `show ip interface` L3 summary (incl. management), LLDP, NAT/conntrack, and platform info.
- Harden generic fallbacks so absent/empty paths no longer error:
  - `record_missing_path` replaces the broken `echo > $TARDIR/$f` fallback in `save_proc`/`save_sys`;
  - `save_pstore` handles absent/empty/populated without a failing glob;
  - `sed_if_exists` guards optional secret-scrub files.

#### How to verify it

On an AST2700-based SONiC Switch-BMC (`switch_bmc=1`):

1. `show techsupport` → completes with **exit 0**, no spurious data-plane errors, and a valid gzip tarball under `/var/dump`.
2. Confirm the switch-only sections are skipped (no FRR/BGP/STP/transceiver errors) while the platform/LLDP/NAT/management-interface sections are present.

On a regular (non-Switch-BMC) switch the behavior is unchanged: `IS_SWITCH_BMC=false`, so every collector runs exactly as before, and the empty-port-config path stays fatal.

Validated on a live AST2700 SONiC Switch-BMC: multiple full `show techsupport` runs (default, `--silent`, `--debug-dump`), all exit 0 and gzip-valid; the non-BMC fatal paths confirmed unchanged.

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

On a Switch-BMC, `show techsupport` previously emitted many collector failures to the console/log (e.g. FRR/`vtysh`, STP/`stpctl`, front-panel `interface transceiver`, swss/bgp docker-log lookups) and wrote empty/error sections into the bundle.

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

On a Switch-BMC, `show techsupport` now completes with exit 0 and no spurious errors; the inapplicable switch-only sections are omitted, and the platform/LLDP/NAT/management sections are retained.

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-utilities#4638

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@mssonicbld mssonicbld merged commit c40c6cc into Azure:202608 Jul 1, 2026
4 checks passed
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.

1 participant