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.
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.
DescriptionMichal 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.
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
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
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