From 66572c92076a085bd0d99e8fd159f9ad0a3c9065 Mon Sep 17 00:00:00 2001 From: Robert Church Date: Sat, 21 Jan 2023 07:44:17 -0600 Subject: [PATCH] puppet-ceph: Add multipath disk support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Test Plan: PASS - AIO-SX: HPE multipath install/bootstrap/unlock PASS - AIO-SX: Qemu virtual multipath install/bootstrap/unlock PASS - AIO-DX: Qemu virtual multipath install/bootstrap/unlock PASS - AIO-DX+: Qemu virtual multipath install/bootstrap/unlock PASS - 2+2 (controller storage): Qemu virtual multipath install/ bootstrap/unlock PASS - 2+2+2 (dedicated storage): Qemu virtual multipath install/ bootstrap/unlock PASS - Add OSD ceph storage configuration (AIO-SX) PASS - Expand CGTS volume group using extra disk (Partition) (AIO-SX) PASS - Expand CGTS volume group using extra disk (disk) (AIO-SX) PASS - Add nova local volume group using extra disk (AIO-SX) PASS - App pod that alocates and writes into a PVC (AIO-SX) PASS - Local disk Commands (Disk API) - AIO-SX/DX - host-disk-list - host-disk-show - host-disk-partition-list - host-disk-partition-show - host-pv-list - host-pv-show - host-stor-list - host-stor-show - host-lvg-list - host-lvg-show - host-pv-add PASS - Create nova-local volume group PASS - Local disk Commands on AIO-DX after swact Regression: PASS - AIO-SX: Non-multipath install/bootstrap/unlock (NVME) PASS - AIO-DX: Non-multipath install/bootstrap/unlock (SSD) PASS - 2+2: Non-multipath install/bootstrap/unlock (SSD) PASS - 2+2+2 : Non-multipath install/bootstrap/unlock (SSD and HD) PASS - Distributed cloud: Non-multipath install/bootstrap/unlock Depends-On: https://review.opendev.org/c/starlingx/tools/+/860590 Story: 2010046 Task: 47201 Signed-off-by: Robert Church Change-Id: Ibdeab472c6b38684438bf5e7f695865f3e9ecba1 Signed-off-by: Matheus Guilhermino --- .../0012-Add-multipath-disk-support.patch | 79 +++++++++++++++++++ .../puppet-ceph-2.4.1/debian/patches/series | 3 +- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/0012-Add-multipath-disk-support.patch 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