Bug 1020210

Summary: crm_master ignores option to specify nodename
Product: Red Hat Enterprise Linux 6 Reporter: Frank Danapfel <fdanapfe>
Component: pacemakerAssignee: Andrew Beekhof <abeekhof>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.5CC: cluster-maint, dvossel, fdinitto, jharriga, jkortus, lmiccini
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: pacemaker-1.1.12-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 07:33:25 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:

Description Frank Danapfel 2013-10-17 09:47:26 UTC
Description of problem:
According to the help of crm_master it is possible to specify the cluster node to use:

-N, --node=value Set an attribute for the named node (instead of the current one).

However this option is ignored since the Nodename is hardcoded in the commandline when "crm_attribute is called:

# cat /usr/sbin/crm_master
...
crm_attribute -N `crm_node -n` -n master-$OCF_RESOURCE_INSTANCE $options


Version-Release number of selected component (if applicable):
pacemaker-1.1.10-14.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Try to query value of master score on other node:
node1# crm_master -N node2 -l reboot -r prm_RH2_SCS -G

Actual results:
Always returns value from current node:
node1# crm_master -l reboot -r prm_RH2_SCS -G
scope=status  name=master-prm_RH2_SCS value=100
node1# crm_master -N node2 -l reboot -r prm_RH2_SCS -G
scope=status  name=master-prm_RH2_SCS value=100


Expected results:
Should return info for other node. Or if this doesn't make sense the info about the "-N" option should be removed from the help text and the man-page of crm_master.

Additional info:

Comment 2 RHEL Program Management 2013-10-20 10:44:41 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 Andrew Beekhof 2013-11-13 05:58:24 UTC
A related patch has been committed upstream:
  https://github.com/beekhof/pacemaker/commit/dc2d0e6

with subject:

   Fix: crm_master: Avoid sending redundant "--node" options to crm_attribute

Further details (if any):

Comment 4 Andrew Beekhof 2013-11-13 06:00:07 UTC
What is the context of this report?
crm_master shouldn't really be used outside of a resource agent (which doesn't have a reason to use -N).

Comment 5 Frank Danapfel 2013-11-14 11:45:24 UTC
(In reply to Andrew Beekhof from comment #4)
> What is the context of this report?
> crm_master shouldn't really be used outside of a resource agent (which
> doesn't have a reason to use -N).

When I was playing around with the "showscores.sh" script I thought I could use the query option (-G) of crm_master to get better information about where pacemaker decided to place a master and a slave resource, and noticed that even though "crm_master advertises the option to specify a node this option isn't actually used because the nodename is hardcoded later in the script.

Comment 6 Andrew Beekhof 2014-01-13 05:14:11 UTC
If necessary we can backport dc2d0e6, but since crm_master is just a wrapper for crm_attribute, it doesn't seem critical.

Comment 7 Fabio Massimo Di Nitto 2014-01-13 05:17:42 UTC
(In reply to Andrew Beekhof from comment #6)
> If necessary we can backport dc2d0e6, but since crm_master is just a wrapper
> for crm_attribute, it doesn't seem critical.

And all of those crm_foobar command should be masked behind pcs calls. We are not going to support direct calls to crm_* (except crm_report perhaps). Let's make sure that pcs will grow the ability to handle it.

Comment 8 Andrew Beekhof 2014-01-14 05:11:42 UTC
Sounds sane, closing. We'll pick up the fix in the next rebase in due course

Comment 13 errata-xmlrpc 2014-10-14 07:33:25 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.

http://rhn.redhat.com/errata/RHBA-2014-1544.html