Skip to content

fix: Use chassis-level power state for PowerShelf in site explorer#914

Draft
kunzhao-nv wants to merge 2 commits intoNVIDIA:mainfrom
kunzhao-nv:fix/powershelf-power-state
Draft

fix: Use chassis-level power state for PowerShelf in site explorer#914
kunzhao-nv wants to merge 2 commits intoNVIDIA:mainfrom
kunzhao-nv:fix/powershelf-power-state

Conversation

@kunzhao-nv
Copy link
Copy Markdown
Contributor

@kunzhao-nv kunzhao-nv commented Apr 13, 2026

Description

  • For PowerShelf devices, the system-level power state from /redfish/v1/Systems/system does not accurately reflect the actual state. In testing, it returned "PoweringOff" while the shelf was confirmed to be on.
  • Override system.power_state with the chassis-level power state from /redfish/v1/Chassis/powershelf when the endpoint is detected as a PowerShelf.
  • This aligns with how PSM reads PowerShelf power state (via Chassis/powershelf.PowerState) and fixes the incorrect power state reported through RLA's inventory sync path (Core GetComponentInventory → RLA syncPowershelvesCarbide).

Type of Change

  • 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.)

Related Issues (Optional)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

Copilot AI review requested due to automatic review settings April 13, 2026 04:41
@kunzhao-nv kunzhao-nv requested a review from a team as a code owner April 13, 2026 04:41
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 13, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_state using Chassis/powershelf.PowerState when available.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +769 to +772
if let Ok(chassis) = client.get_chassis("powershelf").await {
if let Some(chassis_power) = chassis.power_state {
system.power_state = chassis_power;
}
Comment on lines +769 to +772
if let Ok(chassis) = client.get_chassis("powershelf").await {
if let Some(chassis_power) = chassis.power_state {
system.power_state = chassis_power;
}
@chet
Copy link
Copy Markdown
Contributor

chet commented Apr 13, 2026

Is this all related to the other work @spydaNVIDIA was doing today?

@kunzhao-nv kunzhao-nv force-pushed the fix/powershelf-power-state branch from d4547ed to 80e5836 Compare April 13, 2026 05:03
@github-actions
Copy link
Copy Markdown

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-04-13 05:05:14 UTC | Commit: 80e5836

@kunzhao-nv kunzhao-nv force-pushed the fix/powershelf-power-state branch from 80e5836 to 63b7f60 Compare April 13, 2026 05:07
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>
@kunzhao-nv kunzhao-nv force-pushed the fix/powershelf-power-state branch from 63b7f60 to 146191a Compare April 13, 2026 05:31
Copy link
Copy Markdown
Contributor

@poroh poroh left a comment

Choose a reason for hiding this comment

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

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

@kunzhao-nv kunzhao-nv marked this pull request as draft April 13, 2026 16:34
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 13, 2026

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.

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