RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1230368 - Improve pcs cluster cib-push help text
Summary: Improve pcs cluster cib-push help text
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: pcs
Version: 6.7
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1230908
TreeView+ depends on / blocked
 
Reported: 2015-06-10 17:48 UTC by Jan Pokorný [poki]
Modified: 2016-05-10 19:27 UTC (History)
3 users (show)

Fixed In Version: pcs-0.9.145-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1230908 (view as bug list)
Environment:
Last Closed: 2016-05-10 19:27:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix (4.99 KB, patch)
2015-09-10 12:27 UTC, Tomas Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0739 0 normal SHIPPED_LIVE pcs bug fix update 2016-05-10 22:29:32 UTC

Description Jan Pokorný [poki] 2015-06-10 17:48:07 UTC
# echo "xpath /cib/configuration/nodes/*" \
  | xmllint --shell /var/lib/pacemaker/cib/cib.xml
> / > Object is a Node Set :
> Set contains 0 nodes:

# echo "xpath /cluster/clusternodes/clusternode/@name" \
  | xmllint --shell /etc/cluster/cluster.conf
> / > Object is a Node Set :
> Set contains 3 nodes:
> 1  ATTRIBUTE name
>     TEXT
>       content=virt-092
> 2  ATTRIBUTE name
>     TEXT
>       content=virt-094
> 3  ATTRIBUTE name
>     TEXT
>       content=virt-097

-->

# pcs cluster status
> Cluster Status:
>  Last updated: Wed Jun 10 19:46:40 2015
>  Last change: Wed Jun 10 19:17:08 2015
>  Current DC: NONE
>  0 Nodes configured
>  3 Resources configured
> 
> PCSD Status:
>   virt-092: Online
>   virt-094: Online
>   virt-097: Online

Comment 2 Jan Pokorný [poki] 2015-06-10 17:51:21 UTC
Note that this situation was created just by pcs commands:

# pcs cluster setup ...
# pcs -f cib.xml ...; pcs -f cib.xml ...; ...
# pcs cluster cib-push cib.xml --config

so a user carelessness is not be be blamed here.

Comment 3 Jan Pokorný [poki] 2015-06-10 18:04:06 UTC
* so a user's carelessness is not to be blamed here


Note that underlying cibadmin command does support also --xpath option
and it would be helpfull:

1/ add support for xpath passthrough (e.g., if scope starts with
   a slash, treat it as an XPath expression)

