Skip to content

Commit

Permalink
Extend hostnamemap for multi-cell deployments
Browse files Browse the repository at this point in the history
Support deployment of single cell HA tripleo,
and multi-cell non-HA reduced footrpint.

Re-tartget data-plane-adoption-osp17-multinode-to-extracted-crc-no-ceph
for multi-cell setup scenario in order to develop it via node autoholds
(there is no other way to deploy).

JIRA https://issues.redhat.com/browse/OSPRH-6548

Depends-On: openstack-k8s-operators/install_yamls#826
Depends-On: openstack-k8s-operators/ci-framework#1683

Change-Id: I6712a0843b992d7c8ccc91be93bce04fd31fcd08
Signed-off-by: Bogdan Dobrelya <[email protected]>
  • Loading branch information
bogdando committed May 31, 2024
1 parent dee9f65 commit 4c774fd
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 29 deletions.
6 changes: 6 additions & 0 deletions playbooks/data_plane_adoption/files/hostnamemap.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
parameter_defaults:
HostnameMap:
overcloud-controller-0: "{{ controller_0_hostname }}"
{% if not multi_cell | default(False) | bool %}
overcloud-controller-1: "{{ controller_1_hostname }}"
overcloud-controller-2: "{{ controller_2_hostname }}"
overcloud-novacompute-0: "{{ compute_0_hostname }}"
{% else %}
cell1-controller-0: "{{ compute_0_hostname }}"
cell1-compute-0: "{{ compute_1_hostname }}"
cell2-controller-compute-0: "{{ compute_2_hostname }}"
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@
DATAPLANE_DNS_SERVER: "{{ standalone_gateway }}"
HOST_PRIMARY_RESOLV_CONF_ENTRY: "{{ standalone_gateway }}"
EDPM_COMPUTE_CEPH_ENABLED: "{{ use_ceph | default('true') }}"
EDPM_COMPUTE_CEPH_NOVA: "{{ use_ceph | default('true') }}"
EDPM_COMPUTE_CELLS: "{% if multi_cell | default('false') %}3{% else %}1{% endif %}"
65 changes: 46 additions & 19 deletions playbooks/data_plane_adoption/setup_tripleo_hostnamemap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,50 @@
vars:
rdo_dir: "review.rdoproject.org/rdo-jobs/playbooks/data_plane_adoption"
tasks:
- name: Fetch ansible hostnames from the controllers
delegate_to: "overcloud-{{ item }}"
ansible.builtin.slurp:
path: /home/zuul/ansible_hostname
register: "tripleo_hostnames"
with_items:
- controller-0
- controller-1
- controller-2
- novacompute-0
- name: Multi-cell non-HA reduced footprint deployment
when: multi_cell | default(False) | bool
block:
- name: Fetch ansible hostnames from the controllers
delegate_to: "{{ item }}"
ansible.builtin.slurp:
path: /home/zuul/ansible_hostname
register: "tripleo_hostnames"
with_items:
- overcloud-controller-0
- cell1-controller-0
- cell1-compute-0
- cell2-controller-compute-0

- name: Template out hostnamemap with tripleo hostnames
ansible.builtin.template:
src: "{{ zuul.executor.src_root }}/{{ rdo_dir }}/files/hostnamemap.yaml.j2"
dest: /home/zuul/hostnamemap.yaml
vars:
controller_0_hostname: "{{ tripleo_hostnames.results[0]['content'] | b64decode | trim }}"
controller_1_hostname: "{{ tripleo_hostnames.results[1]['content'] | b64decode | trim }}"
controller_2_hostname: "{{ tripleo_hostnames.results[2]['content'] | b64decode | trim }}"
compute_0_hostname: "{{ tripleo_hostnames.results[3]['content'] | b64decode | trim }}"
- name: Template out hostnamemap with tripleo hostnames
ansible.builtin.template:
src: "{{ zuul.executor.src_root }}/{{ rdo_dir }}/files/hostnamemap.yaml.j2"
dest: /home/zuul/hostnamemap.yaml
vars:
controller_0_hostname: "{{ tripleo_hostnames.results[0]['content'] | b64decode | trim }}"
compute_0_hostname: "{{ tripleo_hostnames.results[1]['content'] | b64decode | trim }}"
compute_1_hostname: "{{ tripleo_hostnames.results[2]['content'] | b64decode | trim }}"
compute_2_hostname: "{{ tripleo_hostnames.results[3]['content'] | b64decode | trim }}"

