Skip to content

feat(pxe): use bfb bmc reboot feature#3506

Open
akorobkov-nvda wants to merge 2 commits into
NVIDIA:mainfrom
akorobkov-nvda:feat/dpu-bmc-reboot
Open

feat(pxe): use bfb bmc reboot feature#3506
akorobkov-nvda wants to merge 2 commits into
NVIDIA:mainfrom
akorobkov-nvda:feat/dpu-bmc-reboot

Conversation

@akorobkov-nvda

Copy link
Copy Markdown
Contributor

Use BFB installer's native BMC_REBOOT feature instead of manually calling bmc_reboot in bfb_post_install().

Changes:

  • Export BMC_REBOOT="yes" to enable automatic BMC reboot after firmware update
  • Replace manual bmc_reboot + wait_bmc_boot() with bmc_custom_action4() hook
  • Move CURL_CMD definition earlier so it's available in add_db_cert()
  • Remove set -x/set +x debug noise

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

The bmc_custom_action4() hook is called by the BFB installer after BMC reboot completes. It waits for Redfish API readiness before continuing deleting of a temporary BMC user

Reference: BFB installer BMC hooks

@akorobkov-nvda akorobkov-nvda requested a review from a team as a code owner July 14, 2026 19:19
@akorobkov-nvda akorobkov-nvda added this to the v2.1 milestone Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 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: ff98ec4d-c6c0-4bb6-a54f-25166b3396b2

📥 Commits

Reviewing files that changed from the base of the PR and between d14db5a and 31bfe42.

📒 Files selected for processing (1)
  • pxe/templates/bmc_fw_update
🚧 Files skipped from review as they are similar to previous changes (1)
  • pxe/templates/bmc_fw_update

Summary by CodeRabbit

  • New Features

    • BMC firmware updates now automatically reboot the BMC after a successful update.
    • Added post-update checks that wait for Redfish to become available before proceeding.
  • Bug Fixes

    • Improved reliability of secure-boot certificate restoration and reduced duplicate certificate submissions on transient failures.
    • Standardized authenticated HTTPS requests with consistent retry behavior across BMC operations.
    • Refined post-install flow to focus on VLAN setup, certificate restore, and temporary account cleanup without the prior reboot/wait sequence.

Walkthrough

The BMC firmware update template enables the BFB installer’s native reboot, checks Redfish readiness through a custom hook, centralizes authenticated CURL settings, and retains VLAN creation, certificate restoration, and account cleanup during post-install processing.

Changes

BMC reboot flow

Layer / File(s) Summary
Native reboot and readiness handling
pxe/templates/bmc_fw_update
Exports BMC_REBOOT="yes" and adds bmc_custom_action4() to poll the Redfish root endpoint after firmware updates.
Post-install operations and shared requests
pxe/templates/bmc_fw_update
Defines CURL_CMD globally, disables retries for certificate submission, removes manual reboot and legacy wait logic, and retains VLAN creation, certificate restoration, and account deletion.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BFBInstaller
  participant BMC
  participant Redfish
  BFBInstaller->>BMC: Apply firmware update
  BFBInstaller->>BMC: Trigger native reboot via BMC_REBOOT
  BFBInstaller->>Redfish: Poll root endpoint after reboot
  Redfish-->>BFBInstaller: Return HTTP 200 readiness response
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: switching PXE BFB firmware updates to the native BMC reboot flow.
Description check ✅ Passed The description matches the implemented changes and summarizes the native BMC_REBOOT migration accurately.
Linked Issues check ✅ Passed The PR satisfies #3504 by exporting BMC_REBOOT, removing manual reboot logic, adding bmc_custom_action4, and preserving existing steps.
Out of Scope Changes check ✅ Passed No unrelated changes are evident; the CURL_CMD refactor and debug-trace removal support the stated reboot-flow migration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@akorobkov-nvda akorobkov-nvda self-assigned this Jul 14, 2026
@akorobkov-nvda akorobkov-nvda added firmware affects host & dpu firmware bluefield Related to Bluefield provisioning / lifecycle labels Jul 14, 2026

@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: 4

🤖 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 `@pxe/templates/bmc_fw_update`:
- Around line 64-65: Update the shared CURL_CMD usage in add_db_cert so the
non-idempotent certificate POST does not use --retry-all-errors or automatic
retries. Keep retry behavior for safe operations by introducing a separate
command or per-call options, while preserving the existing authentication and
TLS settings.
- Around line 64-65: Update the shared CURL_CMD used by bmc_custom_action4() to
remove --verbose and --insecure, keeping it quiet and certificate-verified by
default. Add or retain a separate debug-only curl command that explicitly
enables those flags where diagnostic output is required, without affecting the
readiness loop or authenticated production requests.
- Around line 101-103: Update the timeout branch in the BMC readiness wait to
fail the hook by returning a nonzero status or marking the operation failed
after logging the warning. Ensure the flow cannot advance to completion when
Redfish remains unavailable, while preserving successful readiness behavior.
- Around line 94-98: Update the retry loop counters in the while block to avoid
post-increment expressions that can return failure under set -e. Replace both
tries_ok and tries increments with arithmetic assignments or prefix increments,
preserving the existing retry limits and success-count behavior.
🪄 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: c2790471-d1a4-432e-bf3f-0e1d5ab1b87e

📥 Commits

Reviewing files that changed from the base of the PR and between afd6108 and d14db5a.

📒 Files selected for processing (1)
  • pxe/templates/bmc_fw_update

Comment thread pxe/templates/bmc_fw_update
Comment thread pxe/templates/bmc_fw_update
Comment thread pxe/templates/bmc_fw_update
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

🔍 Container Scan Summary

Service Total Critical High Medium Low Other
boot-artifacts-aarch64 3 0 0 3 0 0
boot-artifacts-x86_64 3 0 0 3 0 0
forge-admin-cli-x86_64 259 13 30 78 7 131
machine-validation-runner 807 40 234 288 36 209
machine_validation 807 40 234 288 36 209
machine_validation-aarch64 807 40 234 288 36 209
nvmetal-carbide 807 40 234 288 36 209
TOTAL 3493 173 966 1236 151 967

Per-CVE detail lives in the per-service grype-* artifacts (JSON + SARIF). Severity counts only — no CVE IDs published here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bluefield Related to Bluefield provisioning / lifecycle firmware affects host & dpu firmware

Projects

Status: Verify

Development

Successfully merging this pull request may close these issues.

Use BFB native BMC_REBOOT feature instead of manual bmc_reboot call

2 participants