diff --git a/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/0012-Add-multipath-disk-support.patch b/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/0012-Add-multipath-disk-support.patch new file mode 100644 index 000000000..3c217bae0 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/0012-Add-multipath-disk-support.patch @@ -0,0 +1,79 @@ +From: Matheus Guilhermino +Date: Mon, 13 Feb 2023 16:41:29 -0300 +Subject: Add multipath disk support + +To support multipath devices, detect when a persistent device name +evaluates to a device mapper device and derive the data partition based on +what is required by the subsequent command. + +Fix parsing of 'ceph-disk list' output so that it properly identifies +the OSD. + +Signed-off-by: Robert Church +Signed-off-by: Matheus Guilhermino +--- + manifests/osd.pp | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +diff --git a/manifests/osd.pp b/manifests/osd.pp +index 8baa49a..f77e851 100644 +--- a/manifests/osd.pp ++++ b/manifests/osd.pp +@@ -143,7 +143,9 @@ ceph-disk --verbose --log-stdout prepare --filestore ${cluster_uuid_option} ${u + mkdir -p /var/lib/ceph/osd/ceph-${osdid} + ceph auth del osd.${osdid} || true + part=\${disk} +-if [[ \$part == *nvme* ]]; then ++if [[ \${disk} == *dm-* ]]; then ++ part=${data}-part1 ++elif [[ \${part} == *nvme* ]]; then + part=\${part}p1 + else + part=\${part}1 +@@ -191,7 +193,9 @@ if ! test -b \$disk ; then + fi + fi + part=\${disk} +-if [[ \${part} == *nvme* ]]; then ++if [[ \${disk} == *dm-* ]]; then ++ part=${data}-part1 ++elif [[ \${part} == *nvme* ]]; then + part=\${part}p1 + else + part=\${part}1 +@@ -219,13 +223,15 @@ ls -ld /var/lib/ceph/osd/${cluster_name}-* | grep \" $(readlink -f ${data})\$\" + set -ex + disk=$(readlink -f ${data}) + part=\${disk} +-if [[ \${part} == *nvme* ]]; then ++if [[ \${disk} == *dm-* ]]; then ++ part=$(readlink -f ${data}-part1) ++elif [[ \${part} == *nvme* ]]; then + part=\${part}p1 + else + part=\${part}1 + fi + if [ -z \"\$id\" ] ; then +- id=$(ceph-disk list | sed -nEe \"s:^ *\${part}? .*(ceph data|mounted on).*osd\\.([0-9]+).*:\\2:p\") ++ id=$(ceph-disk list | sed -nEe \"s:^ .*${part} .*(ceph data|mounted on).*osd/ceph-([0-9]+).*:\\2:p\") + fi + if [ -z \"\$id\" ] ; then + id=$(ls -ld /var/lib/ceph/osd/${cluster_name}-* | sed -nEe \"s:.*/${cluster_name}-([0-9]+) *-> *\${disk}\$:\\1:p\" || true) +@@ -246,13 +252,15 @@ fi + set -ex + disk=$(readlink -f ${data}) + part=${disk} +-if [[ \$part == *nvme* ]]; then ++if [[ \${disk} == *dm-* ]]; then ++ part=${data}-part1 ++elif [[ \${part} == *nvme* ]]; then + part=\${part}p1 + else + part=\${part}1 + fi + if [ -z \"\$id\" ] ; then +- id=$(ceph-disk list | sed -nEe \"s:^ *\${part}? .*(ceph data|mounted on).*osd\\.([0-9]+).*:\\2:p\") ++ id=$(ceph-disk list | sed -nEe \"s:^ .*${part} .*(ceph data|mounted on).*osd/ceph-([0-9]+).*:\\2:p\") + fi + if [ -z \"\$id\" ] ; then + id=$(ls -ld /var/lib/ceph/osd/${cluster_name}-* | sed -nEe \"s:.*/${cluster_name}-([0-9]+) *-> *\${disk}\$:\\1:p\" || true) diff --git a/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/series b/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/series index 49695c261..d4d3a67cf 100644 --- a/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/series +++ b/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/series @@ -7,4 +7,5 @@ 0008-ceph-mimic-prepare-activate-osd.patch 0009-fix-ceph-osd-disk-partition-for-nvme-disks.patch 0010-wipe-unprepared-disks.patch -0011-Fix-service-parameter-passing.patch \ No newline at end of file +0011-Fix-service-parameter-passing.patch +0012-Add-multipath-disk-support.patch