Skip to content

Fix variable collisions in orchestrator provisioning - #5134

Closed
SAYUK09 wants to merge 3 commits into
issue-4849-omnia-modernizationfrom
fix/orchestrator-kubernetes
Closed

Fix variable collisions in orchestrator provisioning#5134
SAYUK09 wants to merge 3 commits into
issue-4849-omnia-modernizationfrom
fix/orchestrator-kubernetes

Conversation

@SAYUK09

@SAYUK09 SAYUK09 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Fix Variable Collisions in Orchestrator Provisioning

Problem

The orchestrator.yml playbook was failing due to multiple variable precedence and collision issues that prevented successful completion of the provisioning workflow.

Root Causes

1. cluster_name collision

The k8s_config role was setting cluster_name via set_fact, which unintentionally overrode the OpenCHAMI cluster_name during the Slurm provisioning pass. As a result, metadata-service health checks were executed against an incorrect cluster identity, causing failures in the provisioning flow.

2. nodes variable collision

A generic nodes variable was defined as a host-scoped dictionary in configure_boot_svc.yml. Because set_fact variables persist across plays, this host-scoped value conflicted with later usages of vars: nodes: in templates and tasks. This resulted in errors such as:

object of type 'dict' has no attribute 'XNAME'

Solution

1. Pin OpenCHAMI cluster_name using set_fact

Added an explicit set_fact at the beginning of register_nodes.yml to ensure the correct OpenCHAMI cluster identity is always used.

Changes include:

  • Extracting cluster_name and cluster_domain directly from the configuration file using json_query
  • Preserving the intended OpenCHAMI values throughout the workflow
  • Preventing stale set_fact values from shadowing the correct configuration during the Slurm pass

2. Rename nodes variables to avoid host-scoped collisions

Replaced generic nodes references with context-specific variable names to eliminate conflicts across plays, tasks, and templates.

Renamed variables:

  • boot_svc_nodes

    • configure_boot_svc.yml
    • boot-svc.yaml.j2
    • configure_boot_svc_metadata_svc.yml
  • smd_group_nodes

    • create_smd_group.yml
    • groups.yaml.j2
    • create_groups.yml
    • create_groups_additional_fg.yml
    • groups_additional_fg.yaml.j2
  • mapping_nodes

    • hostname.yaml.j2
    • register_nodes.yml

Additional Fixes

  • Fixed undefined kube_vip references in metadata-service templates
  • Fixed service_k8s_version extraction from the catalog
  • Added fallback handling when service_k8s_v.json is missing
  • Double-escaped cloud-init Jinja variables in metadata-service templates
  • Fixed packages_base_dir variable precedence collision
  • Fixed offline_tarball_path propagation
  • Fixed image validation _first suffix mismatch

Result

These changes resolve variable precedence and collision issues within the provisioning workflow, ensure consistent cluster identity throughout the orchestration process, and eliminate cross-play variable contamination that was causing template rendering and node registration failures.

This commit resolves multiple variable precedence and collision issues
that were preventing the orchestrator.yml playbook from completing
successfully.

1. cluster_name collision: k8s_config set_fact overrode openchami cluster_name
   - Pin openchami cluster_name at set_fact level in register_nodes.yml
   - Ensures metadata-service health checks use correct cluster identity

2. nodes variable collision: configure_boot_svc set_fact persisted across plays
   - Renamed bare 'nodes' references to avoid collisions:
     * boot_svc_nodes - for boot-service templates
     * smd_group_nodes - for SMD group templates
     * mapping_nodes - for hostname/node templates
   - Updated all affected templates and task files

3. Additional fixes from previous session:
   - Fixed kube_vip undefined in metadata-service templates
   - Fixed service_k8s_version extraction from catalog
   - Added fallback for missing service_k8s_v<version>.json
   - Double-escaped cloud-init Jinja vars in metadata-service templates
   - Fixed packages_base_dir variable precedence collision
   - Fixed offline_tarball_path propagation
   - Fixed image validation _first suffix mismatch

Signed-off-by: sayuri <sayuri.kamble@dell.com>
- Remove debug tasks from register_nodes.yml (Jinja templates in name)
- Fix line length issues by using YAML folding
- Fix key order (when before block) in configure_metadata_svc.yml

Signed-off-by: sayuri <sayuri.kamble@dell.com>
- Split long Jinja line for calico_cidr calculation
- Remove duplicate 'when' clause (outer block already has the condition)

Signed-off-by: sayuri <sayuri.kamble@dell.com>
show_task_path_on_failure = false
stdout_callback = omnia_default
show_task_path_on_failure = true
stdout_callback = default

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

omnia_default should be used. any reason for change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

was added for debugging purposes

@SAYUK09

SAYUK09 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this PR. As this change has been addressed in PR

@SAYUK09 SAYUK09 closed this Sep 3, 2026
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.

2 participants