Skip to content

Add baremetal ABI support for NODES_PLATFORM=baremetal#1922

Open
fonta-rh wants to merge 8 commits into
openshift-metal3:masterfrom
fonta-rh:ocpedge-2775-baremetal-deploy
Open

Add baremetal ABI support for NODES_PLATFORM=baremetal#1922
fonta-rh wants to merge 8 commits into
openshift-metal3:masterfrom
fonta-rh:ocpedge-2775-baremetal-deploy

Conversation

@fonta-rh

@fonta-rh fonta-rh commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add NODES_PLATFORM=baremetal support to the agent-based installation (make agent) pipeline for deploying on real baremetal nodes via a standalone provisioning host (no libvirt)
  • Bypass three libvirt-dependent code paths: host configuration (early return after platform-agnostic setup), MAC/IP discovery (get_baremetal_ips_and_macs() reads from NODES_FILE + config vars), and ISO delivery (mount_agent_iso_baremetal() via Redfish VirtualMedia)
  • Add dnsmasq DNS configuration from BAREMETAL_API_VIP/BAREMETAL_INGRESS_VIP config vars, and document all new BAREMETAL_* variables in config_example.sh
  • Add RHEL 10 / CentOS Stream 10 support to 01_install_requirements.sh (package availability fixes, metal3-dev-env compatibility patches)
  • Add BAREMETAL_MACS config var for multi-NIC servers where PXE boot MAC ≠ data network MAC

Context

This is part of OCPEDGE-2775 — enabling Two-Node with Fencing (TNF) deployment on real baremetal hardware. A companion tool (make baremetal-adopt from OCPEDGE-2774) generates the config_baremetal_fencing.sh that exports NODES_PLATFORM=baremetal, NODES_FILE, bridge overrides, and network vars.

Target topology: standalone provisioning host without libvirt (e.g., RDU2 HPE e920t nodes with iLO BMC via Redfish).

Validated with three end-to-end deploys on RDU2 baremetal (OCP 4.22.0-rc.5 and 4.22.4), both nodes Ready, all operators Available, full TNF pipeline (auth → setup → fencing → after-setup → update-setup) completed.

Changes

File Change
01_install_requirements.sh RHEL 10/CS10 support: distro case branch, CodeReady Builder repo, Go tarball arch fix for metal3-dev-env, remove unavailable packages (genisoimage → xorriso, python3-bcrypt)
02_configure_host.sh Early return for baremetal — runs firewall, NTP, DNS, then exit 0 (skips all libvirt VM/network/pool creation)
network.sh Baremetal VIP branch in set_api_and_ingress_vip() — reads VIPs from config, calls existing configure_dnsmasq()
agent/05_agent_configure.sh New get_baremetal_ips_and_macs() with BAREMETAL_MACS support for multi-NIC servers, conditional dispatch, guard enable_isolated_baremetal_network and add_dns_entry for baremetal
agent/06_agent_create_cluster.sh New mount_agent_iso_baremetal() / eject_agent_iso_baremetal() via Redfish VirtualMedia (eject-before-insert, ISO staging for HTTP server), guard get_node0_ip()
agent/common.sh Guard getRendezvousIP() — return first BAREMETAL_IPS instead of virsh
config_example.sh Document BAREMETAL_IPS, BAREMETAL_API_VIP, BAREMETAL_INGRESS_VIP, BAREMETAL_ISO_SERVER, BAREMETAL_MACS

Design decisions

  • Early-return pattern for 02_configure_host.sh — cherry-picks only platform-agnostic operations, zero changes to existing libvirt code paths
  • User-provided BAREMETAL_ISO_SERVER — operator stages the ISO on an HTTP server reachable from BMCs; dev-scripts does not auto-start an HTTP server
  • Redfish VirtualMedia for ISO delivery — dynamically discovers CD slot from BMC's VirtualMedia collection to handle vendor differences (iLO, iDRAC, etc.)
  • BAREMETAL_MACS — optional override for data NIC MACs when they differ from PXE boot MACs (common on multi-NIC servers like HPE e920t where PXE=5C:BA:2C:*, data=b4:96:91:*)
  • RHEL 10 patches — metal3-dev-env pins genisoimage and python3-bcrypt which aren't available on RHEL 10; patched via conditional sed in the metal3-dev-env checkout

Test plan

  • shellcheck passes on all modified files (pre-existing warnings only)
  • Dry run on provisioning host: make agent with NODES_PLATFORM=baremetal config — verify early exit, dnsmasq, manifests
  • End-to-end on RDU2 HPE e920t baremetal cluster (OCP 4.22)
  • Regression: existing make agent with libvirt VMs still works (no changes to libvirt code paths)

🤖 Generated with Claude Code

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 30, 2026
@openshift-ci

openshift-ci Bot commented Jun 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign sadasu for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 30, 2026
@openshift-ci

openshift-ci Bot commented Jun 30, 2026

Copy link
Copy Markdown

Hi @fonta-rh. Thanks for your PR.

I'm waiting for a openshift-metal3 member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@fonta-rh fonta-rh force-pushed the ocpedge-2775-baremetal-deploy branch from cbd7bec to 70dc4b3 Compare June 30, 2026 13:33
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 1, 2026
@fonta-rh fonta-rh force-pushed the ocpedge-2775-baremetal-deploy branch from b0a9a0b to 15e85c1 Compare July 1, 2026 12:47
fonta-rh and others added 8 commits July 6, 2026 17:19
Enable the agent-based installation (make agent) pipeline to deploy
on real baremetal nodes via a standalone provisioning host without
libvirt. Three libvirt-dependent code paths are bypassed when
NODES_PLATFORM=baremetal:

