From 99468b03bce68679851119530aeb023657e977c0 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Fri, 10 May 2024 13:16:10 +0200 Subject: [PATCH] Extend hostnamemap for multi-cell deployments 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. JIRA https://issues.redhat.com/browse/OSPRH-6548 External dependency https://github.com/openstack-k8s-operators/ci-framework/pull/1683 Change-Id: I6712a0843b992d7c8ccc91be93bce04fd31fcd08 Signed-off-by: Bogdan Dobrelya --- .../files/hostnamemap.yaml.j2 | 6 ++ .../install_yamls_deploy_tripleo.yaml | 2 + .../setup_tripleo_hostnamemap.yaml | 65 +++++++++++++------ playbooks/data_plane_adoption/vars.yaml | 3 + zuul.d/_data_plane_adoption.yaml | 24 +++++-- 5 files changed, 77 insertions(+), 23 deletions(-) diff --git a/playbooks/data_plane_adoption/files/hostnamemap.yaml.j2 b/playbooks/data_plane_adoption/files/hostnamemap.yaml.j2 index 94e528df9e..10dd30af50 100644 --- a/playbooks/data_plane_adoption/files/hostnamemap.yaml.j2 +++ b/playbooks/data_plane_adoption/files/hostnamemap.yaml.j2 @@ -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 %} diff --git a/playbooks/data_plane_adoption/install_yamls_deploy_tripleo.yaml b/playbooks/data_plane_adoption/install_yamls_deploy_tripleo.yaml index 894b2107fb..cf8b7bbc08 100644 --- a/playbooks/data_plane_adoption/install_yamls_deploy_tripleo.yaml +++ b/playbooks/data_plane_adoption/install_yamls_deploy_tripleo.yaml @@ -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 %}" diff --git a/playbooks/data_plane_adoption/setup_tripleo_hostnamemap.yaml b/playbooks/data_plane_adoption/setup_tripleo_hostnamemap.yaml index 46376ac15f..ff03aea38d 100644 --- a/playbooks/data_plane_adoption/setup_tripleo_hostnamemap.yaml +++ b/playbooks/data_plane_adoption/setup_tripleo_hostnamemap.yaml @@ -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 }}" diff --git a/playbooks/data_plane_adoption/vars.yaml b/playbooks/data_plane_adoption/vars.yaml index 5585a71512..9525704c6a 100644 --- a/playbooks/data_plane_adoption/vars.yaml +++ b/playbooks/data_plane_adoption/vars.yaml @@ -23,3 +23,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 \ No newline at end of file diff --git a/zuul.d/_data_plane_adoption.yaml b/zuul.d/_data_plane_adoption.yaml index 1784bae0d1..15fff8a035 100644 --- a/zuul.d/_data_plane_adoption.yaml +++ b/zuul.d/_data_plane_adoption.yaml @@ -52,7 +52,7 @@ - job: 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 @@ -70,6 +70,8 @@ - playbooks/data_plane_adoption/set_zuul_artifacts.yaml - playbooks/force_job_failure.yaml vars: + 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 @@ -80,15 +82,29 @@ 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: name: data-plane-adoption-osp17-multinode-to-extracted-crc-with-ceph parent: data-plane-adoption-osp17-multinode-to-extracted-crc-no-ceph + nodeset: cifmw-adoption-base-source-multinode vars: use_ceph: 'true' + multi_cell: 'false' + host-vars: + undercloud: + address_suffix: 100 + os_net_config_file: "net_config.j2" + overcloud-controller-0: + address_suffix: 103 + overcloud-controller-1: + address_suffix: 104 + overcloud-controller-2: + address_suffix: 105 + overcloud-novacompute-0: + address_suffix: 106