Bug 1283627

Summary: reading nodes id from pacemaker does not work on RHEL6
Product: Red Hat Enterprise Linux 6 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 6.7CC: cfeist, cluster-maint, rsteiger, tojeline
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.9.148-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: User creates a one-node cluster. Consequence: "pcs status" command crashes with traceback. Fix: Removed code which was dealing with pacemaker's node list trying to read pacemaker's node IDs as those are not supported nor needed on RHEL6 clusters. Result: "pcs status" command works properly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-10 19:27:11 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 2015-11-19 12:55:16 UTC
Reading nodes id from pacemaker does not work correctly on RHEL6. It is because of different output from "crm_node -l" on RHEL6 comparing to RHEL7:
> RHEL7
[root@rh71-node1:~]# pcs status nodes pacemaker-id
1 rh71-node1
2 rh71-node2
[root@rh71-node1:~]# crm_node -l
1 rh71-node1 member
2 rh71-node2 member
> RHEL6
[root@rh67-node1:~]# pcs status nodes pacemaker-id
rh67-node1 rh67-node2
[root@rh67-node1:~]# crm_node -l
rh67-node1 rh67-node2

This causes crashes of "pcs status" when run on a one-node cluster, and possible another issues as well.

Comment 2 Tomas Jelinek 2015-11-25 14:53:28 UTC
Created attachment 1098864 [details]
proposed fix

Test:

[root@rh67-node3:~]# pcs cluster setup --name=onenode rh67-node3 --start
rh67-node3: Updated cluster.conf...
Starting cluster on nodes: rh67-node3...
rh67-node3: Starting Cluster...

Before fix:
[root@rh67-node3:~]# pcs status
Cluster name: onenode
WARNING: no stonith devices and stonith-enabled is not false
Traceback (most recent call last):
  File "/usr/sbin/pcs", line 155, in <module>
    main(sys.argv[1:])
  File "/usr/sbin/pcs", line 147, in main
    status.status_cmd(argv)
  File "/usr/lib/python2.6/site-packages/pcs/status.py", line 13, in status_cmd
    full_status()
  File "/usr/lib/python2.6/site-packages/pcs/status.py", line 53, in full_status
    if utils.corosyncPacemakerNodeCheck():
  File "/usr/lib/python2.6/site-packages/pcs/utils.py", line 1975, in corosyncPacemakerNodeCheck
    pm_nodes = getPacemakerNodesID()
  File "/usr/lib/python2.6/site-packages/pcs/utils.py", line 1970, in getPacemakerNodesID
    pm_nodes[node_info[0]] = node_info[1]
IndexError: list index out of range

After fix:
[root@rh67-node3:~]# pcs status
Cluster name: onenode
WARNING: no stonith devices and stonith-enabled is not false
Last updated: Wed Nov 25 15:48:29 2015
Last change: Wed Nov 25 15:48:24 2015
Stack: cman
Current DC: rh67-node3 - partition with quorum
Version: 1.1.11-97629de
1 Nodes configured
0 Resources configured


Online: [ rh67-node3 ]

Full list of resources:


PCSD Status:
  rh67-node3: Online

Comment 3 Tomas Jelinek 2015-12-09 16:28:46 UTC
Before Fix:
[root@rh67-node3:~]# rpm -q pcs
pcs-0.9.139-9.el6.x86_64
[root@rh67-node3:~]# pcs cluster setup --name=onenode rh67-node3 --start
rh67-node3: Updated cluster.conf...
Starting cluster on nodes: rh67-node3...
rh67-node3: Starting Cluster...
[root@rh67-node3:~]# pcs status
Cluster name: onenode
WARNING: no stonith devices and stonith-enabled is not false
Traceback (most recent call last):
  File "/usr/sbin/pcs", line 155, in <module>
    main(sys.argv[1:])
  File "/usr/sbin/pcs", line 147, in main
    status.status_cmd(argv)
  File "/usr/lib/python2.6/site-packages/pcs/status.py", line 13, in status_cmd
    full_status()
  File "/usr/lib/python2.6/site-packages/pcs/status.py", line 53, in full_status
    if utils.corosyncPacemakerNodeCheck():
  File "/usr/lib/python2.6/site-packages/pcs/utils.py", line 1975, in corosyncPacemakerNodeCheck
    pm_nodes = getPacemakerNodesID()
  File "/usr/lib/python2.6/site-packages/pcs/utils.py", line 1970, in getPacemakerNodesID
    pm_nodes[node_info[0]] = node_info[1]
IndexError: list index out of range



After Fix:
[root@rh67-node3:~]# rpm -q pcs
pcs-0.9.148-1.el6.x86_64
[root@rh67-node3:~]# pcs cluster setup --name=onenode rh67-node3 --start
Destroying cluster on nodes: rh67-node3...
rh67-node3: Stopping Cluster (pacemaker)...
rh67-node3: Successfully destroyed cluster

Sending cluster config files to the nodes...
rh67-node3: Updated cluster.conf...

Starting cluster on nodes: rh67-node3...
rh67-node3: Starting Cluster...

Synchronizing pcsd certificates on nodes rh67-node3...
rh67-node3: Success

Restarting pcsd on the nodes in order to reload the certificates...
rh67-node3: Success
[root@rh67-node3:~]# pcs status
Cluster name: onenode
WARNING: no stonith devices and stonith-enabled is not false
Last updated: Wed Dec  9 17:16:07 2015
Last change: Wed Dec  9 17:15:57 2015
Current DC: NONE
1 Nodes configured
0 Resources configured


Node rh67-node3: UNCLEAN (offline)

Full list of resources:


PCSD Status:
  rh67-node3: Online

Comment 7 errata-xmlrpc 2016-05-10 19:27:11 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/RHBA-2016-0739.html