Bug 2112267

Summary: pcs fails to show specific properties which are not explicitly configured
Product: Red Hat Enterprise Linux 8 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact: Steven J. Levine <slevine>
Priority: low    
Version: 8.0CC: cfeist, cluster-maint, cluster-qe, idevat, mlisik, mmazoure, mpospisi, omular, phagara, slevine, svalasti, tojeline
Target Milestone: rcKeywords: Triaged
Target Release: 8.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.14-6.el8 Doc Type: Bug Fix
Doc Text:
.`pcs` now displays cluster properties that are not explicitly configured Previously, a `pcs` command to display the value of a specific cluster property did not list values that are not explicitly configured in the CIB. With this fix, if a cluster property is not set `pcs` displays the default value for the property.
Story Points: ---
Clone Of: 1796827 Environment:
Last Closed: 2023-05-16 08:12: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:

Description Tomas Jelinek 2022-07-29 08:13:55 UTC
+++ This bug was initially created as a clone of Bug #1796827 +++

Description of problem:
The `pcs property show <property>` command does not work for querying specific not-explicitly-configured cluster properties.

The only way to do that is with `pcs property --all | grep <property>`, which is not very user-friendly.

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

How reproducible:
always

Steps to Reproduce:
1. `pcs property show stonith-action` or any other property not explicitly configured (ie. not listed with `pcs property`)

Actual results:
> [root@f09-h23-b01-5039ms ~]# pcs property show stonith-action
> Cluster Properties:

Expected results:
> [root@f09-h23-b01-5039ms ~]# pcs property show stonith-action
> Cluster Properties:
>  stonith-action: reboot

or better yet (to facilitate usage in scripts and such):
> [root@f09-h23-b01-5039ms ~]# pcs property show stonith-action
> reboot

Comment 1 Tomas Jelinek 2022-10-12 14:32:51 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/648dfbe49a235c520c3458a74aa2d7fc1b44b57d

Reproducer and test in comment 0


Test:
# pcs/pcs property config
Cluster Properties:
 cluster-infrastructure: corosync
 cluster-name: rh86
 dc-version: 2.1.4-5.el8-dc6eb4362e
 have-watchdog: false
# pcs/pcs property config stonith-action
Cluster Properties:
 stonith-action: reboot

Comment 2 Miroslav Lisik 2022-10-26 07:39:19 UTC
DevTestResults:

[root@r88-1 ~]# rpm -q pcs
pcs-0.10.14-6.el8.x86_64

[root@r88-1 ~]# pcs property config
Cluster Properties:
 cluster-infrastructure: corosync
 cluster-name: HACluster
 dc-version: 2.1.4-5.el8-dc6eb4362e
 have-watchdog: false
[root@r88-1 ~]# pcs property config stonith-action
Cluster Properties:
 stonith-action: reboot

Comment 6 svalasti 2022-12-08 13:54:05 UTC
### BEFORE

[root@virt-517 ~]# rpm -q pcs
pcs-0.10.14-5.el8.x86_64

[root@virt-517 ~]# pcs property
Cluster Properties:
 cluster-infrastructure: corosync
 cluster-name: STSRHTS14457
 dc-version: 2.1.4-5.el8-dc6eb4362e
 have-watchdog: false
 no-quorum-policy: freeze

[root@virt-517 ~]# pcs property config enable-acl
Cluster Properties:

[root@virt-517 ~]# echo $?
0


### AFTER

[root@virt-019 ~]# rpm -q pcs
pcs-0.10.15-1.el8.x86_64

## A.) Check, if a property that is not explicitly configured can be showed by 'pcs property config' (property that is not included in 'pcs property' list).

[root@virt-019 ~]# pcs property
Cluster Properties:
 cluster-infrastructure: corosync
 cluster-name: STSRHTS16088
 dc-version: 2.1.5-2.el8-631339ca5aa
 have-watchdog: false
 no-quorum-policy: freeze

[root@virt-019 ~]# pcs property config enable-acl
Cluster Properties:
 enable-acl: false

> OK.

## B.) Check if 'pcs property config' responds correctly to a property change (without using 'pcs property set')

[root@virt-019 ~]# pcs property config enable-acl
Cluster Properties:
 enable-acl: false

[root@virt-019 ~]# pcs acl enable

[root@virt-019 ~]# echo $?
0

[root@virt-019 ~]# pcs property config enable-acl
Cluster Properties:
 enable-acl: true

> OK.

## C.) Check if 'pcs property config' responds correctly to a property change (using 'pcs property set')

[root@virt-019 ~]# pcs property config symmetric-cluster
Cluster Properties:
 symmetric-cluster: true

