redis is installed by default in the containerized undercloud

Bug #1795027 reported by Michele Baldessari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Michele Baldessari

Bug Description

See for example: http://logs.openstack.org/28/602828/2/check/tripleo-ci-centos-7-undercloud-containers/0079087/logs/undercloud/var/log/host_info.txt.gz

system_u:system_r:spc_t:s0 42460 37667 0.0 0.0 188 0 ? Ss 19:31 0:00 | \_ /usr/local/bin/dumb-init /bin/bash /usr/local/bin/kolla_start PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=undercloud.localdomain KOLLA_CONFIG_STRATEGY=COPY_ALWAYS TRIPLEO_CONFIG_HASH=43a023fc436ece5719402b8144437233 KOLLA_BASE_DISTRO=centos KOLLA_INSTALL_TYPE=binary KOLLA_INSTALL_METATYPE=rdo PS1=$(tput bold)($(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(hostname -s) $(pwd)]$ HOME=/run/redis
system_u:system_r:spc_t:s0 42460 37689 0.1 0.0 39372 1748 ? Ssl 19:31 0:03 | \_ /usr/bin/redis-server 192.168.24.1:6379 9
system_u:system_r:container_runtime_t:s0 root 40571 0.0 0.0 347652 1012 ? Sl 19:32 0:00 \_ /usr/bin/docker-containerd-shim-current 31f70295ff48a761e24f0ead62aab2791f9b2d7d3a09872becca43e42153cd11 /var/run/docker/libcontainerd

On Queens we did not have redis by default on the undercloud. We should prolly do without in master/rocky as well

Revision history for this message
Michele Baldessari (michele) wrote :

Seems this should not be the case: https://github.com/openstack/tripleo-heat-templates/blob/master/environments/undercloud.yaml#L27

...
 OS::TripleO::Services::Redis: OS::Heat::None

Revision history for this message
Alex Schultz (alex-schultz) wrote :

zaqar pulls in redis by default i think

Revision history for this message
Michele Baldessari (michele) wrote :

But it does not use it these days, could that be?
[root@undercloud config-data]# grep -ir redis /var/lib/config-data/puppet-generated/ |grep -v ':#'
/var/lib/config-data/puppet-generated/ironic_api/etc/ironic/ironic.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/nova_placement/etc/nova/nova.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/ironic/etc/ironic/ironic.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/mistral/etc/mistral/mistral.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/mistral/etc/group:redis:x:42460:
/var/lib/config-data/puppet-generated/mistral/etc/group-:redis:x:42460:
/var/lib/config-data/puppet-generated/mistral/etc/gshadow:redis:!::
/var/lib/config-data/puppet-generated/mistral/etc/gshadow-:redis:!::
/var/lib/config-data/puppet-generated/heat_api/etc/heat/heat.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/zaqar/etc/zaqar/zaqar.conf:[drivers:management_store:redis]
/var/lib/config-data/puppet-generated/zaqar/etc/zaqar/zaqar.conf:[drivers:message_store:redis]
/var/lib/config-data/puppet-generated/zaqar/etc/zaqar/zaqar.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/redis/etc/redis.conf:pidfile /var/run/redis/redis.pid
/var/lib/config-data/puppet-generated/redis/etc/redis.conf:unixsocket /var/run/redis/redis.sock
/var/lib/config-data/puppet-generated/redis/etc/redis.conf:logfile /var/log/redis/redis.log
/var/lib/config-data/puppet-generated/redis/etc/redis.conf:dir /var/lib/redis
/var/lib/config-data/puppet-generated/redis/etc/redis.conf.puppet:pidfile /var/run/redis/redis.pid
/var/lib/config-data/puppet-generated/redis/etc/redis.conf.puppet:unixsocket /var/run/redis/redis.sock
/var/lib/config-data/puppet-generated/redis/etc/redis.conf.puppet:logfile /var/log/redis/redis.log
/var/lib/config-data/puppet-generated/redis/etc/redis.conf.puppet:dir /var/lib/redis
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/glance_api/etc/glance/glance-api.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/nova/etc/nova/nova.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/neutron/etc/neutron/neutron.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/heat/etc/heat/heat.conf:[matchmaker_redis]
/var/lib/config-data/puppet-generated/heat_api_cfn/etc/heat/heat.conf:[matchmaker_redis]

Revision history for this message
Michele Baldessari (michele) wrote :

Ok so it took me a bit of digging as to how this all works:
1) openstack undercloud install, these days turns into
2)
sudo openstack tripleo deploy --standalone --standalone-role Undercloud --stack undercloud --local-domain=tripleodomain.example.com --local-ip=192.168.24.1/24 --templates=/usr/share/openstack-tripleo-heat-templates --heat-native -e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/undercloud.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/services/ironic.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/services/ironic-inspector.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/services/mistral.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/services/novajoin.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/services/zaqar.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/services/tripleo-ui.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/public-tls-undercloud.yaml --public-virtual-ip 192.168.24.2 --control-virtual-ip 192.168.24.3 -e /usr/share/openstack-tripleo-heat-templates/environments/ssl/tls-endpoints-public-ip.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/use-dns-for-vips.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/services/undercloud-haproxy.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/services/undercloud-keepalived.yaml --deployment-user stack --output-dir=/home/stack --cleanup -e /home/stack/tripleo-config-generated-env-files/undercloud_parameters.yaml --hieradata-override=/home/stack/./hieradata-overrides-classic-undercloud.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/tripleo-validations.yaml --log-file=install-undercloud.log -e /usr/share/openstack-tripleo-heat-templates/undercloud-stack-vstate-dropin.yaml

