From 1a978ae545507da46578f89ec7fa139c846726ad Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 3 Mar 2020 10:47:19 +0100 Subject: [PATCH] osd: do not change pool size on erasure pool This commit adds condition in order to not try to customize pools size when its type is erasure. Signed-off-by: Guillaume Abrioux (cherry picked from commit e17c79b871600b5488148a32c994e888fff0919f) --- roles/ceph-client/tasks/create_users_keys.yml | 4 ++++ roles/ceph-mds/tasks/create_mds_filesystems.yml | 10 ++++++++-- roles/ceph-osd/tasks/openstack_config.yml | 10 ++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/roles/ceph-client/tasks/create_users_keys.yml b/roles/ceph-client/tasks/create_users_keys.yml index 04942f178..ccfe5578c 100644 --- a/roles/ceph-client/tasks/create_users_keys.yml +++ b/roles/ceph-client/tasks/create_users_keys.yml @@ -122,6 +122,8 @@ changed_when: false when: - pools | length > 0 + - item.type | default(1) | int != 3 + - item.type | default('replicated') != 'erasure' - item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size - name: customize pool min_size @@ -134,6 +136,8 @@ when: - pools | length > 0 - (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size + - item.type | default(1) | int != 3 + - item.type | default('replicated') != 'erasure' - name: assign application to pool(s) command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}" diff --git a/roles/ceph-mds/tasks/create_mds_filesystems.yml b/roles/ceph-mds/tasks/create_mds_filesystems.yml index e571bd6ed..e3a54e8c2 100644 --- a/roles/ceph-mds/tasks/create_mds_filesystems.yml +++ b/roles/ceph-mds/tasks/create_mds_filesystems.yml @@ -54,13 +54,19 @@ command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} size {{ item.size | default(osd_pool_default_size) }}" with_items: "{{ cephfs_pools | unique }}" changed_when: false - when: item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size + when: + - item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size + - item.type | default(1) | int != 3 + - item.type | default('replicated') != 'erasure' - name: customize pool min_size command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} min_size {{ item.min_size | default(osd_pool_default_min_size) }}" with_items: "{{ cephfs_pools | unique }}" changed_when: false - when: (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size + when: + - (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size + - item.type | default(1) | int != 3 + - item.type | default('replicated') != 'erasure' - name: assign application to cephfs pools command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}" diff --git a/roles/ceph-osd/tasks/openstack_config.yml b/roles/ceph-osd/tasks/openstack_config.yml index 2dcfbd6e1..a8539aff0 100644 --- a/roles/ceph-osd/tasks/openstack_config.yml +++ b/roles/ceph-osd/tasks/openstack_config.yml @@ -50,7 +50,10 @@ with_items: "{{ openstack_pools | unique }}" delegate_to: "{{ groups[mon_group_name][0] }}" changed_when: false - when: item.size | default(osd_pool_default_size) + when: + - item.size | default(osd_pool_default_size) + - item.type | default(1) | int != 3 + - item.type | default('replicated') != 'erasure' - name: customize pool min_size command: > @@ -59,7 +62,10 @@ with_items: "{{ openstack_pools | unique }}" delegate_to: "{{ groups[mon_group_name][0] }}" changed_when: false - when: (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size + when: + - (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size + - item.type | default(1) | int != 3 + - item.type | default('replicated') != 'erasure' - name: assign application to pool(s) command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}" -- 2.39.5