-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1976 from ceph/rbd_pool
Only perform actions on the rbd pool after it has been created
- Loading branch information
Showing
27 changed files
with
104 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
--- | ||
- name: check rbd pool usage | ||
- name: test if rbd exists | ||
shell: | | ||
ceph --connect-timeout 5 --cluster {{ cluster }} df | awk '/rbd/ {print $3}' | ||
"{{ docker_exec_cmd }} ceph --cluster {{ cluster }} osd pool ls | grep -sq rbd" | ||
changed_when: false | ||
failed_when: false | ||
always_run: true | ||
register: rbd_pool_df | ||
run_once: true | ||
check_mode: true | ||
register: rbd_pool_exist | ||
|
||
- 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 | ||
always_run: true | ||
register: rbd_pool_pgs | ||
- name: include rbd_pool_df.yml | ||
include: rbd_pool_df.yml | ||
when: rbd_pool_exist.rc == 0 | ||
|
||
- name: include rbd_pool_pgs.yml | ||
include: rbd_pool_pgs.yml | ||
when: | ||
- rbd_pool_exist.rc == 0 | ||
- ceph_conf_overrides.get('global', {}).get('osd_pool_default_pg_num', False) != False | ||
|
||
- name: include rbd_pool_size.yml | ||
include: rbd_pool_size.yml | ||
when: | ||
- rbd_pool_exist.rc == 0 | ||
- ceph_conf_overrides.get('global', {}).get('osd_pool_default_pg_num', False) != False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
- name: verify that rbd pool exist | ||
fail: | ||
msg: "rbd pool does not exist in rbd_pool_df" | ||
when: rbd_pool_exist.rc == 0 | ||
|
||
- name: check rbd pool usage | ||
shell: | | ||
"{{ docker_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} df | awk '/rbd/ {print $3}'" | ||
changed_when: false | ||
failed_when: false | ||
check_mode: true | ||
run_once: true | ||
register: rbd_pool_df |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
--- | ||
- name: verify that rbd pool exist | ||
fail: | ||
msg: "rbd pool does not exist in rbd_pool_pgs" | ||
when: rbd_pool_exist.rc == 0 | ||
|
||
- name: check pg num for rbd pool | ||
shell: | | ||
"{{ docker_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool get rbd pg_num | awk '{print $2}'" | ||
changed_when: false | ||
failed_when: false | ||
check_mode: true | ||
run_once: true | ||
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 }} | ||
"{{ docker_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool delete rbd rbd --yes-i-really-really-mean-it" | ||
"{{ docker_exec_cmd }} 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 | ||
run_once: true | ||
when: | ||
- rbd_pool_df.stdout == "0" | ||
- rbd_pool_pgs.stdout != "{{ ceph_conf_overrides.global.osd_pool_default_pg_num }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
--- | ||
- name: verify that rbd pool exist | ||
fail: | ||
msg: "rbd pool does not exist in rbd_pool_size" | ||
when: rbd_pool_exist.rc == 0 | ||
|
||
- name: check size for rbd pool | ||
shell: | | ||
ceph --connect-timeout 5 --cluster {{ cluster }} osd pool get rbd size | awk '{print $2}' | ||
"{{ docker_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool get rbd size | awk '{print $2}'" | ||
changed_when: false | ||
failed_when: false | ||
always_run: true | ||
check_mode: true | ||
run_once: 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 }} | ||
command: "{{ docker_exec_cmd }} 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 | ||
run_once: true | ||
when: | ||
- rbd_pool_df.stdout == "0" | ||
- rbd_pool_size.stdout != "{{ ceph_conf_overrides.global.osd_pool_default_size }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.