- name: Single-cell HA deployment
when: not multi_cell | default(False) | bool
block:
- name: Fetch ansible hostnames from the controllers
delegate_to: "overcloud-{{ item }}"
ansible.builtin.slurp:
path: /home/zuul/ansible_hostname
register: "tripleo_hostnames"
with_items:
- controller-0
- controller-1
- controller-2
- novacompute-0

- name: Template out hostnamemap with tripleo hostnames
ansible.builtin.template:
src: "{{ zuul.executor.src_root }}/{{ rdo_dir }}/files/hostnamemap.yaml.j2"
dest: /home/zuul/hostnamemap.yaml
vars:
controller_0_hostname: "{{ tripleo_hostnames.results[0]['content'] | b64decode | trim }}"
controller_1_hostname: "{{ tripleo_hostnames.results[1]['content'] | b64decode | trim }}"
controller_2_hostname: "{{ tripleo_hostnames.results[2]['content'] | b64decode | trim }}"
compute_0_hostname: "{{ tripleo_hostnames.results[3]['content'] | b64decode | trim }}"
3 changes: 3 additions & 0 deletions playbooks/data_plane_adoption/vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ auth_url: http://keystone-public-openstack.apps-crc.testing

# Set verbose logging for CI jobs (no secrets here)
use_no_log: false

# Adopt source cloud with additional compute cells v2
multi_cell: false
21 changes: 11 additions & 10 deletions zuul.d/_data_plane_adoption.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- name: openstack-k8s-operators/ci-framework
override-checkout: main
- rdo-jobs
roles:
roles: &adoption_common_roles
- zuul: rdo-jobs
- zuul: github.com/openstack-k8s-operators/ci-framework
pre-run:
Expand Down Expand Up @@ -52,13 +52,11 @@
dpa_test_suite: "test-minimal"

- job:
# TODO: remove this job after HCI ceph multi-cell done
name: data-plane-adoption-osp17-multinode-to-extracted-crc-no-ceph
abstract: true
parent: cifmw-adoption-base-source-multinode
parent: cifmw-adoption-base-source-multinode-novacells
required-projects: *dpa_required_projects
roles:
- zuul: rdo-jobs
- zuul: github.com/openstack-k8s-operators/ci-framework
roles: *adoption_common_roles
pre-run:
- playbooks/data_plane_adoption/subnode_ip.yaml
- playbooks/data_plane_adoption/setup_crc_use_install_yamls_extracted_crc.yaml
Expand All @@ -73,21 +71,24 @@
- playbooks/data_plane_adoption/set_zuul_artifacts.yaml
- playbooks/force_job_failure.yaml
vars:
use_ceph: "true"
use_ceph: false
multi_cell: true
standalone_ip: 192.168.122.100
standalone_gateway: 192.168.122.10
standalone_private_key: /home/zuul/.ssh/id_rsa
os_net_config_file: "overcloud_net_config.j2"
os_net_config_file: "overcloud_net_config_leafs.j2"
host-vars:
undercloud:
address_suffix: 100
os_net_config_file: "net_config.j2"
overcloud-controller-0:
address_suffix: 103
overcloud-controller-1:
cell1-compute-0:
address_suffix: 104
overcloud-controller-2:
cell2-controller-compute-0:
address_suffix: 105
overcloud-novacompute-0:
cell1-controller-0:
address_suffix: 106

- job:
Expand Down

0 comments on commit 4c774fd

Please sign in to comment.