From ecfc89ffa661eb88257bfdc60505f07c3837e6f5 Mon Sep 17 00:00:00 2001 From: mkatari Date: Tue, 17 Sep 2024 12:08:40 +0530 Subject: [PATCH] Fix rbd pools trash purge scheduling This patch ensures to use the right conditions and parameters while trash purge scheduling on the rbd pools. Jira: https://issues.redhat.com/browse/OSPRH-8504 --- playbooks/ceph.yml | 1 + roles/cifmw_cephadm/tasks/pools.yml | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/playbooks/ceph.yml b/playbooks/ceph.yml index 72a21ad802..8bdc4ba86e 100644 --- a/playbooks/ceph.yml +++ b/playbooks/ceph.yml @@ -284,6 +284,7 @@ pg_autoscale_mode: true target_size_ratio: 0.3 application: rbd + trash_purge_enabled: true - name: backups pg_autoscale_mode: true target_size_ratio: 0.1 diff --git a/roles/cifmw_cephadm/tasks/pools.yml b/roles/cifmw_cephadm/tasks/pools.yml index 5c34cc7eda..d88ff0525d 100644 --- a/roles/cifmw_cephadm/tasks/pools.yml +++ b/roles/cifmw_cephadm/tasks/pools.yml @@ -47,8 +47,9 @@ - name: Configure the RBD trash purge scheduler when: - - cifmw_enabled_services | default([]) | intersect(['cinder_volume']) - cifmw_cephadm_enable_trash_scheduler | default(false) + - cifmw_cephadm_pools is defined + - cifmw_cephadm_pools | length > 0 block: - name: Get the RBD ceph_cli ansible.builtin.include_tasks: ceph_cli.yml @@ -56,10 +57,11 @@ ceph_command: rbd - name: Set trash interval + when: item.trash_purge_enabled | default(false) ansible.builtin.command: - cmd: | - {{ cifmw_cephadm_ceph_cli }} trash purge schedule add \ - {{ cifmw_cephadm_rbd_trash_interval | default(15) }} --pool {{ item }} + cmd: >- + {{ cifmw_cephadm_ceph_cli }} trash purge schedule add + {{ cifmw_cephadm_rbd_trash_interval | default(15) }} --pool {{ item.name }} changed_when: false become: true - loop: "{{ [ cinder_pool.name | default('volumes') ] + cinder_pool.cinder_extra_pools | default([]) }}" + loop: "{{ cifmw_cephadm_pools | default([]) }}"