From 66f09bdac4c9e8e48ecfe40bf357d9d1808de531 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Mon, 14 Nov 2016 14:25:46 -0600 Subject: [PATCH] rolling update: stop OSDs before upgrading This avoids a bug where OSDs are sometimes restarted twice on upgrades which leaves the OSD process running but not marked up. See: https://bugzilla.redhat.com/show_bug.cgi?id=1394928 https://bugzilla.redhat.com/show_bug.cgi?id=1391675 https://bugzilla.redhat.com/show_bug.cgi?id=1394929 Signed-off-by: Andrew Schoen Resolves: rhbz#1394929 --- infrastructure-playbooks/rolling_update.yml | 37 +++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index f6c16886a..a8a84dc72 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -155,6 +155,31 @@ - nodeep-scrub delegate_to: "{{ groups.mons[0] }}" + - name: get osd numbers + shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | cut -d '-' -f 2 ; fi" + register: osd_ids + changed_when: false + + - name: stop ceph osds (upstart) + service: + name: ceph-osd-all + state: stopped + when: is_upstart.stat.exists == True + + - name: stop ceph osds (sysvinit) + service: + name: ceph + state: stopped + when: is_sysvinit.stat.exists == True + + - name: stop ceph osds (systemd) + service: + name: ceph-osd@{{item}} + state: stopped + enabled: yes + with_items: "{{ osd_ids.stdout_lines }}" + when: is_systemd + roles: - ceph-common - ceph-osd @@ -172,22 +197,22 @@ register: osd_ids changed_when: false - - name: restart ceph osds (upstart) + - name: start ceph osds (upstart) service: name: ceph-osd-all - state: restarted + state: started when: is_upstart.stat.exists == True - - name: restart ceph osds (sysvinit) + - name: start ceph osds (sysvinit) service: name: ceph - state: restarted + state: started when: is_sysvinit.stat.exists == True - - name: restart ceph osds (systemd) + - name: start ceph osds (systemd) service: name: ceph-osd@{{item}} - state: restarted + state: started enabled: yes with_items: "{{ osd_ids.stdout_lines }}" when: is_systemd -- 2.39.5