From: Dimitri Savineau Date: Mon, 19 Oct 2020 21:22:31 +0000 (-0400) Subject: switch2container: disable ceph-osd enabled-runtime X-Git-Tag: v6.0.0alpha3~60 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fa2bb3af86b48befd3901939d38eda20dff6f5e5;p=ceph-ansible.git switch2container: disable ceph-osd enabled-runtime When deploying the ceph OSD via the packages then the ceph-osd@.service unit is configured as enabled-runtime. This means that each ceph-osd service will inherit from that state. The enabled-runtime systemd state doesn't survive after a reboot. For non containerized deployment the OSD are still starting after a reboot because there's the ceph-volume@.service and/or ceph-osd.target units that are doing the job. $ systemctl list-unit-files|egrep '^ceph-(volume|osd)'|column -t ceph-osd@.service enabled-runtime ceph-volume@.service enabled ceph-osd.target enabled When switching to containerized deployment we are stopping/disabling ceph-osd@XX.servive, ceph-volume and ceph.target and then removing the systemd unit files. But the new systemd units for containerized ceph-osd service will still inherit from ceph-osd@.service unit file. As a consequence, if an OSD host is rebooting after the playbook execution then the ceph-osd service won't come back because they aren't enabled at boot. This patch also adds a reboot and testinfra run after running the switch to container playbook. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1881288 Signed-off-by: Dimitri Savineau --- diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index 054029920..bc7943db3 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -240,6 +240,14 @@ changed_when: false failed_when: false + # systemd module does not support --runtime option + - name: disable ceph-osd@.service runtime-enabled + command: "systemctl disable --runtime {{ item }}" + changed_when: false + failed_when: false + with_items: "{{ running_osds.stdout_lines | default([])}}" + when: item.startswith('ceph-osd@') + - name: stop/disable/mask non-containerized ceph osd(s) (if any) systemd: name: "{{ item }}" diff --git a/tox.ini b/tox.ini index 3c1623dc7..55e9b7cbd 100644 --- a/tox.ini +++ b/tox.ini @@ -145,6 +145,10 @@ commands= py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-switch-to-containers --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests + ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/reboot.yml + + py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-switch-to-containers --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests + [add-mons] commands= ansible-playbook -vv -i {changedir}/hosts-2 --limit mon1 {toxinidir}/tests/functional/setup.yml