Merge pull request #1043 from ceph/rbd-pg

mon: destroy and recreate rbd pool if necessary
pull/1045/head
Leseb 2016-10-22 01:32:49 +02:00 committed by GitHub
commit e616ccf894
2 changed files with 27 additions and 0 deletions

View File

@ -15,6 +15,9 @@
- cephx - cephx
- groups[restapi_group_name] is defined - groups[restapi_group_name] is defined
- include: rbd_pool.yml
when: ceph_conf_overrides.global.osd_pool_default_pg_num is defined
- include: openstack_config.yml - include: openstack_config.yml
when: openstack_config when: openstack_config

View File

@ -0,0 +1,24 @@
---
- name: check rbd pool usage
shell: |
ceph --connect-timeout 5 --cluster {{ cluster }} df | awk '/rbd/ {print $3}'
changed_when: false
failed_when: false
register: rbd_pool_df
- name: check pg num for rbd pool
shell: |
ceph --connect-timeout 5 --cluster {{ cluster }} osd pool get rbd pg_num | awk '{print $2}'
changed_when: false
failed_when: false
register: rbd_pool_pgs
- name: destroy and recreate rbd pool if osd_pool_default_pg_num is not honoured
shell: |
ceph --connect-timeout 5 --cluster {{ cluster }} osd pool rm rbd rbd --yes-i-really-really-mean-it
ceph --connect-timeout 5 --cluster {{ cluster }} osd pool create rbd {{ ceph_conf_overrides.global.osd_pool_default_pg_num }}
changed_when: false
failed_when: false
when:
- rbd_pool_df.stdout == "0"
- rbd_pool_pgs.stdout != "{{ ceph_conf_overrides.global.osd_pool_default_pg_num }}"