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 2168155 - Creating meta attributes for resource clones should be more intuitive and consistent
Summary: Creating meta attributes for resource clones should be more intuitive and con...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: pcs
Version: 9.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 9.3
Assignee: Tomas Jelinek
QA Contact: cluster-qe
Steven J. Levine
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-08 10:31 UTC by Nina Hostakova
Modified: 2023-11-07 09:00 UTC (History)
7 users (show)

Fixed In Version: pcs-0.11.6-1.el9
Doc Type: Enhancement
Doc Text:
.New `pcs` parsing requires `meta` keyword when specifying clone meta attributes To ensure consistency in the `pcs` command format, configuring clone meta attributes with the `pcs resource clone`, `pcs resource promotable`, and `pcs resource create` commands without specifying the `meta` keyword is now deprecated. Previously, the `meta` keyword was ignored in the `pcs resource clone` and `pcs resource promotable` commands. In the `pcs resource create` command, however, the meta attributes specified after the `meta` keyword when it followed the `clone` keyword were assigned to the resource rather than to the clone. With this updated parsing algorithm, meta attributes specified after the `meta` keyword when it follows the `clone` keyword are assigned to the clone. To maintain compatibility with existing scripts which rely on the older format, you must specify the `--future` command option to enable this new argument processing when creating a cloned resource with the `pcs resource create` command. The following command now creates a resource with the meta attribute `mv=v1` and a clone with the meta attribute `mv=v2`: `pcs resource create dummy1 ocf:pacemaker:Dummy meta m1=v1 clone meta m2=v2 --future`
Clone Of:
: 2168159 (view as bug list)
Environment:
Last Closed: 2023-11-07 08:23:10 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1741056 0 medium CLOSED [RFE] Make it possible to set custom (promotable) clone id 2023-05-27 09:48:18 UTC
Red Hat Issue Tracker CLUSTERQE-6633 0 None None None 2023-04-19 22:22:57 UTC
Red Hat Issue Tracker RHELPLAN-147947 0 None None None 2023-02-08 10:32:48 UTC
Red Hat Product Errata RHSA-2023:6316 0 None None None 2023-11-07 08:24:03 UTC

Description Nina Hostakova 2023-02-08 10:31:54 UTC
Description of problem:
When creating meta attributes for clones, keyword 'meta' is currently not used according to the documentation. However, it is not forbidden and user can obtain different results when creating a cloned resource in one step vs. when creating a resource and then clone it:

# pcs resource create d1 ocf:pacemaker:Dummy clone meta globally-unique=True
# pcs resource create d2 ocf:pacemaker:Dummy
# pcs resource clone d2 meta globally-unique=True
# pcs resource config
...
Clone: d1-clone
  Resource: d1 (class=ocf provider=pacemaker type=Dummy)
    Meta Attributes: d1-meta_attributes
      globally-unique=True
...

Clone: d2-clone
  Meta Attributes: d2-clone-meta_attributes
    globally-unique=True
  Resource: d2 (class=ocf provider=pacemaker type=Dummy)
...


Actual results:
Specifying 'meta' keyword after 'clone' when creating a cloned resource will create a resource primitive meta attribute whereas cloning the original resource with the same parameters will create a clone meta attribute.

Expected results:
The behavior should be consistent. If using keyword 'meta' is not any longer supported for creating clone meta attributes it should be forbidden or an alternative solution should be found to make the usage intuitive.

Comment 1 Tomas Jelinek 2023-03-20 10:33:26 UTC
Creating meta attributes for clones is consistent. In both `pcs resource create` and `pcs resource clone` commands, meta attributes for the clone are expected after the `clone` keyword (in `pcs resource clone` command, resource id and optional clone id stand between `clone` and clone meta attributes). On the other hand, meta attributes for a primitive resource are specified after `meta` keyword in `pcs resource create` command, while `pcs resource clone` command doesn't accept meta attributes for primitive resources. That's how it is documented and implemented.

The only problem here is that `pcs resource clone` ignores `meta` in `pcs resource clone d2 meta globally-unique=True` instead of using it as a clone id as documented: `pcs resource clone <resource id | group id> [<clone id>] [clone options]... [--wait[=n]]`.

Comment 2 Tomas Jelinek 2023-03-20 12:40:11 UTC
The problem here is, that `meta` has been always silently ignored in this command. We cannot just drop it all of a sudden. Doing so would break backward compatibility. The best we can do now is deprecate it a drop in the next major release.

Comment 5 Michal Pospisil 2023-05-26 09:28:11 UTC
DevTestResults:

[root@r09-03-a ~]# rpm -q pcs
pcs-0.11.5-1.el9.x86_64

(pcs) [root@r09-03-a pcs]# pcs_test/suite --installed --traditional-verbose pcs_test.tier1.cib_resource.test_clone_unclone.Clone.test_clone_with_options
pcs_test.tier1.cib_resource.test_clone_unclone.Clone.test_clone_with_options (subunit.RemotedTestCase)
pcs_test.tier1.cib_resource.test_clone_unclone.Clone.test_clone_with_options ... OK

