mdss: move cephfs pools creation in ceph-mds

When deploying a large number of OSD nodes it can be an issue because the
protection check [1] won't pass since it tries to create pools before all
OSDs are active.

The idea here is to move cephfs pools creation in `ceph-mds` role.

[1] e59258943b/src/mon/OSDMonitor.cc (L5673)

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1578086

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/2645/head
Guillaume Abrioux 2018-05-23 05:07:38 +02:00 committed by Sébastien Han
parent a10e73d78d
commit 3a0e168a76
5 changed files with 43 additions and 40 deletions

View File

@ -0,0 +1,37 @@
---
- name: create filesystem pools
command: "{{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd pool create {{ item.name }} {{ item.pgs }}"
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
with_items:
- "{{ cephfs_pools }}"
- name: check if ceph filesystem already exists
command: "{{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} fs get {{ cephfs }}"
register: check_existing_cephfs
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
failed_when: false
- name: create ceph filesystem
command: "{{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}"
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
when:
- check_existing_cephfs.rc != 0
- name: allow multimds
command: "{{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} fs set {{ cephfs }} allow_multimds true --yes-i-really-mean-it"
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
when:
- ceph_release_num[ceph_release] >= ceph_release_num.jewel
- ceph_release_num[ceph_release] < ceph_release_num.mimic
- name: set max_mds
command: "{{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} fs set {{ cephfs }} max_mds {{ mds_max_mds }}"
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
when:
- ceph_release_num[ceph_release] >= ceph_release_num.jewel
- mds_max_mds > 1

View File

@ -8,6 +8,11 @@
- name: include common.yml
include: common.yml
- name: include create_mds_filesystems.yml
include: create_mds_filesystems.yml
when:
- inventory_hostname == groups[mds_group_name] | first
- name: non_containerized.yml
include: non_containerized.yml
when: not containerized_deployment

View File

@ -1,32 +0,0 @@
---
- name: create filesystem pools
command: "{{ docker_exec_cmd }} ceph --cluster {{ cluster }} osd pool create {{ item.name }} {{ item.pgs }}"
changed_when: false
with_items:
- "{{ cephfs_pools }}"
- name: check if ceph filesystem already exists
command: "{{docker_exec_cmd }} ceph --cluster {{ cluster }} fs get {{ cephfs }}"
register: check_existing_cephfs
changed_when: false
failed_when: false
- name: create ceph filesystem
command: "{{ docker_exec_cmd}} ceph --cluster {{ cluster }} fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}"
changed_when: false
when:
- check_existing_cephfs.rc != 0
- name: allow multimds
command: "{{ docker_exec_cmd }} ceph --cluster {{ cluster }} fs set {{ cephfs }} allow_multimds true --yes-i-really-mean-it"
changed_when: false
when:
- ceph_release_num[ceph_release] >= ceph_release_num.jewel
- ceph_release_num[ceph_release] < ceph_release_num.mimic
- name: set max_mds
command: "{{ docker_exec_cmd }} ceph --cluster {{ cluster }} fs set {{ cephfs }} max_mds {{ mds_max_mds }}"
changed_when: false
when:
- ceph_release_num[ceph_release] >= ceph_release_num.jewel
- mds_max_mds > 1

View File

@ -50,13 +50,6 @@
when:
- openstack_keys_tmp is defined
- name: include create_mds_filesystems.yml
include: create_mds_filesystems.yml
when:
- groups[mds_group_name] is defined
- groups[mds_group_name]|length > 0
- inventory_hostname == groups[mon_group_name] | last
- name: include calamari.yml
include: calamari.yml
when: calamari

View File

@ -92,4 +92,4 @@
include: openstack_config.yml
when:
- openstack_config
- inventory_hostname == groups[osd_group_name] | last
- inventory_hostname == groups[osd_group_name] | last