Bug 2166289

Summary: [RFE] Provide means to export configured cluster properties as pcs commands
Product: Red Hat Enterprise Linux 8 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Miroslav Lisik <mlisik>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact: Steven J. Levine <slevine>
Priority: medium    
Version: 8.9CC: cluster-maint, idevat, mlisik, mmazoure, mpospisi, nhostako, omular, rmeggins, slevine, tojeline
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: 8.9Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.17-1.el8 Doc Type: Enhancement
Doc Text:
.Enhancements to the `pcs property` command The `pcs property` command now supports the following enhancements: * The `pcs property config --output-format=` option ** Specify `--output-format=cmd` to display the `pcs property set` command created from the current cluster properties configuration. You can use this command to re-create configured cluster properties on a different system. ** Specify `--output-format=json` to display the configured cluster properties in JSON format. ** Specify `output-format=text` to display the configured cluster properties in plain text format, which is the default value for this option. * The `pcs property defaults` command, which replaces the deprecated `pcs property --defaults` option * The `pcs property describe` command, which describes the meaning of cluster properties.
Story Points: ---
Clone Of: 2163914 Environment:
Last Closed: 2023-11-14 15:22:35 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: 2163914    
Bug Blocks:    

Description Tomas Jelinek 2023-02-01 12:43:21 UTC
+++ This bug was initially created as a clone of Bug #2163914 +++

This is a part of a long term goal to export the whole cluster configuration in form of pcs commands which, when run, recreate the same configuration.

This particular BZ is focused on cluster properties configuration.

Comment 1 Tomas Jelinek 2023-05-19 15:41:13 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/d5642c2ede0d6555603bc385dc35e581d2f0fddd

Updated commands:
* pcs property [config]

Added commands:
* pcs property defaults
* pcs property describe

Environment: A running cluster with some configured properties.

Test:

# pcs property set placement-strategy=minimal
# pcs property config --output-format=cmd
pcs property set --force -- \
  placement-strategy=minimal
# pcs property defaults placement-strategy
placement-strategy=default
# pcs property describe placement-strategy
placement-strategy
  Description: How the cluster should allocate resources to nodes
  Allowed values: 'balanced', 'default', 'minimal', 'utilization'
  Default: default

Comment 3 Michal Pospisil 2023-05-29 10:09:53 UTC
DevTestResults:

[root@r08-09-a ~]# rpm -q pcs
pcs-0.10.16-1.el8.x86_64

[root@r08-09-a ~]# pcs property set placement-strategy=minimal

[root@r08-09-a ~]# pcs property config --output-format=cmd
pcs property set --force -- \
  placement-strategy=minimal

Comment 7 Michal Mazourek 2023-06-13 09:32:00 UTC
As discussed, 'pcs property config' text output should not change in late RHEL8 release.

Comment 9 Miroslav Lisik 2023-06-19 12:17:51 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/88f57a99be1abba795c0b95f88f2f9930d26ec15

Updated commands:
* pcs property [config]
* pcs config

Environment: A running cluster with some configured properties.

Test:
# pcs property
Cluster Properties:
 cluster-infrastructure: corosync
 cluster-name: HACluster
 dc-version: 2.1.6-1.el8-6fdc9deea29
 have-watchdog: false

# pcs config | sed "/Cluster Properties:/,/^$/p" -n
Cluster Properties:
 cluster-infrastructure: corosync
 cluster-name: HACluster
 dc-version: 2.1.6-1.el8-6fdc9deea29
 have-watchdog: false

Comment 10 Michal Pospisil 2023-06-20 09:19:33 UTC
DevTestResults:

[root@r08-09-b ~]# rpm -q pcs
pcs-0.10.17-1.el8.x86_64

[root@r08-09-b ~]# pcs property config --output-format=cmd
pcs property set --force -- \
 maintenance-mode=false \
 placement-strategy=minimal

[root@r08-09-b ~]# pcs property config
Cluster Properties:
cluster-infrastructure: corosync
cluster-name: pre1
dc-version: 2.1.6-1.el8-6fdc9deea29
have-watchdog: false
maintenance-mode: false
placement-strategy: minimal

Comment 17 errata-xmlrpc 2023-11-14 15:22:35 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:6903