----------------------------------------------------------------------
Ran 1 test in 1.100s

OK

Comment 6 Ondrej Mular 2023-05-30 11:15:31 UTC
After conducting additional review and considering other pcs commands that may be affected by this decision, we have concluded that deprecating the usage of the meta keyword is not the right approach. Instead, we have decided to require its usage. This change will enable us to introduce support for instance attributes for clones in the future, if needed or requested. It's worth noting that pacemaker already supports instance attributes for clones [1].

To ensure consistency in pcs commands, the meta keyword will be mandatory for all types of resources when specifying resource meta attributes. This requirement will also be reflected in the pcs documentation, including the pcs --help and man page.

However, in RHEL 9, pcs will still maintain support for the current CLI options parsing, where options before and after the meta keyword are merged and set as meta attributes for group and clone resources. This legacy option parsing approach will be deprecated, and a deprecation warning will be displayed whenever this syntax is used. Eventually, it will be removed in a future major release.

If you have any questions or additional input regarding this decision, please don't hesitate to let us know.

Affected commands:
 * pcs resource create
 * pcs resource update
 * pcs resource clone
 * pcs resource promotable

[1]: https://clusterlabs.org/pacemaker/doc/2.1/Pacemaker_Explained/singlehtml/index.html#clone-instance-attribute

Comment 8 Tomas Jelinek 2023-06-19 13:03:40 UTC
Upstream patches:
* pcs resource clone, pcs resource promotable: https://github.com/ClusterLabs/pcs/commit/b2366b897d3068c7f51dbc9d56fad27d80b9873a
* pcs resource create: https://github.com/ClusterLabs/pcs/commit/c2677e0bf28f17fc4dd7f093e88afa829843dc6f
(pcs resource update will be fixed later - it is currently being overhauled and the fix will be included in the overhaul)

Test:
> create a resource
# pcs resource create stateful stateful --no-default-ops
Assumed agent name 'ocf:pacemaker:Stateful' (deduced from 'stateful')

> cloning without 'meta' prints a warning, attributes go to the clone
# pcs resource clone stateful globally-unique=True
Deprecation Warning: configuring meta attributes without specifying the 'meta' keyword is deprecated and will be removed in a future release
# pcs resource config stateful-clone
Clone: stateful-clone
  Meta Attributes: stateful-clone-meta_attributes
    globally-unique=True
  Resource: stateful (class=ocf provider=pacemaker type=Stateful)
    Operations:
      monitor: stateful-monitor-interval-10s
        interval=10s timeout=20s role=Promoted
      monitor: stateful-monitor-interval-11s
        interval=11s timeout=20s role=Unpromoted
# pcs resource unclone stateful

> cloning with 'meta' prints no warnings, attributes go to the clone
# pcs resource clone stateful meta globally-unique=True
# pcs resource config stateful-clone
Clone: stateful-clone
  Meta Attributes: stateful-clone-meta_attributes
    globally-unique=True
  Resource: stateful (class=ocf provider=pacemaker type=Stateful)
    Operations:
      monitor: stateful-monitor-interval-10s
        interval=10s timeout=20s role=Promoted
      monitor: stateful-monitor-interval-11s
        interval=11s timeout=20s role=Unpromoted
# pcs resource unclone stateful

> cloning without 'meta' prints a warning, attributes go to the clone
# pcs resource promotable stateful globally-unique=True
Deprecation Warning: configuring meta attributes without specifying the 'meta' keyword is deprecated and will be removed in a future release
# pcs resource config stateful-clone
Clone: stateful-clone
  Meta Attributes: stateful-clone-meta_attributes
    globally-unique=True
    promotable=true
  Resource: stateful (class=ocf provider=pacemaker type=Stateful)
    Operations:
      monitor: stateful-monitor-interval-10s
        interval=10s timeout=20s role=Promoted
      monitor: stateful-monitor-interval-11s
        interval=11s timeout=20s role=Unpromoted
# pcs resource unclone stateful

> cloning with 'meta' prints no warnings, attributes go to the clone
# pcs resource promotable stateful meta globally-unique=True
# pcs resource config stateful-clone
Clone: stateful-clone
  Meta Attributes: stateful-clone-meta_attributes
    globally-unique=True
    promotable=true
  Resource: stateful (class=ocf provider=pacemaker type=Stateful)
    Operations:
      monitor: stateful-monitor-interval-10s
        interval=10s timeout=20s role=Promoted
      monitor: stateful-monitor-interval-11s

