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 <dsavinea@redhat.com>
(cherry picked from commit 06471a4b82)
pull/6790/head
Dimitri Savineau 2021-07-28 14:54:15 -04:00 committed by Dimitri Savineau
parent 380e0bec83
commit 561a7c02c0
4 changed files with 8 additions and 8 deletions

View File

@ -415,7 +415,7 @@
name: ceph-defaults name: ceph-defaults
- name: get pool list - 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 register: pool_list
run_once: true run_once: true
delegate_to: "{{ groups[mon_group_name][0] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
@ -434,7 +434,7 @@
set_fact: set_fact:
pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}" pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}"
run_once: true run_once: true
with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}" with_items: "{{ pool_list.stdout | default('{}') | from_json }}"
- name: disable balancer - name: disable balancer
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off" command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"

View File

@ -403,7 +403,7 @@
tasks_from: container_binary.yml tasks_from: container_binary.yml
- name: get pool list - 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 register: pool_list
run_once: true run_once: true
changed_when: false changed_when: false
@ -418,7 +418,7 @@
- name: set_fact pools_pgautoscaler_mode - name: set_fact pools_pgautoscaler_mode
set_fact: set_fact:
pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}" 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 - name: disable balancer
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off" command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"

View File

@ -216,7 +216,7 @@
tasks_from: container_binary.yml tasks_from: container_binary.yml
- name: get pool list - 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 register: pool_list
changed_when: false changed_when: false
check_mode: false check_mode: false
@ -230,7 +230,7 @@
- name: set_fact pools_pgautoscaler_mode - name: set_fact pools_pgautoscaler_mode
set_fact: set_fact:
pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}" 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 - name: disable balancer
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off" command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"

View File

@ -39,7 +39,7 @@
mode: 0750 mode: 0750
- name: get pool list - 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 register: pool_list
delegate_to: "{{ groups.get(mon_group_name, [])[0] }}" delegate_to: "{{ groups.get(mon_group_name, [])[0] }}"
run_once: true run_once: true
@ -58,7 +58,7 @@
set_fact: set_fact:
pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}" pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}"
run_once: true run_once: true
with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}" with_items: "{{ pool_list.stdout | default('{}') | from_json }}"
- name: disable balancer - name: disable balancer
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off" command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"