From f6fea33b4004cca493ca8b336bf76d6e5765cc42 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 11 Feb 2019 13:52:37 +0100 Subject: [PATCH] osd: add possibility to exclude device in osd_auto_discovery Add a new `osd_auto_discovery_exclude` to give the possibility of excluding some devices in auto_discovery scenario. Signed-off-by: Guillaume Abrioux (cherry picked from commit 83d7ef777ec19eb5f96c553d869ec8ad90fd5061) --- group_vars/all.yml.sample | 3 +++ group_vars/rhcs.yml.sample | 3 +++ roles/ceph-defaults/defaults/main.yml | 3 +++ roles/ceph-facts/tasks/facts.yml | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index c6338a68f..7aae6828e 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -372,6 +372,9 @@ dummy: #osd_mount_options_xfs: noatime,largeio,inode64,swalloc #osd_objectstore: bluestore +# Any device containing these patterns in their path will be excluded. +#osd_auto_discovery_exclude: ['dm-', 'loop'] + # xattrs. by default, 'filestore xattr use omap' is set to 'true' if # 'osd_mkfs_type' is set to 'ext4'; otherwise it isn't set. This can # be set to 'true' or 'false' to explicitly override those diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index 829f2e012..75474ac29 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -372,6 +372,9 @@ ceph_rhcs_version: 3 #osd_mount_options_xfs: noatime,largeio,inode64,swalloc #osd_objectstore: bluestore +# Any device containing these patterns in their path will be excluded. +#osd_auto_discovery_exclude: ['dm-', 'loop'] + # xattrs. by default, 'filestore xattr use omap' is set to 'true' if # 'osd_mkfs_type' is set to 'ext4'; otherwise it isn't set. This can # be set to 'true' or 'false' to explicitly override those diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index f0a22e471..e65cbf266 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -364,6 +364,9 @@ osd_mkfs_options_xfs: -f -i size=2048 osd_mount_options_xfs: noatime,largeio,inode64,swalloc osd_objectstore: bluestore +# Any device containing these patterns in their path will be excluded. +osd_auto_discovery_exclude: ['dm-', 'loop'] + # xattrs. by default, 'filestore xattr use omap' is set to 'true' if # 'osd_mkfs_type' is set to 'ext4'; otherwise it isn't set. This can # be set to 'true' or 'false' to explicitly override those diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index 4798b0a0e..f723f8d2a 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -193,7 +193,7 @@ - item.value.sectors != "0" - item.value.partitions|count == 0 - item.value.holders|count == 0 - - "'dm-' not in item.key" + - item.key not in osd_auto_discovery_exclude - name: set_fact ceph_uid for debian based system - non container set_fact: