Bug 2168155
Summary: | Creating meta attributes for resource clones should be more intuitive and consistent | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Nina Hostakova <nhostako> | |
Component: | pcs | Assignee: | Tomas Jelinek <tojeline> | |
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | |
Severity: | low | Docs Contact: | Steven J. Levine <slevine> | |
Priority: | low | |||
Version: | 9.2 | CC: | cluster-maint, idevat, mlisik, mmazoure, mpospisi, omular, tojeline | |
Target Milestone: | rc | Keywords: | Triaged | |
Target Release: | 9.3 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
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`
|
Story Points: | --- | |
Clone Of: | ||||
: | 2168159 (view as bug list) | Environment: | ||
Last Closed: | 2023-11-07 08:23:10 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: |
Description
Nina Hostakova
2023-02-08 10:31:54 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]]`. 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 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 |