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 1110166 - [RFE] allow user to specify constraint id on its creation
Summary: [RFE] allow user to specify constraint id on its creation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Tomas Jelinek
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 1129857
TreeView+ depends on / blocked
 
Reported: 2014-06-17 07:29 UTC by michal novacek
Modified: 2015-03-05 09:19 UTC (History)
5 users (show)

Fixed In Version: pcs-0.9.132-1.el7
Doc Type: Enhancement
Doc Text:
Feature: Allow user to specify constraint id when creating a constraint. Reason: When user uses some automated tool to work with constraints it is easier to specify a constraint id instead of detecting what id has been automatically created by pcs. Result: User is able to set constraint id when creating a constraint.
Clone Of:
: 1129857 (view as bug list)
Environment:
Last Closed: 2015-03-05 09:19:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix (32.97 KB, patch)
2014-10-03 10:50 UTC, Tomas Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0415 0 normal SHIPPED_LIVE pcs bug fix and enhancement update 2015-03-05 14:16:41 UTC

Description michal novacek 2014-06-17 07:29:56 UTC
Description of problem:
At this moment (pcs-0.9.115-32.el7.x86_64) the automated (script) deletion of
constraints in the cluster is quite uncomfortable when you want to delete a
specific constraint referencing a resource that has more than one constraint.
This gets even more tricky by the fact that we can have the exactly same
consrtaints severel times and possible given by two different means: order r1
then r2 VS order set r1 r2.

The workflow of our automated script is as follows:
    1) create cluster and resources
    2) create some constraints
    3) verify that everything is correctly running
    4) verify that all the constraints are seen in 'pcs cluster cib' and that
        colocation and location constraints are really fulfilled

What we do now is that we list all constraint ids in cluster configuration
before and after adding a new constraint to find out its id. 


Would it be possible to add something like '--id=...' to 'pcs constraint' to
give the user ability to specify the id of the constraint being created?

Comment 3 Tomas Jelinek 2014-10-03 10:50:58 UTC
Created attachment 943699 [details]
proposed fix

Comment 4 Tomas Jelinek 2014-10-14 11:14:22 UTC
Before Fix:
[root@rh70-node1 ~]# rpm -q pcs
pcs-0.9.115-32.el7.x86_64
[root@rh70-node1:~]# pcs constraint location dummy1 rule constraint-id=con1 defined pingd
Error: Unable to update cib
Call cib_replace failed (-203): Update does not conform to the configured schema
<cib admin_epoch="0" cib-last-written="Tue Oct 14 11:11:33 2014" crm_feature_set="3.0.9" epoch="7370" have-quorum="1" num_updates="0" update-client="cibadmin" update-origin="rh70-node1" validate-with="pacemaker-1.2" dc-uuid="2">
{output trimmed}
[root@rh70-node1:~]# man pcs | tr -s ' ' | grep -C1 'order \[action\]'

 order [action] <resource id> then [action] <resource id> [options]
 Add an ordering constraint specifying actions (start,stop,promote, demote) and if no action is specified the default action will be start. Available options are kind=Optional/Mandatory/Serialize and symmetrical=true/false
[root@rh70-node1:~]# pcs constraint order dummy1 then dummy2 id=con2
Adding dummy1 dummy2 (kind: Mandatory) (Options: id=con2 first-action=start then-action=start)
[root@rh70-node1:~]# pcs constraint order set dummy1 dummy2 setoptions id=con3
Error: Unable to update cib
Call cib_replace failed (-203): Update does not conform to the configured schema
<cib admin_epoch="0" cib-last-written="Tue Oct 14 11:15:11 2014" crm_feature_set="3.0.9" epoch="7371" have-quorum="1" num_updates="0" update-client="cibadmin" update-origin="rh70-node1" validate-with="pacemaker-1.2" dc-uuid="2">
{output trimmed}
[root@rh70-node1:~]# man pcs | tr -s ' ' | grep -C0 'colocation add'
 colocation add [master|slave] <source resource id> with [master|slave]