3) The include '-e /usr/share/openstack-tripleo-heat-templates/environments/services/zaqar.yaml' comes *after* '-e /usr/share/openstack-tripleo-heat-templates/environments/undercloud.yaml' and so wins

4) /usr/share/openstack-tripleo-heat-templates/environments/services/zaqar.yaml has
resource_registry:
  OS::TripleO::Services::Zaqar: ../../docker/services/zaqar.yaml
  OS::TripleO::Services::Redis : ../../docker/services/database/redis.yaml

And 1-4 explain *why* redis gets pulled in. The thing is that in environments/undercloud.yaml we have:
parameter_defaults:
  ZaqarMessageStore: 'swift'
  ZaqarManagementStore: 'sqlalchemy'

Which trumps the default parameter of docker/services/zaqar.yaml which points to the redis backend.
So we basically pull in redis but do not use it as we use sqlalchemy + swift as backends.

My best guess (barring confirmation that indeed redis is not needed on the undercloud, which I seem to think is the case) is that we should do the following:
1) Add OS::TripleO::Services::Zaqar: ../docker/services/zaqar.yaml to environments/undercloud.yaml
2) Remove -e /usr/share/openstack-tripleo-heat-templates/environments/services/zaqar.yaml from the client undercloud install path

Revision history for this message
Michele Baldessari (michele) wrote :

Meh the plan 1-2) above won't be as simple because we have the following option in the undercloud install:
    if CONF.get('enable_zaqar'): deploy_args += ['-e', os.path.join(
            tht_templates, "environments/services/zaqar.yaml")]

So in order to keep the 'enable_zaqar' feature unchanged we'd have to add something like 'environments/services/zaqar-noredis.yaml' and use that one to avoid redis on the undercloud by default.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.openstack.org/606200

Changed in tripleo:
assignee: nobody → Michele Baldessari (michele)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/606201

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/606200
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=242bef164a16c740b35a8182693c360cabdf678f
Submitter: Zuul
Branch: master

commit 242bef164a16c740b35a8182693c360cabdf678f
Author: Michele Baldessari <email address hidden>
Date: Fri Sep 28 22:47:00 2018 +0200

    Add a zaqar-swift-backend environment file

    The main purpose of this file is to enable the zaqar service
    but, unlike the environments/services/zaqar.yaml file it explicitely
    disables the redis service as this is meant to be used with
    swift/sqlalchemy.

    The main use case here being the containerized undercloud

    Change-Id: Ic11b4790a1a2c2336cd432784f19922e76e028ad
    Partial-Bug: #1795027

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (master)

Reviewed: https://review.openstack.org/606201
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=fa0a7acb639422d7497eff0830252ab3ff82421e
Submitter: Zuul
Branch: master

commit fa0a7acb639422d7497eff0830252ab3ff82421e
Author: Michele Baldessari <email address hidden>
Date: Fri Sep 28 22:51:15 2018 +0200

    Zaqar on the containerized undercloud should not use Redis

    Let's use the newly-introduced zaqar-swift-backend.yaml file in order
    to not pull in redis automatically on the containerized undercloud.

    Change-Id: I23f5bef9585ea6aa54edaa5f278625fa6ba9b0f9
    Depends-On: Ic11b4790a1a2c2336cd432784f19922e76e028ad
    Closes-Bug: #1795027

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/607733

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/607734

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/rocky)

Reviewed: https://review.openstack.org/607733
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=6bf333a930fa28f1afcd45e6b695d307a7dbe6a0
Submitter: Zuul
Branch: stable/rocky

commit 6bf333a930fa28f1afcd45e6b695d307a7dbe6a0
Author: Michele Baldessari <email address hidden>
Date: Fri Sep 28 22:47:00 2018 +0200

    Add a zaqar-swift-backend environment file

    The main purpose of this file is to enable the zaqar service
    but, unlike the environments/services/zaqar.yaml file it explicitely
    disables the redis service as this is meant to be used with
    swift/sqlalchemy.

    The main use case here being the containerized undercloud

    Change-Id: Ic11b4790a1a2c2336cd432784f19922e76e028ad
    Partial-Bug: #1795027
    (cherry picked from commit 242bef164a16c740b35a8182693c360cabdf678f)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (stable/rocky)

Reviewed: https://review.openstack.org/607734
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=9547320303c6ec8791c93b3471a663b28c7f6eb0
Submitter: Zuul
Branch: stable/rocky

commit 9547320303c6ec8791c93b3471a663b28c7f6eb0
Author: Michele Baldessari <email address hidden>
Date: Fri Sep 28 22:51:15 2018 +0200

    Zaqar on the containerized undercloud should not use Redis

    Let's use the newly-introduced zaqar-swift-backend.yaml file in order
    to not pull in redis automatically on the containerized undercloud.

    Change-Id: I23f5bef9585ea6aa54edaa5f278625fa6ba9b0f9
    Depends-On: Ic11b4790a1a2c2336cd432784f19922e76e028ad
    Closes-Bug: #1795027
    (cherry picked from commit fa0a7acb639422d7497eff0830252ab3ff82421e)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 11.0.0

This issue was fixed in the openstack/python-tripleoclient 11.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 10.6.1

This issue was fixed in the openstack/python-tripleoclient 10.6.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.