Bug 1361533
| Summary: | missing header for the resources section in the crm_mon output when called without --inactive flag | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Ivan Devat <idevat> | |
| Component: | pacemaker | Assignee: | Ken Gaillot <kgaillot> | |
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | urgent | |||
| Version: | 7.2 | CC: | abeekhof, cluster-maint, phagara, tojeline | |
| Target Milestone: | rc | Keywords: | Reopened | |
| Target Release: | 7.3 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | pacemaker-1.1.15-8.el7 | Doc Type: | No Doc Update | |
| Doc Text: |
undefined
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1363907 (view as bug list) | Environment: | ||
| Last Closed: | 2016-11-03 19:00:07 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: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1298585 | |||
I agree that crm_mon should be consistent here, but the console output often changes from release to release and is not guaranteed to be parseable. crm_mon has a -X/--as-xml option to generate XML output that is kept stable across releases for automated parsing. It even has a schema file, /usr/share/pacemaker/crm_mon.rng. When using the XML output, many of the options that control what is displayed are ignored; it simply outputs the maximum information. So for resources, there are <resource> entries with active="true" or "false", regardless of whether --inactive is specified. FYI there is a --hide-headers option for console output; it does print nodes as well as resources, but it gets rid of everything else. I'll try to fix the header issue for 7.3, but understand that the console output changes from one pacemaker version to another, so it can't be relied on in the long term. Is your goal to display only certain sections of the crm_mon output? For example, just the resources, or just the resources and the failcounts. If that's the case, I have an idea for an enhancement that could make it into 7.4. We could add an --include option to crm_mon that would take a comma-separated list of sections you want to display. E.g. "crm_mon --include resources,failcounts". Would that be sufficient? (In reply to Ken Gaillot from comment #2) > I agree that crm_mon should be consistent here, I don't, precisely because of the next thing you say. > but the console output often > changes from release to release and is not guaranteed to be parseable. > crm_mon has a -X/--as-xml option to generate XML output that is kept stable > across releases for automated parsing. Exactly. Never parse the ascii, use --as-xml instead. We should be trimming the human readable output, not adding extra noise to satisfy people using the wrong format :) -ENOTABUG (In reply to Ken Gaillot from comment #3) > I'll try to fix the header issue for 7.3, but understand that the console > output changes from one pacemaker version to another, so it can't be relied > on in the long term. > > Is your goal to display only certain sections of the crm_mon output? For > example, just the resources, or just the resources and the failcounts. If yes > that's the case, I have an idea for an enhancement that could make it into > 7.4. We could add an --include option to crm_mon that would take a > comma-separated list of sections you want to display. E.g. "crm_mon > --include resources,failcounts". Would that be sufficient? That would be great! Fixed upstream as of commit 11cbc8c2 crm_mon now consistently prints a resources section heading, for both console and HTML output formats, that is one of the following values as appropriate to the command-line options used: --group-by-node --inactive: "Inactive resources" or "No inactive resources" --inactive: "Full list of resources" or "No resources" (none): "Active resources" or "No active resources" (In reply to Andrew Beekhof from comment #4) > (In reply to Ken Gaillot from comment #2) > > I agree that crm_mon should be consistent here, > > I don't, precisely because of the next thing you say. > > > but the console output often > > changes from release to release and is not guaranteed to be parseable. > > crm_mon has a -X/--as-xml option to generate XML output that is kept stable > > across releases for automated parsing. > > Exactly. Never parse the ascii, use --as-xml instead. > > We should be trimming the human readable output, not adding extra noise to > satisfy people using the wrong format :) > > -ENOTABUG Agreed, but proceeded anyway for two reasons: * pcs needs a short-term (7.3) solution while the correct solution will be a significant project (7.4 timeframe) * It turns out to be quite useful for end users, because the resource list is always headed by either "Active resources" or "Full list of resources", making it obvious what is or is not included. Confirmed fixed in pacemaker-1.1.15-9.el7.x86_64 Before the fix: > [root@virt-010 ~]# rpm -q pacemaker > pacemaker-1.1.15-7.el7.x86_64 > [root@virt-010 ~]# crm_mon --one-shot --inactive > Stack: corosync > Current DC: virt-010.cluster-qe.lab.eng.brq.redhat.com (version 1.1.15-7.el7-e174ec8) - partition with quorum > Last updated: Mon Aug 29 17:28:50 2016 Last change: Mon Aug 29 17:27:58 2016 by hacluster via crmd on virt-010.cluster-qe.lab.eng.brq.redhat.com > > 2 nodes and 2 resources configured > > Online: [ virt-010.cluster-qe.lab.eng.brq.redhat.com virt-012.cluster-qe.lab.eng.brq.redhat.com ] > > Full list of resources: > > fence-virt-010 (stonith:fence_xvm): Started virt-010.cluster-qe.lab.eng.brq.redhat.com > fence-virt-012 (stonith:fence_xvm): Started virt-012.cluster-qe.lab.eng.brq.redhat.com > [root@virt-010 ~]# crm_mon --one-shot > Stack: corosync > Current DC: virt-010.cluster-qe.lab.eng.brq.redhat.com (version 1.1.15-7.el7-e174ec8) - partition with quorum > Last updated: Mon Aug 29 17:28:53 2016 Last change: Mon Aug 29 17:27:58 2016 by hacluster via crmd on virt-010.cluster-qe.lab.eng.brq.redhat.com > > 2 nodes and 2 resources configured > > Online: [ virt-010.cluster-qe.lab.eng.brq.redhat.com virt-012.cluster-qe.lab.eng.brq.redhat.com ] > > fence-virt-010 (stonith:fence_xvm): Started virt-010.cluster-qe.lab.eng.brq.redhat.com > fence-virt-012 (stonith:fence_xvm): Started virt-012.cluster-qe.lab.eng.brq.redhat.com After the fix: > [root@virt-010 ~]# rpm -q pacemaker > pacemaker-1.1.15-9.el7.x86_64 > [root@virt-010 ~]# crm_mon --one-shot --inactive > Stack: corosync > Current DC: virt-012.cluster-qe.lab.eng.brq.redhat.com (version 1.1.15-9.el7-e174ec8) - partition with quorum > Last updated: Mon Aug 29 17:34:51 2016 Last change: Mon Aug 29 17:34:36 2016 by hacluster via crmd on virt-012.cluster-qe.lab.eng.brq.redhat.com > > 2 nodes and 2 resources configured > > Online: [ virt-010.cluster-qe.lab.eng.brq.redhat.com virt-012.cluster-qe.lab.eng.brq.redhat.com ] > > Full list of resources: > > fence-virt-010 (stonith:fence_xvm): Started virt-012.cluster-qe.lab.eng.brq.redhat.com > fence-virt-012 (stonith:fence_xvm): Started virt-010.cluster-qe.lab.eng.brq.redhat.com > [root@virt-010 ~]# crm_mon --one-shot > Stack: corosync > Current DC: virt-012.cluster-qe.lab.eng.brq.redhat.com (version 1.1.15-9.el7-e174ec8) - partition with quorum > Last updated: Mon Aug 29 17:34:54 2016 Last change: Mon Aug 29 17:34:36 2016 by hacluster via crmd on virt-012.cluster-qe.lab.eng.brq.redhat.com > > 2 nodes and 2 resources configured > > Online: [ virt-010.cluster-qe.lab.eng.brq.redhat.com virt-012.cluster-qe.lab.eng.brq.redhat.com ] > > Active resources: > > fence-virt-010 (stonith:fence_xvm): Started virt-012.cluster-qe.lab.eng.brq.redhat.com > fence-virt-012 (stonith:fence_xvm): Started virt-010.cluster-qe.lab.eng.brq.redhat.com crm_mon now outputs "Active resources" header when --inactive flag is not used (instead of no header at all). Marking verified. 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, 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://rhn.redhat.com/errata/RHSA-2016-2578.html |
Description of problem: When running "crm_mon --one-shot --inactive" there is "Full list of resources" header. But when running "crm_mon --one-shot" the header is not there. When pcs command "pcs status resources" displays resources status it runs "crm_mon" and looks for the header to identify the resources section in the output. If the header is missing there is no reliable way to identify the resources section. Steps to Reproduce: vm-rhel72-1 ~] $ crm_mon --one-shot --inactive Stack: corosync Current DC: vm-rhel72-1 (version 1.1.15-7.el7-e174ec8) - partition with quorum Last updated: Fri Jul 29 02:22:30 2016 Last change: Fri Jul 29 01:12:28 2016 by root via cibadmin on vm-rhel72-1 2 nodes and 3 resources configured Node vm-rhel72-3: standby Online: [ vm-rhel72-1 ] Full list of resources: xvm-fencing (stonith:fence_xvm): Started vm-rhel72-1 Clone Set: resource-dummy-clone [resource-dummy] Started: [ vm-rhel72-1 ] Stopped: [ vm-rhel72-3 ] [vm-rhel72-1 ~] $ crm_mon --one-shot Stack: corosync Current DC: vm-rhel72-1 (version 1.1.15-7.el7-e174ec8) - partition with quorum Last updated: Fri Jul 29 02:27:13 2016 Last change: Fri Jul 29 01:12:28 2016 by root via cibadmin on vm-rhel72-1 2 nodes and 3 resources configured Node vm-rhel72-3: standby Online: [ vm-rhel72-1 ] xvm-fencing (stonith:fence_xvm): Started vm-rhel72-1 Clone Set: resource-dummy-clone [resource-dummy] Started: [ vm-rhel72-1 ] Actual results: There is no resources section header in second listing. Expected results: There is resources section header. Something like "List of active resources". Or better - introduce new flag for crm_mon to display only resources section.