Skip to content

Commit

Permalink
Fix rbd pools trash purge scheduling
Browse files Browse the repository at this point in the history
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
  • Loading branch information
katarimanojk authored and openshift-merge-bot[bot] committed Oct 15, 2024
1 parent bee560d commit ecfc89f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions playbooks/ceph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions roles/cifmw_cephadm/tasks/pools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,21 @@

- 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
vars:
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([]) }}"

0 comments on commit ecfc89f

Please sign in to comment.