Bug 1493416

Summary: Allow only OCF resources to be promotable or globally-unique clones
Product: Red Hat Enterprise Linux 9 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Ondrej Mular <omular>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: cluster-maint, idevat, mlisik, mmazoure, mpospisi, nhostako, omular, tojeline
Target Milestone: rcKeywords: Reopened, Triaged
Target Release: 9.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.11.3-5.el9 Doc Type: Bug Fix
Doc Text:
Cause: User tries to create a globally-unique or promotable clone from resource which is using non-ocf resource agent Consequence: This crated an invalid configuration for pacemaker and the resource will also disappear from output of `pcs status` command. Fix: Restrict creating globally-unique and promotable clones to resources using ocf resource agents. Result: User is now unable to create globally-unique and promotable clones from resources using an unsupported agents.
Story Points: ---
Clone Of:
: 2112260 (view as bug list) Environment:
Last Closed: 2023-05-09 07:18:23 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 Tomas Jelinek 2017-09-20 07:18:45 UTC
Description of problem:
In order to use a resource as a master/slave, the resource must support promote and demote actions. Similarly there are requirements a resource agent must fulfill in order to be used as a globally-unique clone. Both of these are described in Pacemaker Explained.

Since only OCF agents may support these additional requirements, pcs should check the resource type prior making it a master/slave or a globally-unique clone and exit with an error if the resource is not of OCF standard.


Version-Release number of selected component (if applicable):
pcs-0.9.158-6.el7.x86_64


How reproducible:
always, easily


Steps to Reproduce:
# pcs resource create test systemd:postfix
# pcs resource master test
# pcs cluster verify -V
   error: native_unpack:        Resource test:0 is of type systemd and therefore cannot be used as a master/slave resource
   error: create_child_clone:   Failed unpacking resource test
   error: unpack_resources:     Failed unpacking master test-master
Errors found during check: config not valid 


Actual results:
A master/slave resource is created. The resource is not shown in the "pcs status" output (which is correct as pacemaker cannot unpack it - see bz1447951).


Expected results:
Pcs does not allow to make a non-ocf resource a master/slave resource. The same goes for globally-unique clones. We do not necessarily need to check if an OCF resource actually supports being a master/slave or a globally-unique clone - if it does not, an error will be displayed in the "pcs status" output.


Additional info:
Commands to fix:
* pcs resource create - check both the master keyword and the globally-unique meta attribute
* pcs resource master
* pcs resource clone - check the globally-unique meta attribute
* pcs resource update - check the globally-unique meta attribute
* pcs resource meta - check the globally-unique meta attribute

Comment 1 Tomas Jelinek 2017-09-20 07:19:20 UTC
This has been reported upstream:
http://lists.clusterlabs.org/pipermail/users/2017-September/006494.html

Comment 3 RHEL Program Management 2021-01-15 07:42:23 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 8 RHEL Program Management 2022-08-24 07:27:46 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 11 Ondrej Mular 2022-10-24 13:07:19 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/3ca619c5864d290a853979f57fc8227e8e6cbf03

Test:
[root@rhel92-devel1 pcs]# pcs resource create test_resource systemd:chronyd promotable
Error: Clone option 'promotable' is not compatible with 'systemd:chronyd' resource agent
Error: Errors have occurred, therefore pcs is unable to continue
[root@rhel92-devel1 pcs]# echo $?
1

Comment 12 Miroslav Lisik 2022-10-26 13:12:18 UTC
DevTestResults:

[root@r92-1 ~]# rpm -q pcs
pcs-0.11.3-5.el9.x86_64

[root@r92-1 ~]# pcs resource create test_resource systemd:chronyd promotable
Error: Clone option 'promotable' is not compatible with 'systemd:chronyd' resource agent
Error: Errors have occurred, therefore pcs is unable to continue
[root@r92-1 ~]# echo $?
1

Comment 18 errata-xmlrpc 2023-05-09 07:18:23 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 (pcs 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/RHBA-2023:2151