Skip to content

Add Availability Zones (AZ) scenario support - #38

Open
dlaw4608 wants to merge 1 commit into
mainfrom
az_role
Open

Add Availability Zones (AZ) scenario support#38
dlaw4608 wants to merge 1 commit into
mainfrom
az_role

Conversation

@dlaw4608

@dlaw4608 dlaw4608 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Ports the Nova + Cinder Availability Zones scenario from the legacy
openshift-ir-plugin / rhos-infrared automation into the shiftstack-qa
stages, so it can run under ci-framework on RHOSO 18.

What it does

Installs OCP IPI on OpenStack with one Nova aggregate per compute host
(one AZ each), OCP masters/workers distributed evenly across the AZs, and
rootVolumes placed on per-AZ Cinder backends. Post-install verification
asserts the OCP nodes and their root volumes landed in the expected Nova
and Cinder AZs. Day2 coverage includes worker scaleup and an AZ-aware
integrated-registry test.

Changes

  • prepare: configure_az.yml (host aggregates + per-AZ volume types),
    configure_az_ceph_crush.yml (pins each per-AZ pool to its host-local
    OSDs).
  • install: discovers Nova/Cinder AZs and renders per-role zones and
    per-AZ rootVolume types/zones into install-config.
  • verification: check_azs.yml verifies Nova and Cinder AZ placement.
  • day2ops: scaleup_worker and cinder_registry.
  • cleanup: remove_az.yml, gated by az_remove_on_cleanup.
  • jobs_definitions/availability_zones_4.22_nightly.yaml ties it together.

Backward compatibility

All AZ behaviour is gated behind az_enable / openshift_root_volumes
(default false). Existing shiftstack jobs are unaffected.

Add Availability Zones (AZ) scenario support

Ports the Nova + Cinder Availability Zones scenario from the legacy
openshift-ir-plugin / rhos-infrared automation into the shiftstack-qa
stages, so it can run under ci-framework on RHOSO 18.

What it does

Installs OCP IPI on OpenStack with one Nova aggregate per compute host
(one AZ each), OCP masters/workers distributed evenly across the AZs, and
rootVolumes placed on per-AZ Cinder backends. Post-install verification
asserts the OCP nodes and their root volumes landed in the expected Nova
and Cinder AZs. Day2 coverage includes worker scaleup and an AZ-aware
integrated-registry test.

Changes

  • prepare: configure_az.yml (host aggregates + per-AZ volume types),
    configure_az_ceph_crush.yml (pins each per-AZ pool to its host-local
    OSDs).
  • install: discovers Nova/Cinder AZs and renders per-role zones and
    per-AZ rootVolume types/zones into install-config.
  • verification: check_azs.yml verifies Nova and Cinder AZ placement.
  • day2ops: scaleup_worker and cinder_registry.
  • cleanup: remove_az.yml, gated by az_remove_on_cleanup.
  • jobs_definitions/availability_zones_4.22_nightly.yaml ties it together.

@openshift-ci

openshift-ci Bot commented Sep 4, 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 ask for approval from dlaw4608. 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

register: registry_pod
retries: 60
delay: 10
until:

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.

We need to check registry_pod.resources | length > 0 before referencing registry_pod.resources[0]. If this task executes while the pod is being recreated and the query returns an empty resources list, Ansible will throw a fatal list index out of range Python evaluation error and crash immediately instead of retrying.
Maybe this better way to write it WDYT?
until:
- registry_pod.resources | length > 0
- registry_pod.resources[0].spec.volumes[0].persistentVolumeClaim is defined
- registry_pod.resources[0].spec.volumes[0].persistentVolumeClaim.claimName == "pvc-registry"
- registry_pod.resources[0].status is defined
- registry_pod.resources[0].status.phase == "Running"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, added the new condition.


- name: Add registry domain resolution to /etc/hosts
block:
- name: Resolve apps ingress IP from /etc/hosts

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.

Matching only $2 in awk ($2 ~ "apps...") assumes the wildcard domain is always the second column in /etc/hosts. Depending on how /etc/hosts was formatted by earlier stages or local resolution, the entry might have multiple hostnames/aliases where the apps domain sits in column $3 or beyond. Using grep with awk '{print $1}' ensures we reliably extract the IP address regardless of line ordering.

grep -E "apps.{{ ocp_cluster_name }}" /etc/hosts | awk '{print $1}' | head -n 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The original logic was ported from openshift-ir-plugin, but this looks like a reasonable change to me.

- machine.openshift.io/cluster-api-machine-type=worker
register: ms_worker

- name: Set the expected workers replicas

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.

When az_enable: true is set, OpenShift IPI provisions multiple worker MachineSets (one per Availability Zone). Standard k8s_info will return a list of all matching worker MachineSets, so taking resources[0] will arbitrarily scale only the first AZ's MachineSet.

Can we update this procedure to either iterate over all returned worker MachineSets or target a specific AZ/MachineSet name explicitly so scale-up works predictably in multi-AZ environments?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Similar as the /etc/hosts apps IP lookup, this was ported to follow the same logic as in openshift-ir-plugin. But your suggestion makes sense, to scale predictably across all worker MachineSets, Updated to loop over each MachineSet (sorted by name)

@dlaw4608
dlaw4608 force-pushed the az_role branch 3 times, most recently from bfbf9b9 to 569888c Compare September 7, 2026 13:35
Port the Nova + Cinder Availability Zones scenario from the legacy
openshift-ir-plugin / rhos-infrared automation into the shiftstack-qa
stages. The AZ job installs OCP IPI on OpenStack with one Nova aggregate
per compute host (one AZ each), OCP masters/workers distributed evenly
across the AZs, and rootVolumes placed on per-AZ Cinder backends. Post-
install verification asserts the OCP nodes and their root volumes landed
in the expected Nova and Cinder AZs.

Stages/roles:
- prepare: configure_az.yml creates host aggregates + per-AZ volume types,
  configure_az_ceph_crush.yml pins each per-AZ pool to its host-local OSDs.
- install: discovers Nova/Cinder AZs (tools_cluster_checks/discover_az.yml)
  and renders zones + per-AZ rootVolume types/zones into install-config.
- verification: check_azs.yml verifies Nova and Cinder AZ placement.
- day2ops: scaleup_worker and cinder_registry (AZ-aware registry storage).
- cleanup: remove_az.yml tears down aggregates and AZ volume types, gated
  by az_remove_on_cleanup.
- jobs_definitions/availability_zones_4.22_nightly.yaml wires it together.

All AZ behaviour is gated behind az_enable / openshift_root_volumes
(default false), so non-AZ jobs are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Change-Id: I45bdf61b3bc8e270c950e2e07590a736a9cd81ce
Signed-off-by: Daniel Lawton <dlawton@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants