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.
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]]`.
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.
Upstream patch from community: https://github.com/ClusterLabs/pcs/commit/b93369e80d33d3fc6639ca1a15f2b6d0f50eb972 test: https://github.com/ClusterLabs/pcs/commit/b93369e80d33d3fc6639ca1a15f2b6d0f50eb972#diff-360ab21549ac8280609c18d5ddf4adea67da03cf8016bb4a23260e889ed336c5L525
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
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
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
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