mirror of https://github.com/ceph/ceph-ansible.git
purge: use sysfs to unmap rbd devices
in containerized context, using the binary provided in atomic os won't
work because it's an old version provided by ceph-common based on
10.2.5.
Using a container could be an idea but for large cluster with hundreds
of client nodes, that would require to pull the image of each of them
just to unmap the rbd devices.
Let's use the sysfs method in order to avoid any issue related to ceph
version that is shipped on the host.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1766064
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 3cfcc7a105
)
pull/4974/head
parent
bcd7fee18d
commit
5db0b239f6
|
@ -69,8 +69,15 @@
|
||||||
- name: ensure cephfs mountpoint are unmounted
|
- name: ensure cephfs mountpoint are unmounted
|
||||||
command: umount -a -t ceph
|
command: umount -a -t ceph
|
||||||
|
|
||||||
- name: ensure rbd devices are unmapped
|
- name: find mapped rbd ids
|
||||||
command: rbdmap unmap-all
|
find:
|
||||||
|
paths: /sys/bus/rbd/devices
|
||||||
|
file_type: any
|
||||||
|
register: rbd_mapped_ids
|
||||||
|
|
||||||
|
- name: use sysfs to unmap rbd devices
|
||||||
|
shell: "echo {{ item.path | basename }} > /sys/bus/rbd/remove_single_major"
|
||||||
|
with_items: "{{ rbd_mapped_ids.files }}"
|
||||||
|
|
||||||
- name: unload ceph kernel modules
|
- name: unload ceph kernel modules
|
||||||
modprobe:
|
modprobe:
|
||||||
|
|
Loading…
Reference in New Issue