Bug 1796827

Summary: pcs fails to show specific properties which are not explicitly configured
Product: Red Hat Enterprise Linux 9 Reporter: Patrik Hagara <phagara>
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: 9.0CC: cfeist, cluster-maint, idevat, mlisik, mmazoure, mpospisi, omular, slevine, svalasti, tojeline
Target Milestone: rcKeywords: Reopened, Triaged
Target Release: 9.2Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.11.3-5.el9 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:
: 2112267 (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 Patrik Hagara 2020-01-31 11:06:23 UTC
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

Additional info:

Comment 1 Tomas Jelinek 2020-01-31 12:18:41 UTC
*** Bug 1796829 has been marked as a duplicate of this bug. ***

Comment 6 RHEL Program Management 2021-07-31 07:27:16 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 9 Tomas Jelinek 2022-10-12 11:48:47 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/a8f3b2e98c600f9c6511b54d88db4e963b809562

Reproducer and test in comment 0


Test:
# pcs/pcs property config
Cluster Properties:
 cluster-infrastructure: corosync
 cluster-name: rh90
 dc-version: 2.1.4-5.el9-dc6eb4362e
 have-watchdog: false
 last-lrm-refresh: 1653311967
# pcs/pcs property config stonith-action
Cluster Properties:
 stonith-action: reboot

Comment 10 Miroslav Lisik 2022-10-26 13:11:48 UTC
DevTestResults:

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

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

Comment 14 svalasti 2022-12-08 13:59:10 UTC
### BEFORE

[root@virt-541 ~]# rpm -q pcs
pcs-0.11.3-4.el9.x86_64

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

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

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

### AFTER

[root@virt-132 ~]# rpm -q pcs
pcs-0.11.4-1.el9.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-132 ~]# pcs property
Cluster Properties:
 cluster-infrastructure: corosync
 cluster-name: STSRHTS49
 dc-version: 2.1.5-2.el9-631339ca5aa
 have-watchdog: false
 no-quorum-policy: freeze

[root@virt-132 ~]# 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-132 ~]# pcs property config enable-acl
Cluster Properties:
 enable-acl: false

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

[root@virt-132 ~]# echo $?
0
[root@virt-132 ~]# 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-132 ~]# pcs property config symmetric-cluster
Cluster Properties:
 symmetric-cluster: true

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

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

[root@virt-132 ~]# 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-132 ~]# python 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-acl
Cluster Properties:
 enable-acl: false

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 symmetric-cluster
Cluster Properties:
 symmetric-cluster: true

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

> OK.

## E.) Edge cases

[root@virt-132 ~]# pcs property config invalid-property
Cluster Properties:

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

[root@virt-132 ~]# pcs cluster stop --all
virt-134: Stopping Cluster (pacemaker)...
virt-133: Stopping Cluster (pacemaker)...
virt-132: Stopping Cluster (pacemaker)...
virt-132: Stopping Cluster (corosync)...
virt-133: Stopping Cluster (corosync)...
virt-134: Stopping Cluster (corosync)...

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

[root@virt-132 ~]# pcs property config symmetric-cluster
Error: unable to get crm_config
Could not connect to the CIB: Transport endpoint is not connected
Init failed, could not perform requested operations

> OK.


Marking as VERIFIED for pcs-0.11.4-1.el9.x86_64

Comment 17 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