2/ --config option was made an alias to
>  scope=/cib/config/*[name() != 'nodes']
   so the nodes section is not included (hence overwritten)

Comment 4 Jan Pokorný [poki] 2015-06-11 12:02:44 UTC
re [comment 2]:

Apparently, the clarity is lacking behind if it's not clear that cluster
was indeed started, hence correcting the first command to:

# pcs cluster setup --start ...

Comment 5 Jan Pokorný [poki] 2015-06-11 18:17:25 UTC
Note that in the situation per [comment 0], crm_node still produces
expected results (confirming that Pacemaker is perfectly aware of
the nodes, unlike pcs):

# crm_node -l
> virt-092 virt-094 virt-097

Comment 6 Jan Pokorný [poki] 2015-06-11 18:26:02 UTC
"pcs cluster cib-push doesn't allow to utilize XPath filter provided by
underlying cibadmin" issue covered in [comment 2] and [comment 3] split
off as a separate [bug 1230908].

Comment 7 Tomas Jelinek 2015-09-09 08:32:32 UTC
Proper reproducer:

pcs cluster setup --name test rh67-node1 rh67-node2 --start && \
for i in {1..3}; do pcs -f aaa.xml resource create dummy${i} Dummy; done && \
pcs cluster cib-push aaa.xml && \
echo '===== crm_node =====' && \
crm_node -l && \
echo '===== crm_mon =====' && \
crm_mon -1 && \
echo '===== pcs status =====' && \
pcs status

[root@rh67-node1:~]# pcs cluster setup --name test rh67-node1 rh67-node2 --start && \
> for i in {1..3}; do pcs -f aaa.xml resource create dummy${i} Dummy; done && \
> pcs cluster cib-push aaa.xml && \
> echo '===== crm_node =====' && \
> crm_node -l && \
> echo '===== crm_mon =====' && \
> crm_mon -1 && \
> echo '===== pcs status =====' && \
> pcs status
rh67-node1: Updated cluster.conf...
rh67-node2: Updated cluster.conf...
Starting cluster on nodes: rh67-node1, rh67-node2...
rh67-node2: Starting Cluster...
rh67-node1: Starting Cluster...
CIB updated
===== crm_node =====
rh67-node1 rh67-node2 
===== crm_mon =====
Last updated: Wed Sep  9 10:27:26 2015
Last change: Wed Sep  9 10:27:26 2015
Current DC: NONE
0 Nodes configured
3 Resources configured



===== pcs status =====
Cluster name: test
WARNING: no stonith devices and stonith-enabled is not false
Last updated: Wed Sep  9 10:27:26 2015
Last change: Wed Sep  9 10:27:26 2015
Current DC: NONE
0 Nodes configured
3 Resources configured



Full list of resources:

 dummy1 (ocf::heartbeat:Dummy): Stopped 
 dummy2 (ocf::heartbeat:Dummy): Stopped 
 dummy3 (ocf::heartbeat:Dummy): Stopped 



As expected it's actually crm_mon output where the nodes are missing. After a while the issue is fixed:

[root@rh67-node1:~]# crm_mon -1
Last updated: Wed Sep  9 10:28:06 2015
Last change: Wed Sep  9 10:27:41 2015
Stack: cman
Current DC: rh67-node2 - partition with quorum
Version: 1.1.11-97629de
2 Nodes configured
3 Resources configured


Online: [ rh67-node1 rh67-node2 ]



We need to investigate this further.

Comment 8 Tomas Jelinek 2015-09-09 08:43:45 UTC
If the CIB from the cluster is used instead of an empty one, everything works:

[root@rh67-node1:~]# pcs cluster setup --name test rh67-node1 rh67-node2 --start && \
> pcs cluster cib > aaa.xml && \
> for i in {1..3}; do pcs -f aaa.xml resource create dummy${i} Dummy; done && \
> pcs cluster cib-push aaa.xml && \
> echo '===== crm_node =====' && \
> crm_node -l && \
> echo '===== crm_mon =====' && \
> crm_mon -1 && \
rh67-node1: Updated cluster.conf...
rh67-node2: Updated cluster.conf...
Starting cluster on nodes: rh67-node1, rh67-node2...
rh67-node2: Starting Cluster...
rh67-node1: Starting Cluster...
CIB updated
===== crm_node =====
rh67-node1 rh67-node2 
===== crm_mon =====
Last updated: Wed Sep  9 10:40:07 2015
Last change: Wed Sep  9 10:40:07 2015
Current DC: NONE
2 Nodes configured
3 Resources configured


Node rh67-node1: UNCLEAN (offline)
Node rh67-node2: UNCLEAN (offline)


So the cause of the reported issue is the nodes section of the CIB has been overwritten by an empty list of nodes from an empty CIB.

Comment 9 Tomas Jelinek 2015-09-09 14:23:14 UTC
The cause of the reported issue is the nodes section of the CIB has been overwritten by an empty list of nodes from an empty CIB. This is perfectly OK as it is what user wanted to do by pushing an empty node list.

However help text/documentation of the 'pcs cluster cib-push' command could be improved e.g. like this:
Push the raw xml from <filename> to the CIB (Cluster Information Base).  You can obtain the CIB by running the 'pcs cluster cib' command, which is recommended first step when you want to perform desired modifications (pcs -f <command>) for the one-off push.
Be aware the selected scope of the CIB will be overwritten by the current content of the specified file.

Comment 10 Jan Pokorný [poki] 2015-09-09 16:35:19 UTC
The original gear exercising the recipe per [comment 2] was revisited
to fix the assumptions behind how "pcs cluster cib-push" works, i.e.,
along the lines of [comment 9] -- one should not start with temporary
CIB file not preinitiated with the currently used content so as to
prevent from dropping existing bits undesirably, but start with them
right away instead: https://pagure.io/clufter/0ebae33

Having the better documentation beforehand would definitely help.

Comment 11 Tomas Jelinek 2015-09-10 12:27:16 UTC
Created attachment 1072155 [details]
proposed fix

Comment 13 Tomas Jelinek 2015-11-04 11:42:57 UTC
After Fix:
[root@rh67-node1:~]# rpm -q pcs
pcs-0.9.145-1.el6.x86_64
Help and man page modified as described in comment 9.

Comment 17 errata-xmlrpc 2016-05-10 19:27:44 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


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