Skip to content

Commit

Permalink
Trigger ceph-migration from data-plane-adoption
Browse files Browse the repository at this point in the history
This patch updates the data-plane-adoption playbook to trigger the ceph
migration when the associated variable is set. In addition, j2 related
files are added within the templates/ directory, and a set of
ceph-overrides that are relevant for the CI context are provided.

Change-Id: I9b6c304f0dbded9a19e011d3353465af3c7a7da7
Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Oct 11, 2024
1 parent d0820c7 commit a9a8bff
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 0 deletions.
2 changes: 2 additions & 0 deletions playbooks/data_plane_adoption/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[defaults]
callback_whitelist = profile_json,profile_tasks
roles_path = /home/zuul/src/github.com/openstack-k8s-operators/data-plane-adoption/tests/roles
module_utils=/home/zuul/src/github.com/openstack-k8s-operators/data-plane-adoption/tests/plugins/module_utils
library=/home/zuul/src/github.com/openstack-k8s-operators/data-plane-adoption/tests/plugins/modules
18 changes: 18 additions & 0 deletions playbooks/data_plane_adoption/ceph_overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The ceph base image is split into ns/img/tag for backward compatibility with
# tripleo modules
ceph_container_ns: registry.redhat.io/rhceph
ceph_container_image: rhceph-6-rhel9
ceph_container_tag: latest
# Ceph dashboard and Ceph ingress related images
ceph_haproxy_container_image: "registry.redhat.io/rhceph/rhceph-haproxy-rhel9:latest"
ceph_keepalived_container_image: "registry.redhat.io/rhceph/keepalived-rhel9:latest"
ceph_alertmanager_container_image: "registry.redhat.io/openshift4/ose-prometheus-alertmanager:v4.12"
ceph_grafana_container_image: "registry.redhat.io/rhceph/rhceph-6-dashboard-rhel9:latest"
ceph_node_exporter_container_image: "registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.12"
ceph_prometheus_container_image: "registry.redhat.io/openshift4/ose-prometheus:v4.12"
ceph_spec_render_dir: "/home/tripleo-admin"
ceph_daemons_layout:
monitoring: false
rbd: true
rgw: false
mds: true
74 changes: 74 additions & 0 deletions playbooks/data_plane_adoption/deploy_tripleo_run_repo_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,80 @@
ansible.builtin.shell: subscription-manager unregister
loop: "{{ groups['rh-subscription'] }}"

- name: Ceph Migration tests
when: migrate_ceph | default(false) | bool
block:
- name: Set Ceph relevant network facts
ansible.builtin.set_fact:
ceph_storage_net_prefix: "172.18.0"
ceph_nodes_ctlplane_prefix: "192.168.122"
ceph_storage_vlan_id: 21

- name: Ceph Migration - Build the list of src and target nodes
ansible.builtin.blockinfile:
marker_begin: "BEGIN ceph nodes vars"
marker_end: "END ceph nodes vars"
path: "{{ rdo_dir }}/ceph_overrides.yaml"
block: |
# CI related overrides:
# - 172.18 is the Ceph cluster storage network on vlan_id: 21
# - 172.18.0.200 is chosen as the client ip used to temporary
# access the ceph cluster from the current automation while
# migrating mons
# - 172.18.0.100 is used as VIP on the storage network is RGW
# is present
decomm_nodes:
- {{ controller0_hostname }}
- {{ controller1_hostname }}
- {{ controller2_hostname }}
target_nodes:
- {{ compute0_hostname }}
- {{ compute1_hostname }}
- {{ compute2_hostname }}
node_map:
- {"hostname": "{{ controller0_hostname }}", "ip": "{{ ceph_storage_net_prefix }}.103"}
- {"hostname": "{{ controller1_hostname }}", "ip": "{{ ceph_storage_net_prefix }}.104"}
- {"hostname": "{{ controller2_hostname }}", "ip": "{{ ceph_storage_net_prefix }}.105"}
- {"hostname": "{{ compute0_hostname }}", "ip": "{{ ceph_storage_net_prefix }}.106"}
- {"hostname": "{{ compute1_hostname }}", "ip": "{{ ceph_storage_net_prefix }}.107"}
- {"hostname": "{{ compute2_hostname }}", "ip": "{{ ceph_storage_net_prefix }}.108"}
client_node: "{{ controller0_hostname }}"
ceph_keep_mon_ipaddr: true
ceph_net_manual_migration: true
# override os-net-config conf file
os_net_conf_path: "/etc/os-net-config/tripleo_config.yaml"
ceph_storage_net_prefix: "{{ ceph_storage_net_prefix }}"
ceph_client_ip: {{ ceph_storage_net_prefix }}.200
vlan_id: {{ ceph_storage_vlan_id }}
ceph_rgw_virtual_ips_list:
- {{ ceph_storage_net_prefix }}.100/24
- name: Generate a TripleO/Ceph compatible inventory
ansible.builtin.template:
src: "{{ playbook_dir }}/templates/ceph_inventory.j2"
dest: "{{ rdo_dir }}/ceph_inventory.yaml"
vars:
inventory_map:
- {"hostname": "{{ controller0_hostname }}", "ip": "{{ ceph_nodes_ctlplane_prefix }}.103"}
- {"hostname": "{{ controller1_hostname }}", "ip": "{{ ceph_nodes_ctlplane_prefix }}.104"}
- {"hostname": "{{ controller2_hostname }}", "ip": "{{ ceph_nodes_ctlplane_prefix }}.105"}
- {"hostname": "{{ compute0_hostname }}", "ip": "{{ ceph_nodes_ctlplane_prefix }}.106"}
- {"hostname": "{{ compute1_hostname }}", "ip": "{{ ceph_nodes_ctlplane_prefix }}.107"}
- {"hostname": "{{ compute2_hostname }}", "ip": "{{ ceph_nodes_ctlplane_prefix }}.108"}

- name: "Run data-plane-adoption Ceph migration tests from {{ dpa_dir }}"
community.general.make:
chdir: "{{ dpa_dir }}"
target: "test-ceph-migration"
params:
TEST_CONFIG: "{{ dpa_test_ansible_cfg | default(rdo_dir ~ '/ansible.cfg') }}"
TEST_SECRETS: "{{ rdo_dir}}/secrets.yaml"
TEST_VARS: "{{ rdo_dir }}/vars.yaml"
TEST_CEPH_OVERRIDES: "{{ rdo_dir }}/ceph_overrides.yaml"
TEST_INVENTORY: "{{ rdo_dir }}/ceph_inventory.yaml"
register: make_ceph_res
failed_when: '"failed=0" not in make_ceph_res.stdout_lines[-1]'

- name: Call test role
when:
- dpa_run_post_adoption_tempest | default(true) | bool
Expand Down
7 changes: 7 additions & 0 deletions playbooks/data_plane_adoption/templates/ceph_inventory.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
overcloud:
hosts:
{% for h in inventory_map | default({}) %}
{{ h.hostname }}:
ansible_user: tripleo-admin
ansible_host: {{ h.ip }}
{% endfor %}
1 change: 1 addition & 0 deletions zuul.d/container-jobs-antelope-centos9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
parent: periodic-adoption-multinode-to-crc-no-ceph
vars:
use_ceph: "true"
migrate_ceph: true
dpa_test_suite: "test-with-ceph"
registry_namespace: podified-antelope-centos9
openstack_release: antelope
Expand Down

0 comments on commit a9a8bff

Please sign in to comment.