From fe8b8dcc9b5de1094a6526aa4aff0e266a1402e4 Mon Sep 17 00:00:00 2001 From: Dan Voiculeasa Date: Fri, 11 Mar 2022 17:40:59 +0200 Subject: [PATCH] debian: Fix ceph service calls This work is part of Debian integration effort. This work affects only Debian, but we can port to CentOS. Puppet manifest fails because osd service is called before osds are prepared (partitioned). This happends because parameters are not correctly passed to the service call. In fact the service call only asks to start a mon serice. Tests: PASS: live patch controller && unlock, puppet goes past the issue PASS: build-pkgs and check contents Story: 2009101 Task: 44756 Signed-off-by: Dan Voiculeasa Change-Id: I9f6c6478c51ba45843bbaff9e264fc10056fac48 --- .../0011-Fix-service-parameter-passing.patch | 65 +++++++++++++++++++ .../puppet-ceph-2.4.1/debian/patches/series | 3 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/0011-Fix-service-parameter-passing.patch diff --git a/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/0011-Fix-service-parameter-passing.patch b/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/0011-Fix-service-parameter-passing.patch new file mode 100644 index 000000000..7e9cc1d36 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/0011-Fix-service-parameter-passing.patch @@ -0,0 +1,65 @@ +1From 62732269d5537270f9d81fd1583431092eed2d2b Mon Sep 17 00:00:00 2001 +From: Dan Voiculeasa +Date: Fri, 11 Mar 2022 16:33:41 +0200 +Subject: [PATCH] Fix service parameter passing + +On debian passing the parameters needs to a service call needs to +happen after the '--' construct, otherwise not all parameters are +passed. +For example the logs showed attempts to start mon + osd when +'service ceph start mon.' was called, which led to failures +bacause the disk for osd was not initialized yet. + +Signed-off-by: Dan Voiculeasa +--- + manifests/mon.pp | 6 +++--- + manifests/osd.pp | 2 +- + spec/defines/ceph_osd_spec.rb | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/manifests/mon.pp b/manifests/mon.pp +index 62d5059..6d1294e 100644 +--- a/manifests/mon.pp ++++ b/manifests/mon.pp +@@ -103,9 +103,9 @@ define ceph::mon ( + Service { + name => "ceph-mon-${id}", + provider => $::ceph::params::service_provider, +- start => "service ceph start mon.${id}", +- stop => "service ceph stop mon.${id}", +- status => "service ceph status mon.${id}", ++ start => "service ceph -- start mon.${id}", ++ stop => "service ceph -- stop mon.${id}", ++ status => "service ceph -- status mon.${id}", + restart => "/etc/init.d/ceph-init-wrapper restart mon.${id}", + enable => $mon_enable, + } +diff --git a/manifests/osd.pp b/manifests/osd.pp +index ab65924..8baa49a 100644 +--- a/manifests/osd.pp ++++ b/manifests/osd.pp +@@ -232,7 +232,7 @@ if [ -z \"\$id\" ] ; then + fi + if [ \"\$id\" ] ; then + stop ceph-osd cluster=${cluster_name} id=\$id || true +- service ceph stop osd.\$id || true ++ service ceph -- stop osd.\$id || true + systemctl stop ceph-osd@\$id || true + ceph ${cluster_option} osd crush remove osd.\$id + ceph ${cluster_option} auth del osd.\$id +diff --git a/spec/defines/ceph_osd_spec.rb b/spec/defines/ceph_osd_spec.rb +index a0b917f..59f0352 100644 +--- a/spec/defines/ceph_osd_spec.rb ++++ b/spec/defines/ceph_osd_spec.rb +@@ -338,7 +338,7 @@ if [ -z \"\$id\" ] ; then + fi + if [ \"\$id\" ] ; then + stop ceph-osd cluster=ceph id=\$id || true +- service ceph stop osd.\$id || true ++ service ceph -- stop osd.\$id || true + systemctl stop ceph-osd@$id || true + ceph --cluster ceph osd crush remove osd.\$id + ceph --cluster ceph auth del osd.\$id +-- +2.30.0 + 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 5aac690c4..49695c261 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 @@ -6,4 +6,5 @@ 0007-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch 0008-ceph-mimic-prepare-activate-osd.patch 0009-fix-ceph-osd-disk-partition-for-nvme-disks.patch -0010-wipe-unprepared-disks.patch \ No newline at end of file +0010-wipe-unprepared-disks.patch +0011-Fix-service-parameter-passing.patch \ No newline at end of file