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 1896458 - Default rules with node attributes expressions can be created but are not in effect
Summary: Default rules with node attributes expressions can be created but are not in ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcs
Version: 8.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.5
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-10 15:48 UTC by Michal Mazourek
Modified: 2021-11-09 19:13 UTC (History)
7 users (show)

Fixed In Version: pcs-0.10.8-2.el8
Doc Type: Bug Fix
Doc Text:
Cause: User creates a resource defaults set with a rule and uses node attribute expressions in the rule. Consequence: The rule does not work as expected, since node attribute expressions are not actually supported for resource defaults. Fix: Check that node attribute expressions are not used in resource defaults. Result: Pcs exits with an error when node attribute expressions are used in a rule for resource defaults.
Clone Of:
Environment:
Last Closed: 2021-11-09 17:33:51 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix + tests (46.94 KB, patch)
2021-02-11 15:04 UTC, Tomas Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4142 0 None None None 2021-11-09 17:34:43 UTC

Description Michal Mazourek 2020-11-10 15:48:48 UTC
pcs needs to reflect this in resource defaults.


bz1891929 comment 8:
--- Additional comment from Ken Gaillot on 2020-11-06 22:24:49 UTC ---

After further investigation, we determined that it is correct but undocumented behavior that node attribute expressions are not supported for *meta-attributes*, except in the context of an operation or operation defaults. Node attribute expressions do not work with meta-attributes in a resource's configuration, resource defaults, or cluster properties.

Node attribute expressions should work for resource options (instance attributes), whether in the resource configuration or resource defaults, so it is correct that pcs allows node attribute expressions in resource defaults. (That can be used in testing the original bz.) It would probably be a good idea for pcs to reject the combination of meta and node attribute rules for resource defaults.

This makes sense when you consider that only an operation is directly associated with a single node. Most meta-attributes would make no sense being node-specific (target-role, allow-migrate, etc.). While some might (resource-stickiness, migration-threshold), that would be an unusual use case, and I'd rather wait until there is customer demand before formalizing that as an RFE.

I'm not sure whether this needs to be documented in RHEL. I believe rules are currently documented only in the context of location constraints (https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_high_availability_clusters/assembly_determining-resource-location-with-rules-configuring-and-managing-high-availability-clusters) so there's no existing place for it. Possibly the pcs man page could be updated for "pcs resource defaults".

Pacemaker should enforce proper rule syntax usage more strictly via its XML schema, but for compatibility reasons that is not feasible in the RHEL 8 time frame.

Comment 2 Tomas Jelinek 2021-02-11 15:04:20 UTC
Created attachment 1756379 [details]
proposed fix + tests

Test:

# pcs resource defaults set create rule resource ocf:heartbeat:Dummy and defined test_attr
Error: Keywords 'defined', 'not_defined', 'eq', 'ne', 'gte', 'gt', 'lte' and 'lt' cannot be used in a rule in this command
Error: Errors have occurred, therefore pcs is unable to continue

Comment 5 Miroslav Lisik 2021-06-14 14:20:12 UTC
Test:

[root@r8-node-01 ~]# rpm -q pcs
pcs-0.10.8-2.el8.x86_64

[root@r8-node-01 ~]# pcs resource defaults set create rule resource ocf:heartbeat:Dummy and defined test_attr
Error: Keywords 'defined', 'not_defined', 'eq', 'ne', 'gte', 'gt', 'lte' and 'lt' cannot be used in a rule in this command
Error: Errors have occurred, therefore pcs is unable to continue

Comment 11 errata-xmlrpc 2021-11-09 17:33:51 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 (Low: pcs security, bug fix, and enhancement update), 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/RHSA-2021:4142


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