X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-starlingx%2Fmeta-stx-cloud%2Frecipes-support%2Fpuppet%2Ffiles%2Fpuppet-drbd%2F0004-US-96914-reuse-existing-drbd-cinder-resource.patch;fp=meta-starlingx%2Fmeta-stx-cloud%2Frecipes-support%2Fpuppet%2Ffiles%2Fpuppet-drbd%2F0004-US-96914-reuse-existing-drbd-cinder-resource.patch;h=017387d219ea758a36e5d2a4bdcb399c3a3aa63a;hb=e0634c6eaf2fe2641a0fb90e84a5defb880b1335;hp=0000000000000000000000000000000000000000;hpb=210d0f78485e760dffcdd3f630f59cec797f3f11;p=pti%2Frtp.git diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-drbd/0004-US-96914-reuse-existing-drbd-cinder-resource.patch b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-drbd/0004-US-96914-reuse-existing-drbd-cinder-resource.patch new file mode 100644 index 0000000..017387d --- /dev/null +++ b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-drbd/0004-US-96914-reuse-existing-drbd-cinder-resource.patch @@ -0,0 +1,53 @@ +From 132fc324c633ee95ca9ac8d00fb27fe5c4df6a3a Mon Sep 17 00:00:00 2001 +From: Daniel Badea +Date: Tue, 30 May 2017 21:52:52 +0000 +Subject: [PATCH] US-96914 reuse existing drbd-cinder resource + +Trying to initialize and enable DRBD resource fails in "drbdadm +create-md" when the disk already contains meta data. In this case +"drbdadm adjust" should be called. +--- + 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 f9de8ab..160c8c2 100644 +--- a/manifests/resource/up.pp ++++ b/manifests/resource/up.pp +@@ -14,7 +14,7 @@ define drbd::resource::up ( + exec { "initialize DRBD metadata for ${name}": + command => "yes yes | drbdadm create-md ${name}", + onlyif => "test -e ${disk}", +- unless => "drbdadm dump-md ${name} || (drbdadm cstate ${name} | egrep -q '^(Sync|Connected|WFConnection|StandAlone|Verify)')", ++ unless => "drbdadm dump-md ${name} || (drbdadm cstate ${name} | egrep -q '^(Sync|Connected|WFConnection|StandAlone|Verify)') || (drbdadm show-gi ${name} | grep 'meta-data: need apply-al')", + before => Service['drbd'], + require => [ + Exec['modprobe drbd'], +@@ -26,6 +26,7 @@ define drbd::resource::up ( + exec { "enable DRBD resource ${name}": + command => "drbdadm up ${name}", + onlyif => "drbdadm dstate ${name} | egrep -q '^(Diskless/|Unconfigured|Consistent)'", ++ unless => "drbdadm show-gi ${name} | grep 'meta-data: need apply-al'", + before => Service['drbd'], + require => [ + Exec["initialize DRBD metadata for ${name}"], +@@ -34,6 +35,16 @@ define drbd::resource::up ( + notify => Service['drbd'], + } + ++ exec { "reuse existing DRBD resoure ${name}": ++ command => "drbdadm adjust ${name}", ++ onlyif => "test -e ${disk} && (drbdadm show-gi ${name} | grep 'meta-data: need apply-al')", ++ before => Service['drbd'], ++ require => [ ++ Exec['modprobe drbd'], ++ Concat["/etc/drbd.d/${name}.res"], ++ ], ++ notify => Service['drbd'], ++ } + + # these resources should only be applied if we are configuring the + # primary node in our HA setup +-- +1.8.3.1 +