Skip to content

Commit 77c5ed6

Browse files
rebtooropenshift-merge-bot[bot]
authored andcommitted
[multiple] Add per-node BMH label for deterministic node assignment
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 Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
1 parent fffa721 commit 77c5ed6

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

roles/ci_gen_kustomize_values/templates/common/edpm-nodeset-values/values.yaml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ data:
4646
nodes:
4747
{% for instance in instances_names %}
4848
edpm-{{ instance }}:
49+
{% if not (cifmw_edpm_deploy_pre_provisioned | default(true) | bool) %}
50+
bmhLabelSelector:
51+
nodeName: {{ instance }}
52+
{% endif %}
4953
ansible:
5054
ansibleHost: {{ cifmw_networking_env_definition.instances[instance].networks.ctlplane[_ipv.ip_vX] }}
5155
hostName: {{ instance }}

roles/deploy_bmh/template/bmh.yml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ metadata:
1111
labels:
1212
app: {{ node_data['label'] | default("openstack") }}
1313
workload: {{ node_name.split('-')[0] }}
14+
nodeName: {{ node_name }}
1415
{% if 'extra_labels' in node_data %}
1516
{% for label,key in node_data['extra_labels'].items() %}
1617
{{ label }}: {{ key }}

0 commit comments

Comments
 (0)