Merge pull request #1214 from ceph/rbd-pool-size

mon: make sure osd_pool_default_size is honoured
pull/1252/head
Andrew Schoen 2017-01-25 17:10:29 -06:00 committed by GitHub
commit 625ee0952e
4 changed files with 44 additions and 11 deletions

View File

@ -20,7 +20,7 @@
- name: test if initial mon keyring is in mon kv store - name: test if initial mon keyring is in mon kv store
command: ceph --cluster {{ cluster }} config-key get initial_mon_keyring command: ceph --cluster {{ cluster }} config-key get initial_mon_keyring
changed_when: false changed_when: false
failed_when: false ignore_errors: true
always_run: true always_run: true
run_once: true run_once: true
register: is_initial_mon_keyring_in_kv register: is_initial_mon_keyring_in_kv
@ -80,8 +80,24 @@
osd_pool_default_pg_num: "{{ ceph_conf_overrides.global.osd_pool_default_pg_num }}" osd_pool_default_pg_num: "{{ ceph_conf_overrides.global.osd_pool_default_pg_num }}"
when: ceph_conf_overrides.global.osd_pool_default_pg_num is defined when: ceph_conf_overrides.global.osd_pool_default_pg_num is defined
- name: test if rbd exists
command: ceph --cluster {{ cluster }} osd pool stats rbd
changed_when: false
failed_when: false
register: rbd_pool_exist
- include: rbd_pool.yml - include: rbd_pool.yml
when: ceph_conf_overrides.global.osd_pool_default_pg_num is defined when: rbd_pool_exist.rc == 0
- include: rbd_pool_pgs.yml
when:
- rbd_pool_exist.rc == 0
- ceph_conf_overrides.global.osd_pool_default_pg_num is defined
- include: rbd_pool_size.yml
when:
- rbd_pool_exist.rc == 0
- ceph_conf_overrides.global.osd_pool_default_size is defined
- include: openstack_config.yml - include: openstack_config.yml
when: openstack_config when: openstack_config

View File

@ -15,12 +15,3 @@
always_run: true always_run: true
register: rbd_pool_pgs 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 }}"

View File

@ -0,0 +1,10 @@
---
- 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 }}"

View File

@ -0,0 +1,16 @@
---
- name: check size for rbd pool
shell: |
ceph --connect-timeout 5 --cluster {{ cluster }} osd pool get rbd size | awk '{print $2}'
changed_when: false
failed_when: false
always_run: true
register: rbd_pool_size
- name: change rbd pool size if osd_pool_default_size is not honoured
command: ceph --connect-timeout 5 --cluster {{ cluster }} osd pool set rbd size {{ ceph_conf_overrides.global.osd_pool_default_size }}
changed_when: false
failed_when: false
when:
- rbd_pool_df.stdout == "0"
- rbd_pool_size.stdout != "{{ ceph_conf_overrides.global.osd_pool_default_size }}"