Skip to content

Add BIOS reset command to admin cli#3564

Open
SnobbishFish40 wants to merge 2 commits into
NVIDIA:mainfrom
SnobbishFish40:admincli/reset-bios
Open

Add BIOS reset command to admin cli#3564
SnobbishFish40 wants to merge 2 commits into
NVIDIA:mainfrom
SnobbishFish40:admincli/reset-bios

Conversation

@SnobbishFish40

Copy link
Copy Markdown

Adds a direct nico-admin-cli redfish reset-bios command for restoring BIOS settings to factory defaults. This allows operators to reset BIOS before a machine has been ingested by NICo, when no machine ID is available, without manually constructing Redfish requests.

The command targets a BMC using its address and credentials. By default, it exits once the BMC accepts the BIOS-reset request and informs the operator that a restart is required. Passing --reboot submits a force restart after the BIOS-reset request succeeds.

The command uses libredfish’s vendor-specific reset_bios() implementation. NVIDIA GBx00 and GH200 support depends on the linked libredfish PR and a subsequent NICo dependency update.

Related issues

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

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

This PR will not support GBx00 or GH200 until the related libredfish PR is merged and NICo’s libredfish dependency is updated to a tag containing it.

Signed-off-by: Reuben Elliott <reubenelliott12345@gmail.com>
@SnobbishFish40 SnobbishFish40 requested review from a team and polarweasel as code owners July 15, 2026 18:12
@copy-pr-bot

copy-pr-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d483167a-9469-45f7-9f60-3f5d2acb6746

📥 Commits

Reviewing files that changed from the base of the PR and between 1819417 and 971509b.

📒 Files selected for processing (2)
  • crates/admin-cli/src/redfish/args.rs
  • docs/manuals/nico-admin-cli/commands/redfish/redfish-reset-bios.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/manuals/nico-admin-cli/commands/redfish/redfish-reset-bios.md
  • crates/admin-cli/src/redfish/args.rs

Summary by CodeRabbit

  • New Features

    • Added the redfish reset-bios command to restore BIOS settings to factory defaults.
    • Added an optional --reboot/-r flag to restart the system after the reset request.
    • Without rebooting, the command communicates that a restart is required for changes to take effect.
  • Documentation

    • Added a dedicated usage page for redfish reset-bios, including options, examples, and reference links.
    • Updated the Redfish subcommands list to include reset-bios.

Walkthrough

Adds a nico-admin-cli redfish reset-bios subcommand with an optional reboot flag, dispatch logic for BIOS reset and forced restart, parsing tests, and user documentation.

Changes

Redfish BIOS reset

Layer / File(s) Summary
Command contract and parsing coverage
crates/admin-cli/src/redfish/args.rs, crates/admin-cli/src/redfish/tests.rs
Adds the ResetBios command variant and --reboot/-r option, with tests covering enabled and disabled reboot parsing.
Reset execution and reboot handling
crates/admin-cli/src/redfish/cmds.rs
Calls redfish.reset_bios() and conditionally issues SystemPowerControl::ForceRestart, otherwise reporting that a restart is required.
Command documentation
docs/manuals/nico-admin-cli/commands/redfish/redfish-reset-bios.md, docs/manuals/nico-admin-cli/commands/redfish/redfish.md
Adds the reset-bios manual page, examples, option descriptions, and the Redfish subcommand index entry.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant action
  participant Redfish
  participant SystemPowerControl
  CLI->>action: Invoke reset-bios
  action->>Redfish: reset_bios()
  alt --reboot supplied
    action->>SystemPowerControl: ForceRestart
  else --reboot omitted
    action-->>CLI: Report restart required
  end
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: adding a BIOS reset command to the admin CLI.
Description check ✅ Passed The description matches the implemented reset-bios command, its reboot option, and its Redfish/libredfish behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/manuals/nico-admin-cli/commands/redfish/redfish-reset-bios.md`:
- Around line 12-13: Update the reset-bios command synopsis to show the required
value placeholder for --sort-by, matching the --sort-by <SORT_BY> declaration in
the options section while preserving the existing formatting and other options.
- Around line 15-22: Update the DESCRIPTION and --reboot option documentation
for the BIOS reset command to state that it returns once the BMC accepts the
reset request, while a restart is required for the settings to take effect.
Clarify that --reboot performs a forced restart after a successful reset.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6f0cc236-b823-4dcb-9a14-d5481bc0de1a

📥 Commits

Reviewing files that changed from the base of the PR and between 3abd252 and 1819417.

📒 Files selected for processing (5)
  • crates/admin-cli/src/redfish/args.rs
  • crates/admin-cli/src/redfish/cmds.rs
  • crates/admin-cli/src/redfish/tests.rs
  • docs/manuals/nico-admin-cli/commands/redfish/redfish-reset-bios.md
  • docs/manuals/nico-admin-cli/commands/redfish/redfish.md

Comment thread docs/manuals/nico-admin-cli/commands/redfish/redfish-reset-bios.md Outdated
Comment thread docs/manuals/nico-admin-cli/commands/redfish/redfish-reset-bios.md Outdated
Signed-off-by: Reuben Elliott <reubenelliott12345@gmail.com>
@krish-nvidia

Copy link
Copy Markdown
Contributor

@SnobbishFish40 I've bumped libredfish to v0.44.20 which includes your bios reset change in this PR: #3582

**--extended**
Extended result output.

This used by measured boot, where basic output contains just what you

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.

Suggested change
This used by measured boot, where basic output contains just what you
This is used by measured boot, where basic output contains just what you

@wminckler

wminckler commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

I thought there were versions of redfish commands that went through the API so you wouldn't need to find/know the bmc credentials. Was I dreaming?

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