Bug 1882544
| Summary: | sosreport does not execute ceph cmds when containerized | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Randy Martinez <r.martinez> |
| Component: | sos | Assignee: | Pavel Moravec <pmoravec> |
| Status: | CLOSED ERRATA | QA Contact: | Miroslav HradĂlek <mhradile> |
| Severity: | urgent | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.2 | CC: | agk, bmr, jhunsaker, jjansky, lithomas, mhackett, mhradile, mkluson, plambri, pmoravec, sbradley, tonay |
| Target Milestone: | rc | Keywords: | OtherQA, Reopened, Triaged |
| Target Release: | 8.0 | Flags: | pm-rhel:
mirror+
|
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | sos-4.3-1.el8 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-11-08 10:50:23 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Comment 3
Pavel Moravec
2020-10-09 20:47:05 UTC
Kindly bumping the needinfo, please (but no rush at all). Won't this be a fix, then? Override check_enabled method in the ceph plugin, such that:
- for non-containerised environments, we first run the current enabledness check
- if it returns False, we use SoSPredicate to eval the "systemctl is-enabled ceph-mon@$(hostname -s) && systemctl cat ceph-mon@$(hostname -s) | grep -Eq 'docker|podman'" test
One option:
@@ -6,7 +6,7 @@
#
# See the LICENSE file in the source distribution for further information.
-from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin
+from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin, SoSPredicate
from socket import gethostname
@@ -37,6 +37,24 @@ class Ceph(Plugin, RedHatPlugin, UbuntuP
'ceph-osd@*'
)
+ def check_enabled(self):
+ # ceph on non-containerised environment
+ if super(Ceph, self).check_enabled():
+ return True
+ # containerised ceph is present iff:
+ # - ceph-mon@$(hostname -s) service is enabled
+ # - the service config has a reference to 'docker' or 'podman'
+ shortname = self.ceph_hostname.split('.')[0]
+ cephtest = {'cmd': 'systemctl is-enabled ceph-mon@%s' % shortname, 'output': 'enabled'}
+ cephdockertest = {'cmd': 'systemctl cat ceph-mon@%s' % shortname, 'output': 'docker' }
+ cephpodmantest = {'cmd': 'systemctl cat ceph-mon@%s' % shortname, 'output': 'podman' }
+ cephpred = SoSPredicate(self, cmd_outputs=cephtest)
+ cephdockerpred = SoSPredicate(self, cmd_outputs=cephdockertest)
+ cephpodmanpred = SoSPredicate(self, cmd_outputs=cephpodmantest)
+ return self.test_predicate(self, pred=cephpred) and \
+ ( self.test_predicate(self, pred=cephdockerpred) or \
+ self.test_predicate(self, pred=cephpodmanpred))
+
def setup(self):
all_logs = self.get_option("all_logs")
(a bit improved one is to set and eval "cephpred" first and optionally return False, then check the other two predicates)
Randy, could you please test this?
Randy, kindly reminder of the needinfo. If you wish to have this fixed in 8.5, we need a response soon. Sounds good, thanks! Preliminary adding to 8.6 (and 9.0 GA). This will be fixed in RHEL8.7 automatically, due to a rebase of sos to 4.3 release there, which does contain the https://github.com/sosreport/sos/commit/93da93267a582d8e93e1da55f7e6a6763a6791b8 commit fixing the #2646 PR. We will prepare a very first candidate build for that in a month-ish time frame. @tonay , would you be able to test the build once ready? (and thanks for preparing the PR, the BZ specification was unclear to me) Of course, just let me know when it is ready. Hello, as our QE might not have available systems for testing the fix, would you be able to verify the fix once available (as a candidate package for 8.7)? After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened. Reopening, this will be fixed. (In reply to Teoman ONAY from comment #20) > Of course, just let me know when it is ready. Hello, could you please use the build from https://people.redhat.com/pmoravec/sos-4.2-15/sos-4.2-15.el8.noarch.rpm to verify? Thanks in advance. (In reply to Pavel Moravec from comment #25) > (In reply to Teoman ONAY from comment #20) > > Of course, just let me know when it is ready. > > Hello, > could you please use the build from > https://people.redhat.com/pmoravec/sos-4.2-15/sos-4.2-15.el8.noarch.rpm to > verify? > > Thanks in advance. I apologize for a wrong version: please use the build from https://people.redhat.com/pmoravec/sos-4.3-1/ instead. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (sos bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:7732 |