Bug 1841019

Summary: [TechPreview Exit][RFE] Add a 'local' cluster setup command
Product: Red Hat Enterprise Linux 8 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: michal novacek <mnovacek>
Severity: unspecified Docs Contact: Steven J. Levine <slevine>
Priority: high    
Version: 8.3CC: cfeist, cluster-maint, cluster-qe, idevat, mlisik, mnovacek, mpospisi, nhostako, omular, slevine, tojeline
Target Milestone: rcKeywords: FutureFeature, TechPreview, Triaged
Target Release: 8.5Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.8-2.el8 Doc Type: Technology Preview
Doc Text:
TechPreview Exit for bz1839637
Story Points: ---
Clone Of: 1839637 Environment:
Last Closed: 2021-11-09 17:33:12 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:    
Bug Blocks: 1893743    
Attachments:
Description Flags
proposed fix - doc update none

Description Tomas Jelinek 2020-05-28 07:20:39 UTC
+++ This bug was initially created as a clone of Bug #1839637 +++

The current 'pcs cluster setup' command does all that is needed to set up a cluster: checking if nodes are suitable for the new cluster, creating corosync.conf and other cluster config files (authkeys, pcs configs, etc.) and distributing them to all the nodes. This is great for the cases when a user is creating the cluster manually. It is not so good when one wants to write a script to set up and configure a cluster.

To make it easier to set up a cluster from a script, a new command will be implemented in pcs. This command will have pretty much the same syntax as the current 'pcs cluster setup'. It will, however, work only on the local node, validating corosync.conf options and storing resulting corosync.conf in a specified location. It will be up to the script to distribute this file, along with other needed config files created by such script, to actually create a cluster. The local setup pcs command will not communicate with any nodes.

--- Additional comment from Tomas Jelinek on 2020-05-25 09:17:27 CEST ---

The 'pcs cluster setup' command has a new option, --corosync_conf, which switches the command to 'local' mode. This is described in pcs man page and help:

Local only mode:
By default, pcs connects to all specified nodes to verify they can be used in the new cluster and to send cluster configuration files to them. If this is not what you want, specify --corosync_conf option followed by a file path. Pcs will save corosync.conf to the specified file and will not connect to cluster nodes. These are the task pcs skips in that case:
* make sure the nodes are not running or configured to run a cluster already
* make sure cluster packages are installed on all nodes and their versions are compatible
* make sure there are no cluster configuration files on any node (run 'pcs cluster destroy' and remove pcs_settings.conf file on all nodes)
* synchronize corosync and pacemaker authkeys, /etc/corosync/authkey and /etc/pacemaker/authkey respectively, and the corosync.conf file
* authenticate the cluster nodes against each other ('pcs cluster auth' or 'pcs host auth' command)
* synchronize pcsd certificates (so that pcs web UI can be used in an HA mode)

--- Additional comment from Tomas Jelinek on 2020-05-25 09:22:03 CEST ---

This feature has been also requested upstream:
https://lists.clusterlabs.org/pipermail/users/2020-April/027128.html

Comment 5 michal novacek 2021-01-15 09:48:01 UTC
qa_ack+: this would be tested by using ansible rhel-system-role.ha-cluster from blocked bz

Comment 11 Tomas Jelinek 2021-05-14 10:56:42 UTC
Created attachment 1783157 [details]
proposed fix - doc update

Comment 14 Miroslav Lisik 2021-06-14 13:59:11 UTC
Test:

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

[root@r8-node-01 pcs]# pcs cluster setup LocalCluster r8-node-0{1,2} --corosync_conf  local_corosync.conf
No addresses specified for host 'r8-node-01', using 'r8-node-01'
No addresses specified for host 'r8-node-02', using 'r8-node-02'
[root@r8-node-01 pcs]# cat local_corosync.conf 
totem {
    version: 2
    cluster_name: LocalCluster
    transport: knet
    crypto_cipher: aes256
    crypto_hash: sha256
}

nodelist {
    node {
        ring0_addr: r8-node-01
        name: r8-node-01
        nodeid: 1
    }

    node {
        ring0_addr: r8-node-02
        name: r8-node-02
        nodeid: 2
    }
}

quorum {
    provider: corosync_votequorum
    two_node: 1
}

logging {
    to_logfile: yes
    logfile: /var/log/cluster/corosync.log
    to_syslog: yes
    timestamp: on
}

Comment 19 michal novacek 2021-08-02 12:32:48 UTC
Verified that rhel-system-roles-1.5.1-1.el8.noarch works correctly together with pcs-0.10.8-4.el8.x86_64.

Comment 24 errata-xmlrpc 2021-11-09 17:33:12 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 (Low: pcs security, 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/RHSA-2021:4142