Bug 2032959

Summary: RFE : set galera max files by THT
Product: Red Hat OpenStack Reporter: Jeremy <jmelvin>
Component: openstack-tripleoAssignee: Damien Ciabrini <dciabrin>
Status: ON_DEV --- QA Contact: Joe H. Rahme <jhakimra>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.1 (Train)CC: aromito, dciabrin, lmiccini, mburns
Target Milestone: z2Keywords: FutureFeature, Triaged
Target Release: ---Flags: ifrangs: needinfo? (dciabrin)
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Jeremy 2021-12-15 14:46:26 UTC
Description of problem: Currently we can only set galera max connections via heat templates [1]. So we have to manual set file limits by adding --pids-limits $ to pacemaker cib after the fact. This requires manual steps [2] . We would like to be able to set the file limit by template to be easier and safer. 

[1]
[root@controller-0 heat-admin]# grep -r mysql_max /etc/puppet/hieradata/
/etc/puppet/hieradata/service_configs.json:    "mysql_max_connections": 4096,


[root@undercloud-0 stack]# grep -R MysqlMaxConnections /usr/share/openstack-tripleo-heat-templates/
/usr/share/openstack-tripleo-heat-templates/deployment/database/mysql-base.yaml:  MysqlMaxConnections:
/usr/share/openstack-tripleo-heat-templates/deployment/database/mysql-base.yaml:            mysql_max_connections: {get_param: MysqlMaxConnections}


[2]
Commands to be run:
# Do this on any cluster node
# Unmanaged the resource
pcs resource unmanage galera-bundle

# Dump the original CIB
pcs cluster cib > cib-galera.xml
cp cib-galera.xml cib-galera.xml.org
# Edit cib-galera.xml and update on the resource so that the galera-bundle line looks like the following (choose the limit you want):
# 
# -        <podman image="cluster.common.tag/rhosp16-openstack-mariadb:pcmklatest" network="host" options="--user=root --log-driver=k8s-file --log-opt path=/var/log/containers/stdouts/galera-bundle.log -e KOLLA_CONFIG_STRATEGY=COPY_ALWAYS" promoted-max="3" replicas="3" run-command="/bin/bash /usr/local/bin/kolla_start"/>
# +        <podman image="cluster.common.tag/rhosp16-openstack-mariadb:pcmklatest" network="host" options="--user=root --pids-limit 6666 --log-driver=k8s-file --log-opt path=/var/log/containers/stdouts/galera-bundle.log -e KOLLA_CONFIG_STRATEGY=COPY_ALWAYS" promoted-max="3" replicas="3" run-command="/bin/bash /usr/local/bin/kolla_start"/>

# Push the updated CIB. At this stage, no galera resource will restart
pcs cluster cib-push --config cib-galera.xml

# Force pacemaker to reprobe the state of the galera resource (that way it forgets that it has to restart it once it becomes managed again)
pcs resource refresh galera-bundle

# Give back control of the resource to pacemaker
pcs resource manage galera-bundle

# restart each resource individually for a rolling restart and the new value to take effect






Version-Release number of selected component (if applicable):
16.1
How reproducible:
100%
Steps to Reproduce:
1.above in [2]
2.
3.

Actual results:
manual edits required

Expected results:
THT to set value

Additional info: