Skip to content

Commit 81ce98a

Browse files
authored
feat: add support for lenovo gb300s (#2753)
This PR adds support for Lenovo-AMI GB300s and bumps libredfish to `v0.44.12` ## Type of Change <!-- Check one that best describes this PR --> - [x] **Add** - New feature or capability - [ ] **Change** - Changes in existing functionality - [ ] **Fix** - Bug fixes - [ ] **Remove** - Removed features or deprecated functionality - [ ] **Internal** - Internal changes (refactoring, tests, docs, etc.) ## Breaking Changes <!-- If checked, describe the breaking changes and migration steps --> <!-- Breaking changes are not generally permitted, please discuss on a GitHub discussion or with the development team if you believe you need to break a backward compatibility guarantee --> - [ ] **This PR contains breaking changes** ## Testing <!-- How was this tested? Check all that apply --> - [ ] Unit tests added/updated - [ ] Integration tests added/updated - [x] Manual testing performed - [ ] No testing required (docs, internal refactor, etc.) ## Additional Notes <!-- Any additional context, deployment notes, or reviewer guidance --> --------- Signed-off-by: Krish Dandiwala <kdandiwala@nvidia.com>
1 parent 09809c2 commit 81ce98a

7 files changed

Lines changed: 42 additions & 7 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ authors = ["NVIDIA Carbide Engineering <carbide-dev@exchange.nvidia.com>"]
2626

2727
[workspace.dependencies]
2828
clap = { version = "4", features = ["derive", "env"] }
29-
libredfish = { git = "https://github.com/NVIDIA/libredfish.git", tag = "v0.44.11" }
29+
libredfish = { git = "https://github.com/NVIDIA/libredfish.git", tag = "v0.44.12" }
3030
librms = { git = "https://github.com/NVIDIA/nv-rms-client.git", tag = "v0.9.0-rc1" }
3131
ansi-to-html = "0.2.2"
3232

crates/bmc-explorer/src/chassis.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ impl<B: Bmc> ExploredChassis<B> {
243243
let serial_number = self
244244
.assembly_sn
245245
.clone()
246-
.or(hw_id.serial_number.map(|v| v.to_string()));
246+
.or(hw_id.serial_number.map(|v| v.to_string()))
247+
.map(|s| s.trim().to_string());
247248

248249
let nvidia_oem = self
249250
.chassis

crates/bmc-explorer/src/lib.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ pub async fn nv_generate_exploration_report<B: Bmc>(
159159
need_oem_ami_config_bmc: true,
160160
..Default::default()
161161
},
162+
hw::HwType::LenovoGb300 => manager::Config {
163+
need_host_interfaces: true,
164+
..Default::default()
165+
},
162166
hw::HwType::Supermicro => manager::Config {
163167
need_host_interfaces: true,
164168
need_oem_supermicro_kcs_interface: true,
@@ -376,6 +380,29 @@ fn lockdown_status<B: Bmc>(
376380
.map(|status| Some(LockdownStatus { status, message }))
377381
}
378382

383+
// LenovoGB300 (Grace-based AMI host BMC) has neither the KCS BIOS
384+
// attribute nor the OEM ConfigBMC endpoint. Lockdown is read from the
385+
// USB support attribute (attribute-id prefixed enum, e.g.
386+
// "USB000Disabled") together with the host interface state.
387+
hw::HwType::LenovoGb300 => {
388+
let bios = bios.as_ref().ok_or_else(Error::bmc_not_provided("bios"))?;
389+
let usb000 = bios.attribute("USB000");
390+
let usb000 = usb000.as_ref().and_then(|v| v.str_value());
391+
let hi_enabled = explored_manager
392+
.host_interfaces
393+
.as_ref()
394+
.ok_or_else(Error::bmc_not_provided("host interfaces"))?
395+
.iter()
396+
.any(|i| i.interface_enabled().is_none_or(identity));
397+
let message = format!("usb_support={usb000:?}; host_interface={hi_enabled}");
398+
match (usb000, hi_enabled) {
399+
(Some("USB000Disabled"), false) => Ok(InternalLockdownStatus::Enabled),
400+
(Some("USB000Enabled"), true) => Ok(InternalLockdownStatus::Disabled),
401+
_ => Ok(InternalLockdownStatus::Partial),
402+
}
403+
.map(|status| Some(LockdownStatus { status, message }))
404+
}
405+
379406
hw::HwType::Dell => {
380407
let attributes = explored_manager
381408
.oem_dell_attributes

crates/bmc-explorer/tests/lenovo_gb300_explore.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use bmc_explorer::hw::HwType;
2020
use bmc_explorer::nv_generate_exploration_report;
2121
use bmc_explorer::test_support::detect_hw_type;
2222
use bmc_mock::test_support;
23-
use model::site_explorer::EndpointType;
23+
use model::site_explorer::{EndpointType, InternalLockdownStatus};
2424
use tokio::test;
2525

2626
/// A Lenovo GB300 (AMI BMC) must classify as the GB300 platform regardless of the
@@ -49,4 +49,9 @@ async fn explore_lenovo_gb300() {
4949
assert_eq!(report.vendor, Some(bmc_vendor::BMCVendor::LenovoAMI));
5050
assert!(!report.systems.is_empty(), "systems must be present");
5151
assert!(!report.chassis.is_empty(), "chassis must be present");
52+
53+
let lockdown = report
54+
.lockdown_status
55+
.expect("GB300 lockdown status must be populated");
56+
assert_eq!(lockdown.status, InternalLockdownStatus::Partial);
5257
}

crates/redfish/src/libredfish/conv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub fn bmc_vendor(r: libredfish::model::service_root::RedfishVendor) -> BMCVendo
159159
RedfishVendor::Dell => BMCVendor::Dell,
160160
RedfishVendor::Hpe => BMCVendor::Hpe,
161161
RedfishVendor::Lenovo => BMCVendor::Lenovo,
162-
RedfishVendor::LenovoAMI => BMCVendor::LenovoAMI,
162+
RedfishVendor::LenovoAMI | RedfishVendor::LenovoGB300 => BMCVendor::LenovoAMI,
163163
RedfishVendor::LiteOnPowerShelf => BMCVendor::Liteon,
164164
RedfishVendor::DeltaPowerShelf => BMCVendor::Delta,
165165
RedfishVendor::Supermicro => BMCVendor::Supermicro,

crates/site-explorer/src/redfish.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,10 @@ impl RedfishClient {
230230
.map_err(|err| redact_password(err, curr_password.as_str()))
231231
.map_err(map_redfish_error)?;
232232
}
233-
// Handle Vikings
234-
RedfishVendor::AMI => {
233+
// Vikings and Lenovo GB300s. GB300s are detected as AMI at this
234+
// point (vendor isn't refined to LenovoGB300 until later), but both
235+
// rotate via the same admin account, so handle them together.
236+
RedfishVendor::AMI | RedfishVendor::LenovoGB300 => {
235237
/*
236238
https://docs.nvidia.com/dgx/dgxh100-user-guide/redfish-api-supp.html
237239

0 commit comments

Comments
 (0)