feat: add Sushy emulator vendor implementation - #115
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new Redfish vendor implementation for the Sushy (sushy-tools) emulator so the library can be used for development/testing against libvirt-backed virtual BMCs without physical hardware.
Changes:
- Introduces a new
Sushyvendor (src/sushy.rs) that wrapsRedfishStandardand stubs/overrides unsupported behaviors. - Extends vendor detection to recognize
sushy,contoso, andredvirtinServiceRoot.Vendor. - Wires the new vendor into the standard vendor-dispatch path.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/sushy.rs | Adds the Sushy-specific Redfish implementation that delegates most calls to RedfishStandard and overrides emulator-incompatible operations. |
| src/standard.rs | Adds vendor dispatch for RedfishVendor::Sushy to construct the new crate::sushy::Bmc. |
| src/model/service_root.rs | Adds RedfishVendor::Sushy and maps "sushy", "contoso", and "redvirt" to it during vendor detection. |
| src/lib.rs | Registers the new sushy module in the crate. |
Comments suppressed due to low confidence (1)
src/sushy.rs:412
- Per the PR description, BIOS reset should be a no-op for Sushy. Delegating
reset_biostoRedfishStandardcan return errors (or perform unsupported operations) on the emulator.
fn reset_bios<'a>(&'a self) -> crate::RedfishFuture<'a, Result<(), RedfishError>> {
Box::pin(async move { self.standard.reset_bios().await })
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bab1fb1 to
db90952
Compare
|
Amazing! Also check my Sushy fork with additional features - https://github.com/s3rj1k/sushy-tools All of the changes are proposed as MRs in OpenDev. My point is that Sushy is missing some of the functionality that NiCO needs to have and it is way better to fix that on Sushy side and keep Rust side clearer. https://review.opendev.org/c/openstack/sushy-tools/+/991912 |
|
@s3rj1k, absolutely agree that extending Sushy is the proper way, just slower :) |
I would be nice to ping OpenStack people and facilitate reviews of MRs TBH. |
I'm aware of them but please note that extending sushy-tools is very far from being a priority for any of us. If it's blocking this PR, please go ahead with stubs. |
|
@fabiendupont We want to get this merged in, could you resolve conflicts and mark any review comments as resolved? |
|
@kfelternv, I'm on PTO without my computer right now. I should be able to do it next week. Is that okay time wise? |
db90952 to
4ba6c5c
Compare
|
@kfelternv, back to work :) |
|
/ok to test 4ba6c5c |
|
@fabiendupont cargo build failed: |
poroh
left a comment
There was a problem hiding this comment.
@fabiendupont I wanted to merge you PR first and then #132 but because your PR had build error #132 was merged first. Could you please remove methods that delegates calls to standard implmenetation. Now it happens by default, you don't need to provide this implementation.
Example of function from you PR that can be removed:
fn update_firmware<'a>(
&'a self,
firmware: tokio::fs::File,
) -> crate::RedfishFuture<'a, Result<crate::model::task::Task, RedfishError>> {
Box::pin(async move { self.standard.update_firmware(firmware).await })
}
4ba6c5c to
b19881f
Compare
|
/ok to test b19881f |
|
@fabiendupont Next one is formatting: |
Add Sushy (sushy-tools) as a recognized Redfish vendor. Sushy is an OpenStack Redfish emulator backed by libvirt, used for development and testing without physical BMC hardware. The Sushy Bmc wraps RedfishStandard and delegates most operations, stubbing out operations the emulator cannot support: - Account management: accept silently (no AccountService endpoint) - Password management: accept silently (no real credentials) - BIOS/boot config: skipped (no BIOS in a VM) - Lockdown: no-op - GPU sensors, secure boot certs, attestation: NotSupported - Power control and boot operations: delegated (Sushy controls libvirt) Vendor detection matches "sushy", "contoso", or "redvirt" in the ServiceRoot Vendor field. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Fabien Dupont <fdupont@redhat.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
b19881f to
6fa3844
Compare
|
Sorry @poroh. Went too fast. Updated. |
|
/ok to test 6fa3844 |
This PR bumps libredfish to `v0.47.1` which brings in the following changes: - feat: network transport mtls support by @yoks in dsx-ai-factory/libredfish#131 - refactor: delegate Redfish defaults to RedfishStandard by @poroh in dsx-ai-factory/libredfish#132 - feat: add Sushy emulator vendor implementation by @fabiendupont in dsx-ai-factory/libredfish#115 - chore: add SECURITY.md by @krish-nvidia in dsx-ai-factory/libredfish#133 - fix: distinguish Supermicro and DGX GB300 BIOS behavior by @martinraumann in dsx-ai-factory/libredfish#129 ## Related issues #5215 ## Type of Change - [ ] **Add** - New feature or capability - [ ] **Change** - Changes in existing functionality - [x] **Fix** - Bug fixes - [ ] **Remove** - Removed features or deprecated functionality - [ ] **Internal** - Internal changes (refactoring, tests, docs, etc.) ## Breaking Changes - [ ] **This PR contains breaking changes** ## Testing - [ ] Unit tests added/updated - [ ] Integration tests added/updated - [x] Manual testing performed - [ ] No testing required (docs, internal refactor, etc.) ## Additional Notes --------- Signed-off-by: Krish Dandiwala <kdandiwala@nvidia.com>
|
@fabiendupont so I've run latest master of NiCO that already contains this change against vanilla master of Sushy and it does not work. Please share your experience. |
|
So, after fixing above issue directly in Sushy with some of previously proposed changes to Sushy itself, I get stuck in |
Add Sushy (sushy-tools) as a recognized Redfish vendor for development and
testing without physical BMC hardware. Sushy is an OpenStack Redfish emulator
backed by libvirt — it translates Redfish power/boot operations into libvirt
domain commands.
The
SushyBmc wrapsRedfishStandardand delegates read operations andpower/boot control (which Sushy handles via libvirt). Operations that Sushy
cannot support are stubbed:
create_user,delete_user,change_password,get_accounts): accept silently — Sushy has noAccountServiceendpointmachine_setup,set_bios,reset_bios): no-op —VMs have no real BIOS
NotSupportedVendor detection matches
"sushy","contoso", or"redvirt"in theServiceRoot
Vendorfield. "Contoso" is the fictional manufacturer name fromDMTF's Redfish mockup data that Sushy ships with in its default Chassis
templates. "RedVirt" is an alternate configuration alias.
Testing
cargo checkcargo clippy --all-targets -- -D warnings