Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1108319

Summary: cloned group resource ignores 'constraint avoids node'
Product: Red Hat Enterprise Linux 7 Reporter: michal novacek <mnovacek>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: michal novacek <mnovacek>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: abeekhof, cluster-maint, dvossel, tojeline
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.9.130-1.el7 Doc Type: Bug Fix
Doc Text:
Cause: User creates a constraint for a resource or group inside a clone or master/slave resource. Consequence: Created constraint does not have any effect on a cluster resources. Fix: Check whether the resource is inside a clone or master/slave resource when creating constraints. Result: Pcs displays an error message informing the user that he/she should use the clone or master/slave resource to put the constraint on including the name of the resource.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 09:19:53 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:
Attachments:
Description Flags
Output of 'pcs cluster cib'
none
proposed fix
none
proposed fix GUI - enable creating of constraints with cloned resources none

Description michal novacek 2014-06-11 17:14:14 UTC
Created attachment 907756 [details]
Output of 'pcs cluster cib'

Description of problem:
Cloning a group of resources and then creating location constraint avoiding the
group from running on one of the nodes seems to be ignored.

Version-Release number of selected component (if applicable):
pacemaker-1.1.10-29.el7.x86_64
pcs-0.9.115-32.el7.x86_64

How reproducible: always

Steps to Reproduce:
1) for a in 1 2 3; do pcs resource create dummy-$a Dummy --group dummies; done
2) pcs resource clone dummies
3) pcs constraint location dummies avoids <clusternode>

Actual results: nothing happens

Expected results: resource not running on <clusternode>

Comment 2 Andrew Beekhof 2014-06-11 22:29:36 UTC
Does 'pcs resource clone dummies' emit a clone name? (It should if not).
Thats the name you should use in the location constraint, not that of the thing inside the clone.

Comment 3 michal novacek 2014-06-12 12:16:51 UTC
I do not get anything back when running 'pcs resource clone dummies'. The clone is named dummies-clone.

Trying to create the constraint with 'dummies-clone' works indeed.

What is the correct behaviour of the constraints on groups/resources when they are cloned? It seems that they are just ignored even when they existed before the
resource has been cloned.

Comment 4 Andrew Beekhof 2014-06-25 12:54:43 UTC
The correct behaviour is to never refer to the "thing inside the clone/group" in constraints.  IIRC pcs even modifies existing constraints to observe this.

Chris is going to change pcs to emit some text to the effect of "don't use the non-clone name anymore" when a resource is cloned.

Comment 5 Andrew Beekhof 2014-07-10 10:13:00 UTC
Reassigning to pcs for the output change

Comment 6 Tomas Jelinek 2014-08-21 12:36:39 UTC
Created attachment 929192 [details]
proposed fix

Comment 7 Tomas Jelinek 2014-09-11 09:32:32 UTC
Before Fix:
[root@rh70-node1 ~]# rpm -q pcs
pcs-0.9.115-32.el7.x86_64
[root@rh70-node1 ~]# for a in 1 2 3; do pcs resource create dummy$a Dummy --group dummies; done
[root@rh70-node1 ~]# pcs resource clone dummies
[root@rh70-node1 ~]# pcs constraint location dummies avoids rh70-node1
[root@rh70-node1 ~]# echo $?
0
[root@rh70-node1 ~]# pcs constraint
Location Constraints:
  Resource: dummies
    Disabled on: rh70-node1
Ordering Constraints:
Colocation Constraints:

After Fix:
[root@rh70-node1 ~]# rpm -q pcs
pcs-0.9.126-1.el7.x86_64
[root@rh70-node1 ~]# for a in 1 2 3; do pcs resource create dummy$a Dummy --group dummies; done
[root@rh70-node1 ~]# pcs resource clone dummies
[root@rh70-node1 ~]# pcs constraint location dummies avoids rh70-node1
Error: dummies is a clone resource, you should use the clone id: dummies-clone when adding constraints. Use --force to override.
[root@rh70-node1 ~]# echo $?
1
[root@rh70-node1 ~]# pcs constraint
Location Constraints:
Ordering Constraints:
Colocation Constraints:
[root@rh70-node1 ~]# pcs constraint location dummies-clone avoids rh70-node1
[root@rh70-node1 ~]# pcs constraint
Location Constraints:
  Resource: dummies-clone
    Disabled on: rh70-node1 (score:-INFINITY)
Ordering Constraints:
Colocation Constraints:

Comment 9 Tomas Jelinek 2014-09-24 11:34:48 UTC
Created attachment 940747 [details]
proposed fix GUI - enable creating of constraints with cloned resources

Comment 10 Tomas Jelinek 2014-09-26 14:48:12 UTC
Before Fix:
[root@rh70-node1 ~]# rpm -q pcs
pcs-0.9.126-1.el7.x86_64
[root@rh70-node1:~]# pcs resource create dummy1 Dummy --clone
[root@rh70-node1:~]# pcs resource create dummy2 Dummy

Navigate to dummy1 resource page in GUI. Trying to add colocation preference with dummy2 resource results in an error message "Unable to add constraints: (Bad Request )" and the preference will not be added.


After Fix:
[root@rh70-node1:~]# rpm -q pcs
pcs-0.9.130-1.el7.x86_64
[root@rh70-node1:~]# pcs resource create dummy1 Dummy --clone
[root@rh70-node1:~]# pcs resource create dummy2 Dummy

Navigate to dummy1 resource page in GUI. Trying to add colocation preference with dummy2 resource successfully adds the preference referring to dummy1-clone resource.

[root@rh70-node1:~]# pcs constraint
Location Constraints:
Ordering Constraints:
  start dummy1-clone then start dummy2 (kind:Mandatory)
Colocation Constraints:

Comment 12 michal novacek 2015-01-16 15:58:25 UTC
I have verified that location constraint can be used with cloned groups with
pcs-0.9.137-11.el7.x86_64.

----

[root@duck-01 ~]# for a in 1 2 3; do pcs resource create dummy$a Dummy --group dummies; done 

[root@duck-01 ~]# pcs resource clone dummies

[root@duck-01 ~]# pcs resource
 Clone Set: dlm-clone [dlm]
     Started: [ duck-01 duck-02 duck-03 ]
 Clone Set: clvmd-clone [clvmd]
     Started: [ duck-01 duck-02 duck-03 ]
 Clone Set: dummies-clone [dummies]
     Started: [ duck-01 duck-02 duck-03 ]

[root@duck-01 ~]# pcs constraint location dummies-clone avoids duck-01

[root@duck-01 ~]# pcs resource
 Clone Set: dlm-clone [dlm]
     Started: [ duck-01 duck-02 duck-03 ]
 Clone Set: clvmd-clone [clvmd]
     Started: [ duck-01 duck-02 duck-03 ]
 Clone Set: dummies-clone [dummies]
     Started: [ duck-02 duck-03 ]
     Stopped: [ duck-01 ]

Comment 14 errata-xmlrpc 2015-03-05 09:19:53 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