- 02_configure_host.sh: early return after platform-agnostic setup
  (firewall, NTP, DNS, registry auth) — skips all VM/network creation
- agent/05_agent_configure.sh: new get_baremetal_ips_and_macs() reads
  MACs from NODES_FILE and IPs from BAREMETAL_IPS instead of virsh
- agent/06_agent_create_cluster.sh: new mount/eject_agent_iso_baremetal()
  delivers ISO via Redfish VirtualMedia instead of virt-xml

Also adds a baremetal VIP branch in network.sh to configure dnsmasq
DNS from BAREMETAL_API_VIP/BAREMETAL_INGRESS_VIP config vars, and
documents all new BAREMETAL_* vars in config_example.sh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The OS case statement only matched el9 variants, rejecting RHEL 10 with
a hard exit. Add rhel10/centos10 as a supported DISTRO — same baseline
as rhel9 (python3-pip, python symlink) without EPEL (unnecessary on el10).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
genisoimage is replaced by xorriso (which provides mkisofs) on RHEL 10,
and python3-bcrypt is not available in base repos. Patch the metal3-dev-env
package defaults to remove these entries on RHEL 10, following the same
sed-patch pattern used for Go tarball arch and Ansible version fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Redfish address from ironic_nodes.json includes the full API path
(e.g., redfish://host/redfish/v1/Systems/1). After parsing, the 'system'
variable contains 'host/redfish/v1/Systems/1'. Using ${system%%/Systems/*}
strips /Systems/1 but leaves /redfish/v1 in the path, causing a doubled
/redfish/v1/redfish/v1/Managers URL.

Fix: extract just the BMC hostname (${system%%/*}) into bmc_base and build
all Redfish URLs from that. The @odata.id values from Redfish responses
are already absolute paths (/redfish/v1/Managers/1), so prepending
scheme+hostname produces correct URLs.

Fixes both mount_agent_iso_baremetal and eject_agent_iso_baremetal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When NODES_PLATFORM=baremetal and 02_configure_host.sh is skipped
(no libvirt on the provisioning host), switch_to_internal_dns() was
never called. This left configure_dnsmasq() writing entries to
/etc/NetworkManager/dnsmasq.d/ that NetworkManager ignored because
the dns=dnsmasq plugin wasn't active. The installer then failed to
resolve api.<cluster>.<domain> and timed out waiting for bootstrap.

Call switch_to_internal_dns() in 05_agent_configure.sh when
NODES_PLATFORM=baremetal, before the configure_dnsmasq calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two fixes for mount_agent_iso_baremetal:

1. Eject existing VirtualMedia before InsertMedia. iLO returns
   MaxVirtualMediaConnectionEstablished when a media is already
   mounted, silently failing the insert. The subsequent Inserted
   check returned true for the OLD image, masking the failure.

2. Symlink the agent ISO from OCP_DIR into WORKING_DIR/<cluster>
   so it's accessible via the HTTP server. The ISO is generated
   under ocp/<cluster>/ (relative to dev-scripts checkout) but
   BAREMETAL_ISO_SERVER points to a URL under the HTTP server root,
   which may be WORKING_DIR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On servers with multiple NICs, the PXE boot NIC (used in
ironic_nodes.json ports) may differ from the data network NIC.
When BAREMETAL_MACS is set, get_baremetal_ips_and_macs() uses
those MACs for agent-config instead of ironic_nodes.json ports.
Falls back to existing behavior when unset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop BAREMETAL_GATEWAY from config_example.sh — nothing in dev-scripts
reads it; nodes get gateway from DHCP.

Remove registry /etc/hosts + login block from 02_configure_host.sh
baremetal path — PROVISIONING_HOST_EXTERNAL_IP resolves to the wrong
IP (computed from node subnet, not provisioning host address), and the
baremetal flow uses CI_TOKEN for registry auth, not a local registry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fonta-rh fonta-rh force-pushed the ocpedge-2775-baremetal-deploy branch from 9e87a34 to 9a9a5d6 Compare July 6, 2026 15:23
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 6, 2026
@fonta-rh fonta-rh marked this pull request as ready for review July 6, 2026 15:33
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 6, 2026
@dtantsur

dtantsur commented Jul 6, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 6, 2026
@openshift-ci

openshift-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown

@fonta-rh: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-agent-5control-ipv4 9a9a5d6 link false /test e2e-agent-5control-ipv4
ci/prow/e2e-metal-ipi-serial-ipv4-2of2 9a9a5d6 link true /test e2e-metal-ipi-serial-ipv4-2of2
ci/prow/e2e-metal-ipi-serial-ipv4-1of2 9a9a5d6 link true /test e2e-metal-ipi-serial-ipv4-1of2
ci/prow/e2e-agent-ha-dualstack 9a9a5d6 link false /test e2e-agent-ha-dualstack
ci/prow/e2e-agent-bad-dns 9a9a5d6 link false /test e2e-agent-bad-dns
ci/prow/e2e-metal-ipi-ovn-ipv4-bond 9a9a5d6 link false /test e2e-metal-ipi-ovn-ipv4-bond
ci/prow/e2e-metal-ipi-ovn-dualstack 9a9a5d6 link false /test e2e-metal-ipi-ovn-dualstack
ci/prow/e2e-metal-ipi-virtualmedia 9a9a5d6 link false /test e2e-metal-ipi-virtualmedia
ci/prow/e2e-metal-ipi-ovn-ipv4 9a9a5d6 link true /test e2e-metal-ipi-ovn-ipv4

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants