]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
filestore-to-bluestore: ensure all dm are closed 4885/head v4.0.6
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 10 Dec 2019 22:04:57 +0000 (23:04 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 11 Dec 2019 15:37:21 +0000 (16:37 +0100)
This commit adds a task to ensure device mappers are well closed when
lvm batch scenario is used.
Otherwise, OSDs can't be redeployed given that devices that are rejected
by ceph-volume because they are locked.

Adding a condition `devices | default([]) | length > 0` to remove these
dm only when using lvm batch scenario.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 8e6ef818a287e8bf139420142493843077ea3851)

infrastructure-playbooks/filestore-to-bluestore.yml

index ebe9b17bac7d5b149c42d51f2b168a5559fc7d21..00a0c52f4d1572e3821ecec9015410a998945e6e 100644 (file)
             CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
             CEPH_CONTAINER_BINARY: "{{ container_binary }}"
           loop: "{{ osd_fsid_list }}"
+
+        - name: ensure all dm are closed
+          command: dmsetup remove "{{ item['lv_path'] }}"
+          with_items: "{{ _lvm_list }}"
+          changed_when: false
+          failed_when: false
+          when:
+            - item['lv_path'] is defined
+              # Do not close mappers for non 'lvm batch' devices
+            - devices | default([]) | length > 0
       when: _lvm_list is defined
 
     - name: set_fact osd_ids