fix: Use chassis-level power state for PowerShelf in site explorer#914
fix: Use chassis-level power state for PowerShelf in site explorer#914kunzhao-nv wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes incorrect PowerShelf power reporting in Site Explorer by preferring the chassis-level Redfish power state over the system-level power state when the endpoint is detected as a PowerShelf, aligning with how PSM reads PowerShelf state and improving accuracy for inventory sync/remediation flows.
Changes:
- Detect PowerShelf endpoints and override
system.power_stateusingChassis/powershelf.PowerStatewhen available.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if let Ok(chassis) = client.get_chassis("powershelf").await { | ||
| if let Some(chassis_power) = chassis.power_state { | ||
| system.power_state = chassis_power; | ||
| } |
| if let Ok(chassis) = client.get_chassis("powershelf").await { | ||
| if let Some(chassis_power) = chassis.power_state { | ||
| system.power_state = chassis_power; | ||
| } |
|
Is this all related to the other work @spydaNVIDIA was doing today? |
d4547ed to
80e5836
Compare
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-04-13 05:05:14 UTC | Commit: 80e5836 |
80e5836 to
63b7f60
Compare
For powershelf devices, the system-level power state may not accurately reflect the actual power state. Override it with the chassis-level power state from the "powershelf" chassis endpoint when available. Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
63b7f60 to
146191a
Compare
poroh
left a comment
There was a problem hiding this comment.
Could you please add the same code to nv-redfish version of the site explorer:
https://github.com/NVIDIA/ncx-infra-controller-core/blob/main/crates/bmc-explorer/src/computer_system.rs#L224
?
Also, I it would be nice to have some tests for new code like this. Here is basic test for powershelf exploration:
https://github.com/NVIDIA/ncx-infra-controller-core/blob/main/crates/bmc-explorer/tests/powershelf_explore.rs
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Description
Type of Change
Related Issues (Optional)
Breaking Changes
Testing
Additional Notes