Bug 1094812

Summary: 'pcs status nodes corosync' gives an error instead of providing nodes info
Product: Red Hat Enterprise Linux 6 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 6.5CC: cfeist, cluster-maint, huy.vu, jherrman, rsteiger, tojeline
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: pcs-0.9.120-2.el6 Doc Type: Bug Fix
Doc Text:
Prior to this update, pcs used the corosync.conf file when listing cluster nodes using the "pcs status nodes corosync" command. However, corosync.conf does not exist in Red Hat Enterprise Linux 6. As a consequence, "pcs status nodes corosync" failed to execute. With this update, cluster nodes on Red Hat Enterprise Linux 6 are listed using the cman_tool program and the /etc/cluster/cluster.conf file, and "pcs status nodes corosync" now functions correctly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 07:22:00 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:
Attachments:
Description Flags
Proposed fix none

Description Tomas Jelinek 2014-05-06 14:21:56 UTC
Description of problem:
'pcs status nodes corosync' gives "Error: unable to locate command: /usr/sbin/corosync-cmapctl" instead of providing nodes info

How reproducible:
always

Steps to Reproduce:
1. run 'pcs status nodes corosync'

Actual results:
[root@rh65-node1 pcs]# pcs status nodes corosync
Error: unable to locate command: /usr/sbin/corosync-cmapctl
[root@rh65-node1 pcs]# echo $?
1

Expected results:
[root@rh65-node1 pcs]# pcs status nodes corosync
Corosync Nodes:
 Online: rh65-node1 rh65-node2
 Offline:
[root@rh65-node1 pcs]# echo $?
0

Comment 2 Tomas Jelinek 2014-05-07 12:25:49 UTC
Created attachment 893243 [details]
Proposed fix

Comment 3 Tomas Jelinek 2014-05-07 12:30:18 UTC
Test:
[root@rh65-node1 ~]# pcs status nodes corosync
Corosync Nodes:
 Online: rh65-node1 rh65-node2
 Offline:
[root@rh65-node1 ~]# echo $?
0

[root@rh65-node2 ~]# cman_tool leave force

[root@rh65-node1 ~]# pcs status nodes corosync
Corosync Nodes:
 Online: rh65-node1
 Offline: rh65-node2
[root@rh65-node1 ~]# echo $?
0

Comment 4 Chris Feist 2014-06-11 21:49:25 UTC
Fixed in pcs-0.9.120-2.el6:

[root@bid-05 pcs]# rpm -q pcs
pcs-0.9.120-2.el6.x86_64
[root@bid-05 pcs]# pcs status nodes corosync
Corosync Nodes:
 Online: bid-05 bid-06 
 Offline:

Comment 7 errata-xmlrpc 2014-10-14 07:22:00 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-1526.html

Comment 8 Huy VU 2015-12-02 21:29:56 UTC
I am seeing this problem in pcs 0.9.139.

[root@huysnpmvm9 ~]# rpm -q pcs
pcs-0.9.139-9.el6_7.1.x86_64
[root@huysnpmvm9 ~]# pcs status nodes corosync
No such file or directory
Error: unable to locate command: /usr/sbin/corosync-cmapctl
[root@huysnpmvm9 ~]# uname -a
Linux huysnpmvm9 2.6.32-504.16.2.el6.x86_64 #1 SMP Wed Apr 22 06:48:29 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@huysnpmvm9 ~]# cat /proc/version
Linux version 2.6.32-504.16.2.el6.x86_64 (mockbuild.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Apr 22 06:48:29 UTC 2015
[root@huysnpmvm9 ~]#
[root@huysnpmvm9 ~]# rpm -qa | grep -e coro -e pace
pacemaker-1.1.12-8.el6_7.2.x86_64
corosync-1.4.7-2.el6.x86_64
pacemaker-cli-1.1.12-8.el6_7.2.x86_64
perl-XML-NamespaceSupport-1.10-3.el6.noarch
pacemaker-libs-1.1.12-8.el6_7.2.x86_64
pacemaker-cluster-libs-1.1.12-8.el6_7.2.x86_64
corosynclib-1.4.7-2.el6.x86_64
[root@huysnpmvm9 ~]#

Comment 9 Radek Steiger 2015-12-03 11:49:43 UTC
Huy VU,

can you please provide what does "cat /etc/system-release /etc/redhat-release"  show you?

Comment 10 Huy VU 2015-12-03 15:53:46 UTC
Our company maintains a version Centos 6.6 and calls it Mitel Standard Linux.
Here's what the version files look like.

[root@huysnpmvm9 ~]# cat /etc/system-release /etc/redhat-release
Mitel Networks server 10.3.17.0
Mitel Standard Linux release 10.3.17.0
[root@huysnpmvm9 ~]#

This is equivalent to

bash-4.1$ cat /etc/system-release /etc/redhat-release
Red Hat Enterprise Linux Server release 6
CentOS release 6.6 (Final)
Red Hat Enterprise Linux Server release 6
CentOS release 6.6 (Final)

Comment 11 Chris Feist 2015-12-05 00:42:48 UTC
Huy Vu,

The problem you're seeing is that pcs is not properly detecting whether you're on a RHEL6 based system or a RHEL7 based system.

In your version of pcs it checks for the first two digits separated by a '.'.  If the first of the two digits is a 6, it assumes it's a RHEL 6 system, otherwise it assumes a RHEL 7 system.

With your system-release file it thinks it's on a RHEL 7 based system, which is why these problems are happening.

In future version of pcs for RHEL 6 we will be doing a better job of determining if it's a RHEL6 or RHEL7 system, but you'll have to wait for the 6.8 package of pcs to see those changes.

In the meantime you can fix this issue by hard coding the 'is_rhel6()' function in utils.py to always return true.

Comment 12 Huy VU 2015-12-07 14:15:44 UTC
Alright. I think I can work with that.