integ/config/puppet-modules/puppet-drbd-0.5.2/debian/patches/0011-Fix-DRBD-cephmon-resize.patch
Felipe Sanches Zanoni 1887fe0770 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
2022-02-17 07:45:13 -05:00

48 lines
1.7 KiB
Diff

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