[root@virt-019 ~]# pcs property set symmetric-cluster=false

[root@virt-019 ~]# echo $?
0

[root@virt-019 ~]# pcs property config symmetric-cluster
Cluster Properties:
 symmetric-cluster: false

> OK.


## D.) Check if it is actually possible to request all properties that are not explicitly configurable. (tested by script)

[root@virt-019 ~]# python3 test.py
Running CMD: pcs property config batch-limit
Cluster Properties:
 batch-limit: 0

Running CMD: pcs property config cluster-delay
Cluster Properties:
 cluster-delay: 60s

Running CMD: pcs property config cluster-ipc-limit
Cluster Properties:
 cluster-ipc-limit: 500

Running CMD: pcs property config cluster-recheck-interval
Cluster Properties:
 cluster-recheck-interval: 15min

Running CMD: pcs property config concurrent-fencing
Cluster Properties:
 concurrent-fencing: true

Running CMD: pcs property config dc-deadtime
Cluster Properties:
 dc-deadtime: 20s

Running CMD: pcs property config election-timeout
Cluster Properties:
 election-timeout: 2min

Running CMD: pcs property config enable-startup-probes
Cluster Properties:
 enable-startup-probes: true

Running CMD: pcs property config fence-reaction
Cluster Properties:
 fence-reaction: stop

Running CMD: pcs property config join-finalization-timeout
Cluster Properties:
 join-finalization-timeout: 30min

Running CMD: pcs property config join-integration-timeout
Cluster Properties:
 join-integration-timeout: 3min

Running CMD: pcs property config load-threshold
Cluster Properties:
 load-threshold: 80%

Running CMD: pcs property config maintenance-mode
Cluster Properties:
 maintenance-mode: false

Running CMD: pcs property config migration-limit
Cluster Properties:
 migration-limit: -1

Running CMD: pcs property config node-action-limit
Cluster Properties:
 node-action-limit: 0

Running CMD: pcs property config node-health-base
Cluster Properties:
 node-health-base: 0

Running CMD: pcs property config node-health-green
Cluster Properties:
 node-health-green: 0

Running CMD: pcs property config node-health-red
Cluster Properties:
 node-health-red: -INFINITY

Running CMD: pcs property config node-health-strategy
Cluster Properties:
 node-health-strategy: none

Running CMD: pcs property config node-health-yellow
Cluster Properties:
 node-health-yellow: 0

Running CMD: pcs property config pe-error-series-max
Cluster Properties:
 pe-error-series-max: -1

Running CMD: pcs property config pe-input-series-max
Cluster Properties:
 pe-input-series-max: 4000

Running CMD: pcs property config pe-warn-series-max
Cluster Properties:
 pe-warn-series-max: 5000

Running CMD: pcs property config placement-strategy
Cluster Properties:
 placement-strategy: default

Running CMD: pcs property config priority-fencing-delay
Cluster Properties:
 priority-fencing-delay: 0

Running CMD: pcs property config remove-after-stop
Cluster Properties:
 remove-after-stop: false

Running CMD: pcs property config shutdown-escalation
Cluster Properties:
 shutdown-escalation: 20min

Running CMD: pcs property config shutdown-lock
Cluster Properties:
 shutdown-lock: false

Running CMD: pcs property config shutdown-lock-limit
Cluster Properties:
 shutdown-lock-limit: 0

Running CMD: pcs property config start-failure-is-fatal
Cluster Properties:
 start-failure-is-fatal: true

Running CMD: pcs property config startup-fencing
Cluster Properties:
 startup-fencing: true

Running CMD: pcs property config stonith-action
Cluster Properties:
 stonith-action: reboot

Running CMD: pcs property config stonith-enabled
Cluster Properties:
 stonith-enabled: true

Running CMD: pcs property config stonith-max-attempts
Cluster Properties:
 stonith-max-attempts: 10

Running CMD: pcs property config stonith-timeout
Cluster Properties:
 stonith-timeout: 60s

Running CMD: pcs property config stonith-watchdog-timeout
Cluster Properties:
 stonith-watchdog-timeout: 0

Running CMD: pcs property config stop-all-resources
Cluster Properties:
 stop-all-resources: false

Running CMD: pcs property config stop-orphan-actions
Cluster Properties:
 stop-orphan-actions: true

Running CMD: pcs property config stop-orphan-resources
Cluster Properties:
 stop-orphan-resources: true

Running CMD: pcs property config transition-delay
Cluster Properties:
 transition-delay: 0s

> OK.


Marking as VERIFIED for pcs-0.10.15-1.el8.x86_64

Comment 11 errata-xmlrpc 2023-05-16 08:12: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/RHBA-2023:2738