Bug 2159455

Summary: Do not call agents 'validate-all' action in 'pcs (resource|stonith) (create|update)' commands by default
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: urgent Docs Contact:
Priority: urgent    
Version: 8.8CC: cluster-maint, cluster-qe, idevat, mlisik, mmazoure, mpospisi, nhostako, omular, sbradley, tojeline
Target Milestone: rcKeywords: Triaged
Target Release: 8.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.15-3.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 2159454 Environment:
Last Closed: 2023-05-16 08:12:43 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: 1816852, 2159454    
Bug Blocks:    

Description Tomas Jelinek 2023-01-09 16:18:35 UTC
+++ This bug was initially created as a clone of Bug #2159454 +++

Description of problem:
In bz1816852, calling agents 'validate-all' action from pcs was implemented. The action is called by default when creating or updating a resource. Majority of resource and stonith agents are not ready for their validate-all action to be run in this context, however. Agents provide confusing messages or report errors when they shouldn't.
In order to give agent developers time to fix these issues, pcs will call validate-all action only when requested by users and not by default.


Version-Release number of selected component (if applicable):
pcs-0.10.14-6.el8


How reproducible:
always, easily


Steps to Reproduce:
Run 'pcs (resource|stonith) (create|update)' with --debug and observe pcs calling 'crm_resource --validate'


Actual results:
pcs calls 'crm_resource --validate'


Expected results:
pcs doesn't call 'crm_resource --validate' unless explicitly requested

Comment 2 Ondrej Mular 2023-01-13 07:54:16 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/4e22f7b1070c37ab25c8da015c00926023bde52e

Test:
[root@rhel88-node1 pcs]# pcs resource create test_resource apache --agent-validation
Assumed agent name 'ocf:heartbeat:apache' (deduced from 'apache')
Error: Validation result from agent (use --force to override):
  ocf-exit-reason:apache httpd program not found
  ocf-exit-reason:environment is invalid, resource considered stopped
Error: Errors have occurred, therefore pcs is unable to continue
[root@rhel88-node1 pcs]# echo $?
1
[root@rhel88-node1 pcs]# pcs resource create test_resource apache
Assumed agent name 'ocf:heartbeat:apache' (deduced from 'apache')
[root@rhel88-node1 pcs]# echo $?
0

Comment 3 Michal Pospisil 2023-01-16 15:50:25 UTC
DevTestResults:

[root@r08-08-a pcs]# pcs resource create test_resource apache --agent-validation
Assumed agent name 'ocf:heartbeat:apache' (deduced from 'apache')
Error: Validation result from agent (use --force to override):
 ocf-exit-reason:apache httpd program not found
 ocf-exit-reason:environment is invalid, resource considered stopped
Error: Errors have occurred, therefore pcs is unable to continue
 
[root@r08-08-a pcs]# echo $?
1

[root@r08-08-a pcs]# pcs resource create test_resource apache
Assumed agent name 'ocf:heartbeat:apache' (deduced from 'apache')

[root@r08-08-a pcs]# echo $?
0

Comment 7 Michal Mazourek 2023-01-30 14:17:53 UTC
The same test as in bz2159454 comment 8 was used to verify this bz.
Marking as VERIFIED in pcs-0.10.15-3.el8.

Comment 10 errata-xmlrpc 2023-05-16 08:12:43 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:2738