Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1361533 - missing header for the resources section in the crm_mon output when called without --inactive flag
Summary: missing header for the resources section in the crm_mon output when called wi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pacemaker
Version: 7.2
Hardware: Unspecified
OS: Unspecified
urgent
medium
Target Milestone: rc
: 7.3
Assignee: Ken Gaillot
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1298585
TreeView+ depends on / blocked
 
Reported: 2016-07-29 11:02 UTC by Ivan Devat
Modified: 2016-11-03 19:00 UTC (History)
4 users (show)

Fixed In Version: pacemaker-1.1.15-8.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
: 1363907 (view as bug list)
Environment:
Last Closed: 2016-11-03 19:00:07 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2578 normal SHIPPED_LIVE Moderate: pacemaker security, bug fix, and enhancement update 2016-11-03 12:07:24 UTC

Description Ivan Devat 2016-07-29 11:02:22 UTC
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.

Comment 2 Ken Gaillot 2016-07-29 16:39:01 UTC
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.

Comment 3 Ken Gaillot 2016-08-02 15:31:33 UTC
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?

Comment 4 Andrew Beekhof 2016-08-03 01:48:00 UTC
(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

Comment 5 Tomas Jelinek 2016-08-03 11:09:39 UTC
(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!

Comment 6 Ken Gaillot 2016-08-03 22:18:23 UTC
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"

Comment 7 Ken Gaillot 2016-08-03 22:21:02 UTC
(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.

Comment 10 Patrik Hagara 2016-08-29 15:39:29 UTC
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.

Comment 12 errata-xmlrpc 2016-11-03 19:00:07 UTC
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


Note You need to log in before you can comment on or make changes to this bug.