[root@rh70-node1:~]# pcs constraint colocation add dummy1 with dummy2 id=con4
[root@rh70-node1:~]# man pcs | tr -s ' ' | grep -C1 'colocation set'

 colocation set <resource1> <resource2> [resourceN]... [setoptions] ...
 [set <resourceX> <resourceY> ...] [setoptions <name>=<value>...] Create a colocation constraint with a resource set
[root@rh70-node1:~]# pcs constraint colocation set dummy1 dummy2 setoptions id=con5
[root@rh70-node1:~]# pcs constraint --full
Location Constraints:
Ordering Constraints:
  start dummy1 then start dummy2 (Mandatory) (id:con2)
Colocation Constraints:
  dummy1 with dummy2 (INFINITY) (id:con4)
  Resource Sets:
    set dummy1 dummy2 (id:pcs_rsc_set_dummy1_dummy2) setoptions score=INFINITY (id:con5)


After Fix:
[root@rh70-node1:~]# rpm -q pcs
pcs-0.9.132-1.el7.x86_64
[root@rh70-node1:~]# pcs constraint location dummy1 rule constraint-id=con1 defined pingd
[root@rh70-node1:~]# man pcs | tr -s ' ' | grep -C1 'order \[action\]'

 order [action] <resource id> then [action] <resource id> [options]
 Add an ordering constraint specifying actions (start, stop, promote, demote) and if no action is specified the default action will be start. Available options are kind=Optional/Mandatory/Serialize, symmetrical=true/false and id=<constraint-id>.
[root@rh70-node1:~]# pcs constraint order dummy1 then dummy2 id=con2
Adding dummy1 dummy2 (kind: Mandatory) (Options: id=con2 first-action=start then-action=start)
[root@rh70-node1:~]# pcs constraint order set dummy1 dummy2 setoptions id=con3
root@rh70-node1:~]# man pcs | tr -s ' ' | grep -C0 'colocation add'
 colocation add [master|slave] <source resource id> with [master|slave] <target resource id> [score] [options] [id=constraint-id]
[root@rh70-node1:~]# pcs constraint colocation add dummy1 with dummy2 id=con4
[root@rh70-node1:~]# man pcs | tr -s ' ' | grep -C1 'colocation set'

 colocation set <resource1> <resource2> [resourceN]... [options] [set <resourceX> <resourceY> ... [options]] [setoptions [constraint_options]]
 Create a colocation constraint with a resource set. Available options are sequential=true/false, require-all=true/false, action=start/promote/demote/stop and role=Stopped/Started/Master/Slave. Available constraint_options are id, score, score-
[root@rh70-node1:~]# pcs constraint colocation set dummy1 dummy2 setoptions id=con5
[root@rh70-node1:~]# pcs constraint --full
Location Constraints:
  Resource: dummy1
    Constraint: con1
      Rule: score=INFINITY  (id:con1-rule)
        Expression: defined pingd  (id:con1-rule-expr)
Ordering Constraints:
  start dummy1 then start dummy2 (kind:Mandatory) (id:con2)
  Resource Sets:
    set dummy1 dummy2 (id:pcs_rsc_set_dummy1_dummy2) (id:con3)
Colocation Constraints:
  dummy1 with dummy2 (score:INFINITY) (id:con4)
  Resource Sets:
    set dummy1 dummy2 (id:pcs_rsc_set_dummy1_dummy2-1) setoptions score=INFINITY (id:con5)

Comment 7 Jiri Herrmann 2014-12-12 15:31:56 UTC
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

Comment 8 Tomas Jelinek 2014-12-15 14:14:51 UTC
Jiri,
I think this feature is not important enough to be included in the Release Notes, users usually do not need to care about ids and the feature was meant mainly to make automated testing easier.

Comment 9 Steven J. Levine 2014-12-15 14:49:37 UTC
For reasons similar to those that Tomas notes, we did not document this feature in the pcs reference manual either, for reasons explained in BZ#1129857.

Comment 11 errata-xmlrpc 2015-03-05 09:19:57 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-2015-0415.html


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