Skip to content

[multiple] Add per-node BMH label for deterministic node assignment#3890

Merged
openshift-merge-bot[bot] merged 1 commit intoopenstack-k8s-operators:mainfrom
rebtoor:labels-bmh
Apr 28, 2026
Merged

[multiple] Add per-node BMH label for deterministic node assignment#3890
openshift-merge-bot[bot] merged 1 commit intoopenstack-k8s-operators:mainfrom
rebtoor:labels-bmh

Conversation

@rebtoor
Copy link
Copy Markdown
Contributor

@rebtoor rebtoor commented Apr 24, 2026

When preProvisioned: false, the OSDPO's OpenStackBaremetalSet assigns BareMetalHost CRs to NodeSet nodes non-deterministically (OSPRH-10282). This causes hostname shuffling: a node provisioned from BMH compute-0 may receive the hostname of compute-2, breaking services that depend on hostname correctness (e.g. Ceph orch apply fails with "hostname does not match expected hostname").

Fix by establishing a 1-to-1 mapping between BMH CRs and NodeSet nodes using per-node bmhLabelSelector:

  • deploy_bmh template: add a nodeName label to every BMH CR,
    set to the node's name (e.g. nodeName: compute-0).

  • ci_gen_kustomize_values common edpm-nodeset-values template: when cifmw_edpm_deploy_pre_provisioned is false, emit a per-node bmhLabelSelector: {nodeName: <instance>} so each NodeSet node selects its specific BMH by label.

Pre-provisioned deployments are unaffected (the bmhLabelSelector is only emitted when cifmw_edpm_deploy_pre_provisioned is false, which defaults to true).

Depends-On: #3884
Depends-On: openstack-k8s-operators/architecture#746
Related-to: ANVIL-108

When `preProvisioned: false`, the OSDPO's `OpenStackBaremetalSet`
assigns BareMetalHost CRs to NodeSet nodes non-deterministically
(OSPRH-10282).  This causes hostname shuffling: a node provisioned
from BMH `compute-0` may receive the hostname of `compute-2`,
breaking services that depend on hostname correctness (e.g. Ceph
`orch apply` fails with "hostname does not match expected hostname").

Fix by establishing a 1-to-1 mapping between BMH CRs and NodeSet
nodes using per-node `bmhLabelSelector`:

- `deploy_bmh` template: add a `nodeName` label to every BMH CR,
  set to the node's name (e.g. `nodeName: compute-0`).

- `ci_gen_kustomize_values` common edpm-nodeset-values template:
  when `cifmw_edpm_deploy_pre_provisioned` is `false`, emit a
  per-node `bmhLabelSelector: {nodeName: <instance>}` so each
  NodeSet node selects its specific BMH by label.

Pre-provisioned deployments are unaffected (the `bmhLabelSelector`
is only emitted when `cifmw_edpm_deploy_pre_provisioned` is false,
which defaults to true).

Depends-On: openstack-k8s-operators#3884
Depends-On: openstack-k8s-operators/architecture#746
Related-to: ANVIL-108

Co-authored-by: Claude <noreply@anthropic.com>

Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
@rebtoor rebtoor requested a review from a team April 28, 2026 06:35
Copy link
Copy Markdown
Contributor

@evallesp evallesp left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 28, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: evallesp

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

The pull request process is described 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-merge-bot openshift-merge-bot Bot merged commit 77c5ed6 into openstack-k8s-operators:main Apr 28, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants