Skip to content

Update BMC HLD with Redis communication for SONiC BMC - #2453

Open
benle7 wants to merge 2 commits into
sonic-net:masterfrom
benle7:sonic_bmc_redis
Open

Update BMC HLD with Redis communication for SONiC BMC#2453
benle7 wants to merge 2 commits into
sonic-net:masterfrom
benle7:sonic_bmc_redis

Conversation

@benle7

@benle7 benle7 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This PR updates the existing BMC HLD, which was originally designed for communication with OpenBMC via Redfish.
The document has been extended to describe the required changes for supporting communication with a SONiC BMC through the BMC's Redis database.

Signed-off-by: Ben Levi <belevi@nvidia.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@benle7
benle7 requested a review from oleksandrivantsiv July 9, 2026 15:09
Signed-off-by: Ben Levi <belevi@nvidia.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@benle7
benle7 requested a review from judyjoseph July 15, 2026 17:29
@benle7

benle7 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Hi @judyjoseph

This PR includes the design updates I presented in the "SONiC BMC WG Meeting".
Can you please review/approve?

Thanks!

Comment thread doc/bmc/bmc_hld.md

In summary, when the BMC runs OpenBMC, the Switch-Host NOS interacts with the BMC through the Redfish RESTful API.

When the BMC runs SONiC OS, the Switch-Host NOS interacts with the BMC through Redis over the host–BMC link (`usb0`). The host connects to the Redis instance on the BMC and reads platform data.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why can't we implement the API's in SONiC Redfish too (barring the dump)? Should be fairly straightforward to implement. This way we keep the API layer clean and do away with the bmc os config too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As part of the SONiC BMC project architecture, the agreed-upon design was that communication between the host side and the BMC side would be via Redis. Dedicated Redfish endpoints will be added for specific use cases, but those are outside the scope of this PR.

Most of the existing BMC APIs (bmc_base.py) are OpenBMC-specific and are therefore not relevant for SONiC BMC. Examples include session management, resetting the root password, and firmware updates, which in our case will be handled directly on the BMC side.

However, the host still needs access to the BMC EEPROM data so that we can continue supporting the existing show platform bmc eeprom CLI. For that reason, the EEPROM information is retrieved from the SONiC BMC Redis database.

Comment thread doc/bmc/bmc_hld.md

In summary, when the BMC runs OpenBMC, the Switch-Host NOS interacts with the BMC through the Redfish RESTful API.

When the BMC runs SONiC OS, the Switch-Host NOS interacts with the BMC through Redis over the host–BMC link (`usb0`). The host connects to the Redis instance on the BMC and reads platform data.

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.

I think this design needs another look. It exposes the BMCs internal OS details to every hostside consumer instead of encapsulating them behind a stable API abstraction. this way sharing implementation details across layers and tightly couples consumers(of BMC) to the BMC OS internals, which could make maintenance and future changes significantly harder. please think about it

Comment thread doc/bmc/bmc_hld.md
config bmc os openbmc
```

`config bmc os` writes `DEVICE_METADATA|bmc.os`. Subsequent BMC CLI/API calls on the Switch-Host use Redfish or Redis according to this setting.

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.

why an operator need this API at all ? exposing config bmc os as a configurable option suggests the BMC OS is a runtime choice, which it is not.

I would recommend removing it, or at most exposing it as read only platform metadata. a get is ok but not set . please think about it.

Comment thread doc/bmc/bmc_hld.md

### 6.3 Errors Handling:
- generate_dump check whether BMC is suppported (via bmc.json file). If not, BMC logic is skipped.
- `generate_dump` checks whether BMC Redfish dump is supported: Switch-Host, `bmc.json` present, and `get_bmc_os() == openbmc`. If not, host-side BMC dump logic is skipped.

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.

get_bmc_os() == openbmc is not looking good .

ideally , this check should be be in only one place something like "ChassisBase.get_bmc()" ( from bmc.json) , all implementation of subclass creation like vendor specific custom code and transport strategy can grow independently

Comment thread doc/bmc/bmc_hld.md
| `get_serial()` | Yes | Yes |
| `get_revision()` | Yes | Yes |
| `get_status()` | Yes | Yes |
| `is_replaceable()` | Yes | Yes |

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.

OpenBMC and SONiC BMC already provide almost all of the capabilities we need (EEPROM, presence, model/serial, status, version, etc.). For those common capabilities, we should expose a single interface that hides the underlying BMC OS.

The current design seems to push the BMC OS decision into the caller and we need to hard code like this

if (bmc.os == OpenBMC)
use OpenBMC-specific API
else
use SONiC BMC API

That means every consumer now needs to know which BMC OS is running, which creates unnecessary tight coupling.

My proposal :

  • I think we should separate this by capability, not by BMC OS. Common functionality should always be accessed through Redfish (or another common API), regardless of whether the platform is running OpenBMC or SONiC BMC.
  • only genuinely platform specific features should require a platform extension.

The underlying BMC OS should remain an implementation detail. hostside consumers should nt need to know or care about which BMC OS is running.

@chinmoy-nexthop

Copy link
Copy Markdown
Contributor

@benle7 thanks for this proposal, appreciate the effort here.

@oleksandrivantsiv @benle7 , when you get a chance, could you take another look at some of the points above? I think considering them would help make the design cleaner and more maintainable in future .

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants