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 1362493 - pcs does not support rsc-pattern in location constraints
Summary: pcs does not support rsc-pattern in location constraints
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.3
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: ---
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
Steven J. Levine
URL:
Whiteboard:
Depends On:
Blocks: 1424387
TreeView+ depends on / blocked
 
Reported: 2016-08-02 11:11 UTC by Tomas Jelinek
Modified: 2017-12-03 10:09 UTC (History)
9 users (show)

Fixed In Version: pcs-0.9.157-1.el7
Doc Type: Release Note
Doc Text:
Support for regular expressions in `pcs` command line when configuring location constraints `pcs` now supports regular expressions in location constraints on the command line. These constraints apply to multiple resources based on the regular expression matching resource name. This simplifies cluster management as one constraint may be used where several were needed before.
Clone Of:
: 1424387 (view as bug list)
Environment:
Last Closed: 2017-08-01 18:22:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix (71.57 KB, patch)
2017-02-17 16:49 UTC, Tomas Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1420437 0 medium CLOSED cli: automatic CIB upgrade missing for "pcs constraint location add ... resource-discovery=..." 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2017:1958 0 normal SHIPPED_LIVE pcs bug fix and enhancement update 2017-08-01 18:09:47 UTC

Internal Links: 1420437

Description Tomas Jelinek 2016-08-02 11:11:43 UTC
<rsc_location id="location-haproxy-ips" resource-discovery="exclusive" rsc-pattern="^(ip-.*)">
<rsc_location id="location-nova-compute-clone" resource-discovery="exclusive" rsc-pattern="nova-compute-(.*)">

It has been kicking around for a while but mostly in the experimental part of the schema. Now it is in upstream master. Still have to document it, but it is
fairly self-explanatory. Expected in rhel 7.4.

Comment 1 Tomas Jelinek 2016-08-02 15:13:21 UTC
"rsc-pattern" is supported since validate-with=pacemaker-2.6

Comment 3 Tomas Jelinek 2017-02-17 16:49:19 UTC
Created attachment 1254330 [details]
proposed fix

Tests are included in the patch.

Comment 4 Ivan Devat 2017-04-10 15:48:17 UTC
After Fix:

[vm-rhel72-1 ~] $ rpm -q pcs
pcs-0.9.157-1.el7.x86_64

Setup:
pcs resource create R ocf:heartbeat:Dummy

1)
[vm-rhel72-1 ~] $ pcs constraint location %R prefers vm-rhel72-1
[vm-rhel72-1 ~] $ pcs cluster cib|grep "rsc_location" -B1 -A1
    <constraints>
      <rsc_location id="location-R-vm-rhel72-1-INFINITY" node="vm-rhel72-1" rsc="R" score="INFINITY"/>
    </constraints>
[vm-rhel72-1 ~] $ pcs constraint remove location-R-vm-rhel72-1-INFINITY

2)
[vm-rhel72-1 ~] $ pcs constraint location resource%R prefers vm-rhel72-1
[vm-rhel72-1 ~] $ pcs cluster cib|grep "rsc_location" -B1 -A1
    <constraints>
      <rsc_location id="location-R-vm-rhel72-1-INFINITY" node="vm-rhel72-1" rsc="R" score="INFINITY"/>
    </constraints>
[vm-rhel72-1 ~] $ pcs constraint remove location-R-vm-rhel72-1-INFINITY

3)
[vm-rhel72-1 ~] $ pcs constraint location regexp%res_[0-9] prefers node1
[vm-rhel72-1 ~] $ pcs cluster cib|grep "rsc_location" -B1 -A1
    <constraints>
      <rsc_location id="location-res_0-9-node1-INFINITY" node="node1" rsc-pattern="res_[0-9]" score="INFINITY"/>
    </constraints>
[vm-rhel72-1 ~] $ pcs constraint remove location-res_0-9-node1-INFINITY

4)
[vm-rhel72-1 ~] $ pcs constraint location "regexp%res_[0-9]" avoids node1
[vm-rhel72-1 ~] $ pcs cluster cib|grep "rsc_location" -B1 -A1
    <constraints>
      <rsc_location id="location-res_0-9-node1--INFINITY" node="node1" rsc-pattern="res_[0-9]" score="-INFINITY"/>
    </constraints>
[vm-rhel72-1 ~] $ pcs constraint remove location-res_0-9-node1--INFINITY

5)
[vm-rhel72-1 ~] $ pcs constraint location add my-id "regexp%res_[0-9]" node1 INFINITY
[vm-rhel72-1 ~] $ pcs cluster cib|grep "rsc_location" -B1 -A1
    <constraints>
      <rsc_location id="my-id" node="node1" rsc-pattern="res_[0-9]" score="INFINITY"/>
    </constraints>
[vm-rhel72-1 ~] $ pcs constraint remove my-id

6)
[vm-rhel72-1 ~] $ pcs constraint location "regexp%res_[0-9]"  rule '#uname' eq node1
[vm-rhel72-1 ~] $ pcs cluster cib|grep "<rsc_location" -B1 -A5
    <constraints>
      <rsc_location id="location-res_0-9" rsc-pattern="res_[0-9]">
        <rule id="location-res_0-9-rule" score="INFINITY">
          <expression attribute="#uname" id="location-res_0-9-rule-expr" operation="eq" value="node1"/>
        </rule>
      </rsc_location>
    </constraints>
[vm-rhel72-1 ~] $ pcs constraint remove location-res_0-9

Comment 10 errata-xmlrpc 2017-08-01 18:22: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://access.redhat.com/errata/RHBA-2017:1958


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