Skip to content

fix: support Chassis variants for lite-on power shelves#848

Merged
chet merged 1 commit into
NVIDIA:mainfrom
chet:power_shelf_look_at_chassis
Apr 8, 2026
Merged

fix: support Chassis variants for lite-on power shelves#848
chet merged 1 commit into
NVIDIA:mainfrom
chet:power_shelf_look_at_chassis

Conversation

@chet
Copy link
Copy Markdown
Contributor

@chet chet commented Apr 8, 2026

Description

It turns out that Lite-On power shelves support /Chassis/chassis AND /Chassis/powershelf. In older firmware, only /Chassis/chassis is what is exposed in the Chassis Collection registry, meaning the code we have (which checks for "powershelf" in the registry, fails.

I'm updating "is power shelf" checks to [continue to] look for "powershelf", and if that's not found, then to look for "chassis" where the manufacturer contains "lite-on". The real fixes are:

  • Making sure the power shelf vendors give us vendor information in the service root.
  • Enumerating the /Chassis/powershelf in the Chassis Collection (which is already fixed in newer FW).

Confirmed on actual hardware, and also added some unit tests.

On the plus side, our credentials fallback logic from #842 is working. This is just the next bit (we did the fall back, collected the vendor details, and the vendor details failed, because we were looking for "powershelf").

Signed-off-by: Chet Nichols III chetn@nvidia.com

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

@chet chet requested a review from a team as a code owner April 8, 2026 04:51
self.chassis
.iter()
.any(|c| c.id.to_lowercase().contains("powershelf"))
self.chassis.iter().any(|c| {
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.

Question: why not query expected_powershelves for this information?

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

🔐 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-08 04:52:40 UTC | Commit: e88d331

poroh
poroh previously requested changes Apr 8, 2026
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.

I double checked and chassis id is powershelf. Please don't merge before resolve.

@chet
Copy link
Copy Markdown
Contributor Author

chet commented Apr 8, 2026

I double checked and chassis id is powershelf. Please don't merge before resolve.

@poroh Not on these. Lite-on power shelves in ytl-shard-1. Actively working on them. Had to use /redfish/v1/Chassis/chassis.

What should I do?

@poroh
Copy link
Copy Markdown
Contributor

poroh commented Apr 8, 2026

I double checked and chassis id is powershelf. Please don't merge before resolve.

@poroh Not on these. Lite-on power shelves in ytl-shard-1. Actively working on them. Had to use /redfish/v1/Chassis/chassis.

What should I do?

Because we have both approaches we need to decide which we need to support in bmc_mock (and keep tests update):

  1. powershelf
  2. chassis
  3. both

Right now you switched to chassis one.

@chet
Copy link
Copy Markdown
Contributor Author

chet commented Apr 8, 2026

@poroh If you think it's supposed to be powershelf, let's keep it powershelf in bmc-mock, and I'll just keep this code doing what it's doing now -- it looks for powershelf and falls back to chassis + manufacturer(lite-on)?

In general this seems like a firmware bug. I'll post back here to a bug reference once we open something.

@poroh poroh dismissed their stale review April 8, 2026 15:12

Title of PR was misleading. Actual code support both, so I don't see blockers to merge it. Follow up is to check what we should support in bmc mock and we can handle it in separate PR.

@poroh
Copy link
Copy Markdown
Contributor

poroh commented Apr 8, 2026

@poroh If you think it's supposed to be powershelf, let's keep it powershelf in bmc-mock, and I'll just keep this code doing what it's doing now -- it looks for powershelf and falls back to chassis + manufacturer(lite-on)?

In general this seems like a firmware bug. I'll post back here to a bug reference once we open something.

It seems that "powershelf" version belongs to more recent firmware. So, I would prefer to have powershelf in bmc-mock instead of "chassis". Everything else LGTM.

@chet
Copy link
Copy Markdown
Contributor Author

chet commented Apr 8, 2026

Yeah to follow on @poroh's comment above, and for visibility: it turns out that /Chassis/powershelf does exist. The problem is it's not enumerated in the Chassis Collection, so when the [previous] code checked for "powershelf" in the chassis registry, it would fail (but if we had targeted /Chassis/powershelf directly, it would work.

To support old and new firmware in the interim (new firmware correctly enumerates it), and especially since all of the racks we're trying to bring up in labs are probably on older firmware, we're going to keep this PR as-is to support both variants (we'll try powershelf first, and then fall back to seeing if we can do chassis + manufacturer.contains(lite-on)).

Eventually this should be able to go away. The alternative is we don't do it, and we need to manually update a bunch of power shelves. But we're instead preferring to put in the workaround to let Carbide ingest them, and subsequently do the firmware updates on them anyway.

There must have been a typo when this code was first put together, and we didn't test it against an actual power shelf. For now we must maintain this fallback/hack for Lite-On power shelves, although I do think they're working on an update.

In the meantime, it's `/Chassis/chassis`, and not `/Chassis/powershelf`.

Just for completeless, I'm updating "*is power shelf*" checks to [continue to] look for `"powershelf"`, and if that's not found, then to look for `"chassis"` where the manufacturer contains `"lite-on`". That will make things a little less brittle, but the real fix is making sure the power shelf vendors give us vendor information in the serivce root, and use a common chassis ID.

Confirmed on actual hardware, and also added some unit tests.

On the plus side, our fallback credentials logic is working. This is just the next bit (we did the fall back, collected the vendor details, and the vendor details failed, because we were looking for `"powershelf"`).

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet chet force-pushed the power_shelf_look_at_chassis branch from e88d331 to 320b83e Compare April 8, 2026 17:36
@chet chet changed the title fix: lite-on power shelves are /Chassis/chassis, not /Chassis/powershelf fix: support /Chassis/{chassis, powershelf} variants for lite-on power shelves Apr 8, 2026
@chet chet changed the title fix: support /Chassis/{chassis, powershelf} variants for lite-on power shelves fix: support {chassis, powershelf} variants for lite-on power shelves Apr 8, 2026
@chet chet changed the title fix: support {chassis, powershelf} variants for lite-on power shelves fix: support Chassis variants for lite-on power shelves Apr 8, 2026
@chet chet merged commit ea50b35 into NVIDIA:main Apr 8, 2026
42 checks passed
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.

3 participants