]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osds: use osd pool ls instead of osd dump command
authorDimitri Savineau <dsavinea@redhat.com>
Wed, 28 Jul 2021 18:54:15 +0000 (14:54 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 2 Aug 2021 13:51:01 +0000 (15:51 +0200)
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 <dsavinea@redhat.com>
infrastructure-playbooks/cephadm-adopt.yml
infrastructure-playbooks/rolling_update.yml
infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml
roles/ceph-handler/tasks/handler_osds.yml

index ddc2993a3e9e5b70d356287536eb8b6a188b101a..b4ebe655f64f584baf836efc84c458560cefda14 100644 (file)
         name: ceph-defaults
 
     - 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
       delegate_to: "{{ groups[mon_group_name][0] }}"
       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"
index 06449eb745ae66e57ae9ea3d6193762f322257c1..6c248bd20ee07aecd410f3ea1214a8b1fd9a7f20 100644 (file)
         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
     - 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"
index df9b13098448a3ab6da394bec8a9e47030e59572..2b4b289e395eb25ed5cc94d82e8aa35bd2013c9b 100644 (file)
         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
       changed_when: false
       check_mode: false
     - 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"
index b34e88f0d2764980d6851d75bfb44b861296e0b2..204e099785ee92931af2add4aa6922ec241f6568 100644 (file)
@@ -39,7 +39,7 @@
         mode: 0750
 
     - 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
@@ -58,7 +58,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"