Red Hat Bugzilla – Bug 1362493
pcs does not support rsc-pattern in location constraints
Last modified: 2017-12-03 05:09:13 EST
<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.
"rsc-pattern" is supported since validate-with=pacemaker-2.6
Created attachment 1254330 [details] proposed fix Tests are included in the patch.
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
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