> creating a clone with meta attributes prints a warning
# pcs resource create --no-default-ops stateful stateful meta meta=primitive clone meta=clone
Deprecation Warning: Configuring clone meta attributes without specifying the 'meta' keyword after the 'clone' keyword is deprecated and will be removed in a future release. Specify --future to switch to the future behavior.
Assumed agent name 'ocf:pacemaker:Stateful' (deduced from 'stateful')
# pcs resource config stateful-clone
Clone: stateful-clone
  Meta Attributes: stateful-clone-meta_attributes
    meta=clone
  Resource: stateful (class=ocf provider=pacemaker type=Stateful)
    Meta Attributes: stateful-meta_attributes
      meta=primitive
    Operations:
      monitor: stateful-monitor-interval-10s
        interval=10s timeout=20s role=Promoted
      monitor: stateful-monitor-interval-11s
        interval=11s timeout=20s role=Unpromoted

> future parser requires 'meta' to be specified
# pcs resource create --no-default-ops stateful stateful meta meta=primitive clone meta=clone --future
Error: Specifying instance attributes for a clone is not supported. Use 'meta' after 'clone' if you want to specify meta attributes.
# pcs resource create --no-default-ops stateful stateful meta meta=primitive clone meta meta=clone --future
Assumed agent name 'ocf:pacemaker:Stateful' (deduced from 'stateful')
# pcs resource config stateful-clone
Clone: stateful-clone
  Meta Attributes: stateful-clone-meta_attributes
    meta=clone
  Resource: stateful (class=ocf provider=pacemaker type=Stateful)
    Meta Attributes: stateful-meta_attributes
      meta=primitive
    Operations:
      monitor: stateful-monitor-interval-10s
        interval=10s timeout=20s role=Promoted
      monitor: stateful-monitor-interval-11s
        interval=11s timeout=20s role=Unpromoted

> creating a promotable with meta attributes prints a warning
# pcs resource create --no-default-ops stateful stateful meta meta=primitive promotable meta=clone
Deprecation Warning: Configuring promotable meta attributes without specifying the 'meta' keyword after the 'promotable' keyword is deprecated and will be removed in a future release. Specify --future to switch to the future behavior.
Assumed agent name 'ocf:pacemaker:Stateful' (deduced from 'stateful')
# pcs resource config stateful-clone
Clone: stateful-clone
  Meta Attributes: stateful-clone-meta_attributes
    meta=clone
    promotable=true
  Resource: stateful (class=ocf provider=pacemaker type=Stateful)
    Meta Attributes: stateful-meta_attributes
      meta=primitive
    Operations:
      monitor: stateful-monitor-interval-10s
        interval=10s timeout=20s role=Promoted
      monitor: stateful-monitor-interval-11s
        interval=11s timeout=20s role=Unpromoted

> future parser requires 'meta' to be specified
# pcs resource create --no-default-ops stateful stateful meta meta=primitive promotable meta=clone --future
Error: Specifying instance attributes for a promotable is not supported. Use 'meta' after 'promotable' if you want to specify meta attributes.
# pcs resource create --no-default-ops stateful stateful meta meta=primitive promotable meta meta=clone --future
Assumed agent name 'ocf:pacemaker:Stateful' (deduced from 'stateful')
# pcs resource config stateful-clone
Clone: stateful-clone
  Meta Attributes: stateful-clone-meta_attributes
    meta=clone
    promotable=true
  Resource: stateful (class=ocf provider=pacemaker type=Stateful)
    Meta Attributes: stateful-meta_attributes
      meta=primitive
    Operations:
      monitor: stateful-monitor-interval-10s
        interval=10s timeout=20s role=Promoted
      monitor: stateful-monitor-interval-11s
        interval=11s timeout=20s role=Unpromoted
        interval=11s timeout=20s role=Unpromoted

Comment 9 Michal Pospisil 2023-06-20 16:06:26 UTC
DevTestResults:

[root@r09-03-a ~]# rpm -q pcs
pcs-0.11.6-1.el9.x86_64

[root@r09-03-a ~]# pcs resource create --no-default-ops stateful stateful meta meta=primitive clone meta=clone --future
Error: Specifying instance attributes for a clone is not supported. Use 'meta' after 'clone' if you want to specify meta attributes.

[root@r09-03-a ~]# pcs resource create --no-default-ops stateful stateful meta meta=primitive clone meta meta=clone --future
Assumed agent name 'ocf:pacemaker:Stateful' (deduced from 'stateful')

[root@r09-03-a ~]# pcs resource config stateful-clone
Clone: stateful-clone
 Meta Attributes: stateful-clone-meta_attributes
   meta=clone
 Resource: stateful (class=ocf provider=pacemaker type=Stateful)
   Meta Attributes: stateful-meta_attributes
     meta=primitive
   Operations:
     monitor: stateful-monitor-interval-10s
       interval=10s timeout=20s role=Promoted
     monitor: stateful-monitor-interval-11s
       interval=11s timeout=20s role=Unpromoted

Comment 22 errata-xmlrpc 2023-11-07 08:23:10 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-2023:6316


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