Bug 1384485

Summary: pcs should validate resource/stonith agents metadata upon reading
Product: Red Hat Enterprise Linux 8 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Ondrej Mular <omular>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.0CC: cluster-maint, idevat, lmiccini, mlisik, nhostako, omular, tojeline
Target Milestone: pre-dev-freezeKeywords: Reopened, Triaged
Target Release: 8.6Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.12-2.el8 Doc Type: Enhancement
Doc Text:
Feature: Pcs now validates resource and stonith agent metadata XML against OCF schemas. Reason: Provide better error messages when metadata do not match the schema. Result: If metadata provided by an agent do not match OCF schema, pcs provides a descriptive error message pointing to a line not complying with the schema.
Story Points: ---
Clone Of:
: 2019836 (view as bug list) Environment:
Last Closed: 2022-05-10 14:50:42 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:
Bug Depends On: 2019836    
Bug Blocks: 1936833, 2018969    

Description Tomas Jelinek 2016-10-13 11:41:39 UTC
Pcs should validate resource, fence and fake pacemaker (stonithd, cib, crmd, pengine) agents' metadata upon reading. This is currently not possible as the metadata do not conform to the schema - see bz1384484.

Comment 4 RHEL Program Management 2020-11-01 03:03:07 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 5 Tomas Jelinek 2021-10-07 14:31:23 UTC
We will use a custom RNG shipped with pcs to validate OCF 1.0 agents to work around bz1384484.

Comment 9 Miroslav Lisik 2021-11-23 08:21:21 UTC
DevTestResults:

[root@r8-node-01 ~]# rpm -q pcs
pcs-0.10.11-2.el8.x86_64

Edit metadata for Dummy resource agent
'/usr/lib/ocf/resource.d/pacemaker/Dummy' in way which is not compliant with
'/usr/lib64/pcs/data/ocf-1.0.rng' or '/usr/lib64/pcs/data/ocf-1.1.rng'

Changed value of reloadable atrribute of parameter named 'passwd' from
reloadable="1" to reloadable="true".

[root@r8-node-01 ~]# crm_resource --show-metadata=ocf:pacemaker:Dummy | xmllint --xpath "//parameter[@name='passwd']/@reloadable" -
 reloadable="true"

Try to create a Dummy resource:

[root@r8-node-01 ~]# pcs resource create d-01 ocf:pacemaker:Dummy
Error: Agent 'ocf:pacemaker:Dummy' is not installed or does not provide valid metadata: Invalid attribute reloadable for element parameter, line 23, use --force to override
Error: Errors have occurred, therefore pcs is unable to continue
[root@r8-node-01 ~]# echo $?
1

Comment 14 Ondrej Mular 2021-12-07 13:37:25 UTC
Additional patch fixing traceback:
https://github.com/ClusterLabs/pcs/commit/674785c3ca15e7fec40d358cbf8ab4c32156d9af

Comment 16 Miroslav Lisik 2021-12-16 16:20:04 UTC
DevTestResults:

[root@r8-node-01 ~]# rpm -q pcs
pcs-0.10.12-2.el8.x86_64

[root@r8-node-01 ~]# pcs resource create not_installed ocf:pacemaker:not_installed --disabled --force
Warning: Agent 'ocf:pacemaker:not_installed' is not installed or does not provide valid metadata: crm_resource: Metadata query for ocf:pacemaker:not_installed failed: No such device or address, Error performing operation: No such object
[root@r8-node-01 ~]# pcs resource config
 Resource: not_installed (class=ocf provider=pacemaker type=not_installed)
  Meta Attrs: target-role=Stopped
  Operations: monitor interval=60s (not_installed-monitor-interval-60s)


[root@r8-node-01 ~]# pcs resource update not_installed a=b --force
Warning: Agent 'ocf:pacemaker:not_installed' is not installed or does not provide valid metadata: crm_resource: Metadata query for ocf:pacemaker:not_installed failed: No such device or address, Error performing operation: No such object
[root@r8-node-01 ~]# pcs resource config
 Resource: not_installed (class=ocf provider=pacemaker type=not_installed)
  Attributes: a=b
  Meta Attrs: target-role=Stopped
  Operations: monitor interval=60s (not_installed-monitor-interval-60s)

Resource is updated.

Comment 20 errata-xmlrpc 2022-05-10 14:50:42 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/RHEA-2022:1978