Fix ceph-mon resize on AIO-DX

The system command for resizing ceph-mon partition is disabled
for AIO-DX setup because it is broken.

The problem is that DRBD filesystem is not handled correctly
when the ceph-mon lvm partition is resized.

Updating the DRBD metadata for the ceph-mon partition with
'drbdmadm apply-al' command fixed the problem.

Test-Plan: Install the system with ceph backend and try to resize
           the ceph-mon partition with 'system ceph-mon-modify'
           command.
    PASS: Fresh install and ceph-mon resizing on AIO-SX
    PASS: Fresh install and ceph-mon resizing on AIO-DX

Story: 2009861
Task: 44526

Signed-off-by: Felipe Sanches Zanoni <Felipe.SanchesZanoni@windriver.com>
Change-Id: I734238c94575c94ea59937b72471de940735fe1b
This commit is contained in:
Felipe Sanches Zanoni 2022-02-15 13:57:14 -05:00
parent 4ba94078f5
commit 1887fe0770
4 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,47 @@
From 8106a9787d86901d4ed927838503ebe08bf2adcb Mon Sep 17 00:00:00 2001
From: Felipe Sanches Zanoni <Felipe.SanchesZanoni@windriver.com>
Date: Mon, 14 Feb 2022 12:01:30 -0500
Subject: [PATCH] Fix DRBD cephmon resize
---
manifests/resource/up.pp | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/manifests/resource/up.pp b/manifests/resource/up.pp
index 11cf7ee..8d2f901 100644
--- a/manifests/resource/up.pp
+++ b/manifests/resource/up.pp
@@ -19,18 +19,29 @@ define drbd::resource::up (
],
}
+ # Ensure DRBD metadata is clear
+ exec { "apply-al DRBD metadata for ${name}":
+ command => "drbdadm apply-al ${name}",
+ onlyif => "drbdadm dump-md ${name} 2>&1 | egrep 'please apply-al'",
+ before => Service['drbd'],
+ require => [
+ Exec['modprobe drbd']
+ ],
+ }
+
# create metadata on device, except if resource seems already initalized.
# drbd is very tenacious about asking for aproval if there is data on the
# volume already.
exec { "initialize DRBD metadata for ${name}":
command => "yes yes | drbdadm create-md ${name} -W--peer-max-bio-size=128k",
- onlyif => "test -e ${disk}",
+ onlyif => "test -e ${disk} && ! drbdadm dstate ${name}",
unless => "drbdadm dump-md ${name} || (drbdadm cstate ${name} | egrep -q '^(PausedSync|Sync|Connected|WFConnection|StandAlone|Verify)') || (drbdadm show-gi ${name} | grep 'meta-data: need apply-al')",
before => Service['drbd'],
require => [
Exec['modprobe drbd'],
Exec["test disk by-path for ${name}"],
Concat["/etc/drbd.d/${name}.res"],
+ Exec["apply-al DRBD metadata for ${name}"]
],
notify => Service['drbd'],
}
--
2.29.2

View File

@ -22,6 +22,7 @@ Patch0007: 0007-Add-disk-by-path-test.patch
Patch0008: 0008-CGTS-7953-support-for-new-drbd-resources.patch
Patch0009: 0009-drbd-slow-before-swact.patch
Patch0010: 0010-Format-DRBD-resource-cpu-mask-to-support-64-or-larger-cpus.patch
Patch0011: 0011-Fix-DRBD-cephmon-resize.patch
BuildArch: noarch
@ -55,6 +56,7 @@ find . \( -name spec -o -name ext \) | xargs rm -rf
%patch0008 -p1
%patch0009 -p1
%patch0010 -p1
%patch0011 -p1
%install
rm -rf %{buildroot}

View File

@ -0,0 +1,47 @@
From 8106a9787d86901d4ed927838503ebe08bf2adcb Mon Sep 17 00:00:00 2001
From: Felipe Sanches Zanoni <Felipe.SanchesZanoni@windriver.com>
Date: Mon, 14 Feb 2022 12:01:30 -0500
Subject: [PATCH] Fix DRBD cephmon resize
---
manifests/resource/up.pp | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/manifests/resource/up.pp b/manifests/resource/up.pp
index 11cf7ee..8d2f901 100644
--- a/manifests/resource/up.pp
+++ b/manifests/resource/up.pp
@@ -19,18 +19,29 @@ define drbd::resource::up (
],
}
+ # Ensure DRBD metadata is clear
+ exec { "apply-al DRBD metadata for ${name}":
+ command => "drbdadm apply-al ${name}",
+ onlyif => "drbdadm dump-md ${name} 2>&1 | egrep 'please apply-al'",
+ before => Service['drbd'],
+ require => [
+ Exec['modprobe drbd']
+ ],
+ }
+
# create metadata on device, except if resource seems already initalized.
# drbd is very tenacious about asking for aproval if there is data on the
# volume already.
exec { "initialize DRBD metadata for ${name}":
command => "yes yes | drbdadm create-md ${name} -W--peer-max-bio-size=128k",
- onlyif => "test -e ${disk}",
+ onlyif => "test -e ${disk} && ! drbdadm dstate ${name}",
unless => "drbdadm dump-md ${name} || (drbdadm cstate ${name} | egrep -q '^(PausedSync|Sync|Connected|WFConnection|StandAlone|Verify)') || (drbdadm show-gi ${name} | grep 'meta-data: need apply-al')",
before => Service['drbd'],
require => [
Exec['modprobe drbd'],
Exec["test disk by-path for ${name}"],
Concat["/etc/drbd.d/${name}.res"],
+ Exec["apply-al DRBD metadata for ${name}"]
],
notify => Service['drbd'],
}
--
2.29.2

View File

@ -8,3 +8,4 @@
0008-CGTS-7953-support-for-new-drbd-resources.patch
0009-drbd-slow-before-swact.patch
0010-Format-DRBD-resource-cpu-mask-to-support-64-or-larger-cpus.patch
0011-Fix-DRBD-cephmon-resize.patch