From 104494030403554effa1403cad02bc5e5fd76df2 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Wed, 28 Jul 2021 14:54:15 -0400 Subject: [PATCH] osds: use osd pool ls instead of osd dump command The ceph osd pool ls detail command is a subset of the ceph osd dump command. $ ceph osd dump --format json|wc -c 10117 $ ceph osd pool ls detail --format json|wc -c 4740 Signed-off-by: Dimitri Savineau (cherry picked from commit 06471a4b82d63ebb35f80d45aa6ae629a4daeedc) --- infrastructure-playbooks/rolling_update.yml | 4 ++-- ...h-from-non-containerized-to-containerized-ceph-daemons.yml | 4 ++-- roles/ceph-handler/tasks/handler_osds.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 81d0f70ec..bbe783c61 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -411,7 +411,7 @@ tasks_from: container_binary.yml - name: get pool list - command: "{{ ceph_cmd }} --cluster {{ cluster }} osd dump -f json" + command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool ls detail -f json" register: pool_list run_once: true changed_when: false @@ -426,7 +426,7 @@ - name: set_fact pools_pgautoscaler_mode set_fact: pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}" - with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}" + with_items: "{{ pool_list.stdout | default('{}') | from_json }}" - name: disable balancer command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off" diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index 4143e7de0..d7e8d48b7 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -215,7 +215,7 @@ name: ceph-facts - name: get pool list - command: "{{ ceph_cmd }} --cluster {{ cluster }} osd dump -f json" + command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool ls detail -f json" register: pool_list changed_when: false check_mode: false @@ -229,7 +229,7 @@ - name: set_fact pools_pgautoscaler_mode set_fact: pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}" - with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}" + with_items: "{{ pool_list.stdout | default('{}') | from_json }}" - name: disable balancer command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off" diff --git a/roles/ceph-handler/tasks/handler_osds.yml b/roles/ceph-handler/tasks/handler_osds.yml index e645cc722..020972948 100644 --- a/roles/ceph-handler/tasks/handler_osds.yml +++ b/roles/ceph-handler/tasks/handler_osds.yml @@ -10,7 +10,7 @@ when: trigger_restart | default(False) | bool block: - name: get pool list - command: "{{ ceph_cmd }} --cluster {{ cluster }} osd dump -f json" + command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool ls detail -f json" register: pool_list delegate_to: "{{ groups.get(mon_group_name, [])[0] }}" run_once: true @@ -29,7 +29,7 @@ set_fact: pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}" run_once: true - with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}" + with_items: "{{ pool_list.stdout | default('{}') | from_json }}" - name: disable balancer command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"