Bug 1115537
Summary: | [RFE] 'pcs cluster cib': implement --scope as cibadmin does | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | michal novacek <mnovacek> | ||||||
Component: | pcs | Assignee: | Tomas Jelinek <tojeline> | ||||||
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 7.0 | CC: | cfeist, cluster-maint, rsteiger, slevine, tojeline | ||||||
Target Milestone: | rc | Keywords: | FutureFeature | ||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | pcs-0.9.137-2.el7 | Doc Type: | Enhancement | ||||||
Doc Text: |
Feature:
Provide a way to edit/view part of the CIB.
Reason:
User wants to view/edit only part of the CIB.
Result:
User is able to view/edit part of the CIB.
|
Story Points: | --- | ||||||
Clone Of: | |||||||||
: | 1129871 1190168 (view as bug list) | Environment: | |||||||
Last Closed: | 2015-03-05 09:20: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: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 1129871, 1190168 | ||||||||
Attachments: |
|
Description
michal novacek
2014-07-02 14:46:01 UTC
Created attachment 943334 [details]
proposed fix
Test:
[root@rh70-node1:~]# pcs cluster cib scope=nodes
<nodes>
<node id="1" uname="rh70-node1"/>
<node id="2" uname="rh70-node2"/>
</nodes>
[root@rh70-node1:~]# pcs cluster edit scope=resources
{only the resources configuration is shown in an editor}
[root@rh70-node1:~]# pcs resource create dummy Dummy
[root@rh70-node1:~]# pcs constraint location dummy prefers rh70-node1
[root@rh70-node1:~]# pcs constraint
Location Constraints:
Resource: dummy
Enabled on: rh70-node1
Ordering Constraints:
Colocation Constraints:
[root@rh70-node1:~]# pcs resource
dummy (ocf::heartbeat:Dummy): Started
[root@rh70-node1:~]# echo "<cib><configuration><resources/><constraints/></configuration></cib>" > cib.xml
[root@rh70-node1:~]# ./pcs cluster cib-push cib.xml scope=constraints
CIB updated
[root@rh70-node1:~]# pcs constraint
Location Constraints:
Ordering Constraints:
Colocation Constraints:
[root@rh70-node1:~/devel/pcs/pcs]# pcs resource
dummy (ocf::heartbeat:Dummy): Started
Before Fix: [root@rh70-node1 ~]# rpm -q pcs pcs-0.9.115-32.el7.x86_64 [root@rh70-node1:~]# ls scope=nodes ls: cannot access scope=nodes: No such file or directory [root@rh70-node1:~]# pcs cluster cib scope=nodes [root@rh70-node1:~]# ls scope=nodes scope=nodes [root@rh70-node1:~]# EDITOR=`which cat` pcs cluster edit scope=nodes <cib admin_epoch="0" cib-last-written="Tue Oct 14 11:04:25 2014" crm_feature_set="3.0.9" epoch="7362" have-quorum="1" num_updates="2" update-client="cibadmin" update-origin="rh70-node1" validate-with="pacemaker-1.2" dc-uuid="2"> {whole cib gets printed, output trimmed} [root@rh70-node1:~]# pcs cluster cib-push cib.xml scope=constraints Usage: pcs cluster [commands]... Configure cluster for use with pacemaker {output trimmed} After Fix: [root@rh70-node1:~]# rpm -q pcs pcs-0.9.132-1.el7.x86_64 [root@rh70-node1:~]# pcs cluster cib scope=nodes <nodes> <node id="1" uname="rh70-node1"/> <node id="2" uname="rh70-node2"/> </nodes> [root@rh70-node1:~]# EDITOR=`which cat` pcs cluster edit scope=nodes <nodes> <node id="1" uname="rh70-node1"/> <node id="2" uname="rh70-node2"/> </nodes> CIB not updated, no changes detected [root@rh70-node1:~]# pcs resource create dummy Dummy [root@rh70-node1:~]# pcs constraint location dummy prefers rh70-node1 [root@rh70-node1:~]# echo "<cib><configuration><resources/><constraints/></configuration></cib>" > cib.xml [root@rh70-node1:~]# pcs cluster cib-push cib.xml scope=constraints CIB updated [root@rh70-node1:~]# pcs constraint Location Constraints: Ordering Constraints: Colocation Constraints: [root@rh70-node1:~]# pcs resource dummy (ocf::heartbeat:Dummy): Started Created attachment 965905 [details]
proposed fix - error messages
Before Fix:
[root@rh70-node1:~]# rpm -q pcs
pcs-0.9.137-1.el7.x86_64
[root@rh70-node1:~]# pcs cluster cib scope=rsc_defaults
Error: unable to get cib
[root@rh70-node1:~]# EDITOR=cat pcs cluster edit scope=rsc_defaults
Error: unable to get cib
[root@rh70-node1:~]# pcs cluster cib /tmp/cib.xml
[root@rh70-node1:~]# pcs cluster cib-push /tmp/cib.xml scope=rsc_defaults
Error: unable to push cib
Call cib_replace failed (-22): Invalid argument
After Fix:
[root@rh70-node1:~]# rpm -q pcs
pcs-0.9.137-2.el7.x86_64
[root@rh70-node1:~]# pcs cluster cib scope=rsc_defaults
Error: unable to get cib, scope 'rsc_defaults' not present in cib
[root@rh70-node1:~]# EDITOR=cat pcs cluster edit scope=rsc_defaults
Error: unable to get cib, scope 'rsc_defaults' not present in cib
[root@rh70-node1:~]# pcs cluster cib /tmp/cib.xml
[root@rh70-node1:~]# pcs cluster cib-push /tmp/cib.xml scope=rsc_defaults
Error: unable to push cib, scope 'rsc_defaults' not present in new cib
If this Feature should be included in the 7.1 Release Notes, could you please change the Doc Type from Enhancement to "Release Note"? Note that the Release Notes are intended to list the most prominent and customer-relevant new features rather than every single enhancement. Cheers, Jirka Jiri, I think this feature is not important enough to be included in the Release Notes, it is a minor enhancement. Just to follow up on what Tomas says here: The feature is minor enough in scope (and pretty much for testers rather than users) that we decided not to document it in the pcs reference manual either, as noted in BZ#1129871. 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-2015-0415.html |