containers need a system to define a bootstrap node

Bug #1688380 reported by Michele Baldessari
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Dan Prince

Bug Description

Today in docker/services/keystone.yaml we do the following:
....
          keystone_bootstrap:
            start_order: 2
            action: exec
            command:
              [ 'keystone', 'keystone-manage', 'bootstrap', '--bootstrap-password', {get_param: AdminPassword} ]
....

When deploying on multiple controllers this will break. We need a way to make sure that this runs only on the first container for the service. We were trying to test if something like the following could work:
if [[ "$(hiera -c /etc/puppet/hiera.yaml keystone_short_bootstrap_node_name)" == "$(facter hostname)" ]] ; then ...do bootstrap stuff...; fi

But at least in the keystone_bootstrap container this is not currently possible because there is no hiera. Or we try to use only puppet for this?

Dan Prince (dan-prince)
Changed in tripleo:
assignee: nobody → Dan Prince (dan-prince)
Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

It seems related to approaching DB sync the same way https://bugs.launchpad.net/tripleo/+bug/1677652

tags: added: idempotency
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-common (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/463561

Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-common (master)

Reviewed: https://review.openstack.org/463561
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=cdc5a35a7f5aa5d879475587aeab2c10f7f52f34
Submitter: Jenkins
Branch: master

commit cdc5a35a7f5aa5d879475587aeab2c10f7f52f34
Author: Dan Prince <email address hidden>
Date: Tue May 9 09:00:07 2017 -0400

    Add a bootstrap_host_exec CMD

    Adds a simple command line utility that will exist in all TripleO
    containers (we may need this in a variety of places) so that we
    can quickly figure out whether a command should execute on the
    bootstrap node (or not).

    For example:
      ./bootstrap_host_exec heat_engine heat-manage db_sync

    would only execute the DB sync for heat on the bootstrap node.
    Internally the script uses hieradata to determine when to run the
    supplied command.

    Also, adds openstack-tripleo-common to the base container image so we
    can use it in a variety of container images.

    Related-Bug: #1688380
    Change-Id: If25f217bbb592edab4e1dde53ca99ed93c0e146c

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/465551

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

Reviewed: https://review.openstack.org/465551
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=51da97d04a2cbc81ad4b56a8a91c6dd43d5afe81
Submitter: Jenkins
Branch: master

commit 51da97d04a2cbc81ad4b56a8a91c6dd43d5afe81
Author: Dan Prince <email address hidden>
Date: Wed May 17 08:58:57 2017 -0400

    docker bootstrap service commands

    This patch guards db syncs and initialization code from executing
    on multiple nodes at the same time by using the new
    bootstrap_host_exec script. This helper script checks to make
    sure the container is executing on the "bootstrap host" for the
    specified service (arg 0) and then if it matches runs the
    specified command.

    Depends-On: If25f217bbb592edab4e1dde53ca99ed93c0e146c
    Depends-On: Ic1585bae27c318bd6bafc287e905f2ed250cce0f

    Change-Id: I0c864ca093ea476248b619d8c88477ef0b64e2eb
    Closes-Bug: 1688380

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 7.0.0.0b2

This issue was fixed in the openstack/tripleo-heat-templates 7.0.0.0b2 development milestone.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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