Check Ceph cluster healthy state before starting FS to BS playbook

The Ceph OSDs migration from filestore to bluestore should only be
attempted if the cluster is in HEALTH_OK state because during the
process OSDs will be destroyed and recreated.

This change adds a check to poll for the cluster status before the
playbook is triggered.

Change-Id: Ib9c90c4c2e838bed461ac63139b161ab689d28cf
Depends-On: https://review.opendev.org/777562
Closes-Bug: 1915700
(cherry picked from commit 5250e6d595)
(cherry picked from commit 1b57684556)
This commit is contained in:
Giulio Fidente 2021-02-15 12:01:14 +01:00
parent 33b47f4792
commit 36e28d2d36
1 changed files with 11 additions and 0 deletions

View File

@ -748,6 +748,17 @@ outputs:
fail:
msg: The ceph-ansible filestore to bluestore playbook limit is not set; please use -e ceph_ansible_limit=##nodename##
when: (ceph_ansible_limit is not defined) or (ceph_ansible_limit|length == 0)
- name: ensure ceph health is OK before proceeding
import_role:
role: ceph
tasks_from: ceph-health
vars:
fail_on_ceph_health_err: true
fail_on_ceph_health_warn: true
osd_percentage_min: 0
tripleo_delegate_to: "{{ groups['ceph_mon'] | default([]) }}"
tags:
- ceph_health
- name: set ceph_ansible_playbooks_default
set_fact:
ceph_ansible_playbooks_default: ["/usr/share/ceph-ansible/infrastructure-playbooks/filestore-to-bluestore.yml"]