Bug 2018969
Summary: | Support version 1.1 of the OCF Resource Agent API standard | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Tomas Jelinek <tojeline> |
Component: | pcs | Assignee: | Tomas Jelinek <tojeline> |
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> |
Severity: | high | Docs Contact: | Steven J. Levine <slevine> |
Priority: | high | ||
Version: | 9.0 | CC: | cluster-maint, cluster-qe, gfialova, idevat, kgaillot, kmalyjur, lmiksik, mlisik, mmazoure, mpospisi, nhostako, omular, pgm-rhel-tools, slevine, tojeline |
Target Milestone: | rc | Keywords: | FutureFeature, Triaged |
Target Release: | 9.0 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | pcs-0.11.1-5.el9 | Doc Type: | Enhancement |
Doc Text: |
.`pcs` suppport for OCF Resource Agent API 1.1 standard
The `pcs` command-line interface now supports OCF 1.1 resource and STONITH agents. As part of the implementation of this support, any agent's metadata must comply with the OCF schema, whether the agent is an OCF 1.0 or OCF 1.1 agent. If an agent's metadata does not comply with the OCF schema, `pcs` considers the agent invalid and will not create or update a resource of the agent unless the `--force` option is specified. The `pcsd` Web UI and `pcs` commands for listing agents now omit agents with invalid metadata from the listing.
|
Story Points: | --- |
Clone Of: | 1936833 | Environment: | |
Last Closed: | 2022-05-17 12:19:34 UTC | Type: | Feature Request |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1384485, 1936696, 2019836 | ||
Bug Blocks: | 1936833, 2019464 |
Description
Tomas Jelinek
2021-11-01 11:47:37 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/5eb51289926d5e1e68092db5d1d177fddc31a766 Test: 1) OCF 1.0 agents work the same as before 2) To test OCF 1.1 support, a resource agent implementing OCF 1.1 and using its new features is required. One of the features is unique-group of attributes. For example, there can be a group "address" consisting of "ip" and "port" attributes. Pcs then reports an error when the user is trying to create two resources of such an agent with the same combination of "ip" and "port" values. DevTestResults: [root@r90-node-01 ~]# rpm -q pcs pcs-0.11.1-5.el9.x86_64 [root@r90-node-01 ~]# crm_resource --show-metadata=ocf:pacemaker:Dummy | xmllint --xpath /resource-agent/version - <version>1.1</version> [root@r90-node-01 ~]# pcs resource create dummy ocf:pacemaker:Dummy [root@r90-node-01 ~]# pcs resource * dummy (ocf:pacemaker:Dummy): Started r90-node-01 AFTER: ====== [root@virt-540 ~]# rpm -q pcs pcs-0.11.1-9.el9.x86_64 support of new ocf 1.1 features - unique-group ----------------------------------------------- [root@virt-540 ~]# grep -rn /usr/lib/ocf/resource.d -e "unique-group" /usr/lib/ocf/resource.d/pacemaker/HealthIOWait:37:<parameter name="state" unique-group="state"> /usr/lib/ocf/resource.d/pacemaker/Stateful:52:<parameter name="state" unique-group="state"> /usr/lib/ocf/resource.d/pacemaker/attribute:70: <parameter name="state" unique-group="state"> /usr/lib/ocf/resource.d/pacemaker/attribute:78: <parameter name="name" unique-group="name"> /usr/lib/ocf/resource.d/pacemaker/ping:49:<parameter name="pidfile" unique-group="pidfile"> /usr/lib/ocf/resource.d/pacemaker/ping:63:<parameter name="name" unique-group="name"> /usr/lib/ocf/resource.d/pacemaker/remote:31: <parameter name="server" unique-group="address"> /usr/lib/ocf/resource.d/pacemaker/remote:38: <parameter name="port" unique-group="address"> /usr/lib/ocf/resource.d/pacemaker/Dummy:73:<parameter name="state" unique-group="state"> > 'unique-group' replaced 'unique' in ocf 1.1 [root@virt-540 ~]# pcs resource create s1 ocf:pacemaker:Stateful state=/tmp/state1 [root@virt-540 ~]# pcs resource * s1 (ocf:pacemaker:Stateful): Started virt-540 [root@virt-540 ~]# pcs resource create s2 ocf:pacemaker:Stateful state=/tmp/state1 Error: Value '/tmp/state1' of option 'state' is not unique across 'ocf:pacemaker:Stateful' resources. Following resources are configured with the same value of the instance attribute: 's1', use --force to override Error: Errors have occurred, therefore pcs is unable to continue [root@virt-540 ~]# echo $? 1 [root@virt-540 ~]# pcs resource * s1 (ocf:pacemaker:Stateful): Started virt-540 > OK [root@virt-540 ~]# pcs resource create s2 ocf:pacemaker:Stateful state=/tmp/state2 [root@virt-540 ~]# pcs resource * s1 (ocf:pacemaker:Stateful): Started virt-540 * s2 (ocf:pacemaker:Stateful): Started virt-541 > OK: 'unique-group' works the same as 'unique' for a single parameter ## Testing 'unique-group' for multiple parameters ## Adding 'unique-group' with a name of 'group-test' to 'passwd' and 'fake' parameters of ocf:pacemaker:Dummy [root@virt-540 ~]# cat /usr/lib/ocf/resource.d/pacemaker/Dummy | grep group-test <parameter name="passwd" reloadable="1" unique-group="group-test"> <parameter name="fake" reloadable="1" unique-group="group-test"> [root@virt-540 ~]# pcs resource create d1 ocf:pacemaker:Dummy passwd=123 fake=1 [root@virt-540 ~]# pcs resource * s1 (ocf:pacemaker:Stateful): Started virt-540 * s2 (ocf:pacemaker:Stateful): Started virt-541 * d1 (ocf:pacemaker:Dummy): Started virt-540 [root@virt-540 ~]# pcs resource create d2 ocf:pacemaker:Dummy passwd=123 fake=1 Error: Value '1', '123' of options 'fake', 'passwd' (group 'group-test') is not unique across 'ocf:pacemaker:Dummy' resources. Following resources are configured with the same values of the instance attributes: 'd1', use --force to override Error: Errors have occurred, therefore pcs is unable to continue [root@virt-540 ~]# echo $? 1 > OK: 'unique-group' didn't allow to set the same combination of passwd and fake parameters [root@virt-540 ~]# pcs resource create d2 ocf:pacemaker:Dummy passwd=1234 fake=1 [root@virt-540 ~]# pcs resource create d3 ocf:pacemaker:Dummy passwd=123 fake=0 [root@virt-540 ~]# pcs resource * s1 (ocf:pacemaker:Stateful): Started virt-540 * s2 (ocf:pacemaker:Stateful): Started virt-541 * d1 (ocf:pacemaker:Dummy): Started virt-540 * d2 (ocf:pacemaker:Dummy): Started virt-541 * d3 (ocf:pacemaker:Dummy): Started virt-540 > OK: 'unique-group' allowed to create the resource, when one of the parameter is unique and the other stays the same ## Adding 'unique-group' for third parameter [root@virt-540 ~]# cat /usr/lib/ocf/resource.d/pacemaker/Dummy | grep group-test <parameter name="passwd" reloadable="1" unique-group="group-test"> <parameter name="fake" reloadable="1" unique-group="group-test"> <parameter name="op_sleep" reloadable="1" unique-group="group-test"> [root@virt-540 ~]# pcs resource create d4 ocf:pacemaker:Dummy passwd=123 fake=1 op_sleep=1 [root@virt-540 ~]# pcs resource * s1 (ocf:pacemaker:Stateful): Started virt-540 * s2 (ocf:pacemaker:Stateful): Started virt-541 * d1 (ocf:pacemaker:Dummy): Started virt-540 * d2 (ocf:pacemaker:Dummy): Started virt-541 * d3 (ocf:pacemaker:Dummy): Started virt-540 * d4 (ocf:pacemaker:Dummy): Started virt-541 [root@virt-540 ~]# pcs resource create d5 ocf:pacemaker:Dummy passwd=123 fake=1 op_sleep=1 Error: Value '1', '1', '123' of options 'fake', 'op_sleep', 'passwd' (group 'group-test') is not unique across 'ocf:pacemaker:Dummy' resources. Following resources are configured with the same values of the instance attributes: 'd4', use --force to override Error: Errors have occurred, therefore pcs is unable to continue [root@virt-540 ~]# echo $? 1 > OK [root@virt-540 ~]# pcs resource create d5 ocf:pacemaker:Dummy passwd=123 fake=1 op_sleep=2 [root@virt-540 ~]# echo $? 0 [root@virt-540 ~]# pcs resource create d6 ocf:pacemaker:Dummy passwd=123 fake=0 op_sleep=1 [root@virt-540 ~]# echo $? 0 [root@virt-540 ~]# pcs resource create d7 ocf:pacemaker:Dummy passwd=1234 fake=1 op_sleep=1 [root@virt-540 ~]# echo $? 0 [root@virt-540 ~]# pcs resource * s1 (ocf:pacemaker:Stateful): Started virt-540 * s2 (ocf:pacemaker:Stateful): Started virt-541 * d1 (ocf:pacemaker:Dummy): Started virt-540 * d2 (ocf:pacemaker:Dummy): Started virt-541 * d3 (ocf:pacemaker:Dummy): Started virt-540 * d4 (ocf:pacemaker:Dummy): Started virt-541 * d5 (ocf:pacemaker:Dummy): Started virt-540 * d6 (ocf:pacemaker:Dummy): Started virt-541 * d7 (ocf:pacemaker:Dummy): Started virt-540 > OK checking that resources are supporting ocf 1.1 ----------------------------------------------- [root@virt-560 ~]# grep -r "<version>1.1" /usr/lib/ocf/resource.d/ /usr/lib/ocf/resource.d/pacemaker/Dummy:<version>1.1</version> /usr/lib/ocf/resource.d/pacemaker/HealthIOWait:<version>1.1</version> /usr/lib/ocf/resource.d/pacemaker/Stateful:<version>1.1</version> /usr/lib/ocf/resource.d/pacemaker/attribute: <version>1.1</version> /usr/lib/ocf/resource.d/pacemaker/ping:<version>1.1</version> /usr/lib/ocf/resource.d/pacemaker/remote: <version>1.1</version> [root@virt-560 ~]# pcs resource create dummy ocf:pacemaker:Dummy [root@virt-560 ~]# pcs resource create health ocf:pacemaker:HealthIOWait [root@virt-560 ~]# pcs resource create stateful ocf:pacemaker:Stateful [root@virt-560 ~]# pcs resource create attribute ocf:pacemaker:attribute [root@virt-560 ~]# pcs resource create ping ocf:pacemaker:ping host_list=virt-560 [root@virt-560 ~]# pcs resource create renite ocf:pacemaker:remote Error: this command is not sufficient for creating a remote connection, use 'pcs cluster node add-remote', use --force to override Error: Errors have occurred, therefore pcs is unable to continue [root@virt-560 ~]# pcs resource * Clone Set: locking-clone [locking]: * Started: [ virt-560 virt-561 ] * dummy (ocf:pacemaker:Dummy): Started virt-560 * health (ocf:pacemaker:HealthIOWait): Started virt-561 * stateful (ocf:pacemaker:Stateful): Started virt-560 * attribute (ocf:pacemaker:attribute): Started virt-561 * ping (ocf:pacemaker:ping): Started virt-560 (Monitoring) > OK: validating of resources with ocf 1.1 and 1.0 will be done in bz1384485 checking that ocf agents don't fail because of the new standard ---------------------------------------------------------------- # to prevent fencing [root@virt-560 ~]# pcs node maintenance --all [root@virt-560 ~]# set -x; i=0; for s in `pcs resource list ocf --nodesc`; do pcs resource create r$i $s; ((i=i+1)); done {...} > Resources without any required parameter were created, resources with required parameters gave error about the missing parameter, every error message was inspected and no error was related to the new ocf standard and its validation. Other bzs was related to new ocf standard, such as bz1384485 or bz1885293. Also new bz for fixing backward compatibility was created - bz2050274. Together with these bzs, marking as VERIFIED in pcs-0.11.1-9.el9. 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 (new packages: pcs), 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/RHBA-2022:2290 |