]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: autodiscovery mode, use holders to detect device 1409/head
authorSébastien Han <seb@redhat.com>
Tue, 4 Apr 2017 08:33:22 +0000 (10:33 +0200)
committerSébastien Han <seb@redhat.com>
Tue, 4 Apr 2017 08:37:14 +0000 (10:37 +0200)
As reported in
https://github.com/ceph/ceph-ansible/issues/1403 when devices are held
by lvm and `osd_auto_discovery` is set to true, it's not enough to check
for a partition count = 0 since Ansible does not report.
This patch also looks for 'holders' which in a case of lvm corresponds
to the name of the pv. Now we also look for holders = 0.

Fixes: #1403
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-osd/tasks/activate_osds.yml
roles/ceph-osd/tasks/check_devices_auto.yml
roles/ceph-osd/tasks/scenarios/bluestore.yml
roles/ceph-osd/tasks/scenarios/dmcrypt-journal-collocation.yml
roles/ceph-osd/tasks/scenarios/journal_collocation.yml

index 4e8dd1aae702100d29ed76dc93593e314830cfad..f35bea199eba850cff38adc11f016b07c060bd9b 100644 (file)
@@ -10,6 +10,7 @@
     - ansible_devices is defined
     - item.value.removable == "0"
     - item.value.partitions|count == 0
+    - item.value.holders|count == 0
     - journal_collocation
     - osd_auto_discovery
 
@@ -35,6 +36,7 @@
     - ansible_devices is defined
     - item.value.removable == "0"
     - item.value.partitions|count == 0
+    - item.value.holders|count == 0
     - osd_auto_discovery
     - dmcrypt_journal_collocation
 
index 19d82ba75d269e716dff35af5b6244bbd39ee69d..889239727fbce6f8d779da404c205b35af40eab9 100644 (file)
@@ -21,6 +21,7 @@
     - ansible_devices is defined
     - item.value.removable == "0"
     - item.value.partitions|count == 0
+    - item.value.holders|count == 0
 
 - name: fix partitions gpt header or labels of the osd disks (autodiscover disks)
   shell: "sgdisk --zap-all --clear --mbrtogpt -- '/dev/{{ item.0.item.key }}' || sgdisk --zap-all --clear --mbrtogpt -- '/dev/{{ item.0.item.key }}'"
@@ -32,6 +33,7 @@
     - ansible_devices is defined
     - item.0.item.value.removable == "0"
     - item.0.item.value.partitions|count == 0
+    - item.value.holders|count == 0
     - item.0.rc != 0
 
 - name: check if a partition named 'ceph' exists (autodiscover disks)
index bf49d43f2d63860f5dee129f026173d4bf3ec048..78897e2887df9cfca87830f567640991509060f4 100644 (file)
@@ -17,6 +17,7 @@
     - ansible_devices is defined
     - item.value.removable == "0"
     - item.value.partitions|count == 0
+    - item.value.holders|count == 0
     - bluestore
     - osd_auto_discovery
 
index cf656ed15aaeffd425d18529a0df07d50d208c1f..528856f5b32e6939bdddbf97f25e535396af1cc7 100644 (file)
@@ -16,6 +16,7 @@
     - ansible_devices is defined
     - item.value.removable == "0"
     - item.value.partitions|count == 0
+    - item.value.holders|count == 0
     - dmcrypt_journal_collocation
     - osd_auto_discovery
 
index 4ea5788f166ee2b106594412c4b1ffd4d6d15e17..0e1d08a124ce9c3aa9a265a04bfb7c8424f6c9b9 100644 (file)
@@ -17,6 +17,7 @@
     - ansible_devices is defined
     - item.value.removable == "0"
     - item.value.partitions|count == 0
+    - item.value.holders|count == 0
     - journal_collocation
     - osd_auto_discovery