tripleo-heat-templates/deployment
Damien Ciabrini cb55cc8ce5 Serialize shutdown of pacemaker nodes
When running minor update in a composable HA, different
roles could run ansible tasks concurrently. However,
there is currently a race when pacemaker nodes are
stopped in parallel [1,2], that could cause nodes to
incorrectly stop themselves once they reconnect to the
cluster.

To prevent concurrent shutdown, use a cluster-wide lock
to signals that one node is about to shutdown, and block
the others until the node disconnects from the cluster.

Tested the minor update in a composable HA environment:
  . when run with "openstack update run", every role
    is updated sequentially, and the shutdown lock
    doesn't interfere.
  . when running multiple ansible tasks in parallel
    "openstack update run --limit role<X>", pacemaker
    nodes are correctly stopped sequentially thanks
    to the shutdown lock.
  . when updating an existing overcloud, the new
    locking script used in the review is correctly
    injected on the overcloud, thanks to [3].

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1791841
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1872404
[3] I2ac6bb98e1d4183327e888240fc8d5a70e0d6fcb

Closes-Bug: #1904193
Change-Id: I0e041c6a95a7f53019967f9263df2326b1408c6f
2020-12-24 14:06:32 +01:00
..
aide Convert heat template to use aide role 2019-07-03 12:00:17 +00:00
aodh Notification drivers need to be a list 2020-12-18 11:26:15 +00:00
apache Merge "Rename ApacheMaxMaxClients property to ApacheMaxRequestWorkers" 2020-04-17 20:32:40 +00:00
auditd Use absolute name to include puppet classes 2020-04-11 08:13:23 +09:00
backup-and-restore Update all roles to use the new role name 2020-01-20 10:32:23 -06:00
barbican Merge "Notification drivers need to be a list" 2020-12-22 19:42:16 +00:00
cavium Use absolute name to include puppet classes 2020-04-11 08:13:23 +09:00
ceilometer Notification drivers need to be a list 2020-12-18 11:26:15 +00:00
ceph-ansible Merge "Rely on the HOSTNAME var to resolve the mon container name" 2020-12-22 05:02:55 +00:00
certs Move CA cert injection to host_prep_tasks 2020-11-18 11:53:15 -05:00
cinder Merge "Notification drivers need to be a list" 2020-12-22 19:42:16 +00:00
clients Rename roles that we have missed 2020-03-19 12:50:24 +05:30
container-image-prepare Properly place undercloud hosts record upgrade task 2020-04-07 01:00:50 +02:00
database Revert rolling certificate updates for HA services 2020-12-02 12:45:53 +01:00
deprecated Notification drivers need to be a list 2020-12-18 11:26:15 +00:00
etcd Move ipa check to external_deploy_tasks 2020-12-11 16:17:07 -05:00
experimental Notification drivers need to be a list 2020-12-18 11:26:15 +00:00
glance Merge "Notification drivers need to be a list" 2020-12-22 19:42:16 +00:00
gnocchi Remove /etc/ceph dependency and add tripleo_ceph_client role 2020-12-04 18:19:14 +01:00
haproxy Merge "Remove Sahara support" 2020-11-06 03:12:06 +00:00
heat Notification drivers need to be a list 2020-12-18 11:26:15 +00:00
horizon Fix the value of ssl_verify_client 2020-11-18 13:34:54 +01:00
image-serve Update all roles to use the new role name 2020-01-20 10:32:23 -06:00
ipa Don't pass empty values for ipaclient_servers to ipaclient role 2020-11-19 11:24:52 +01:00
ipsec Introduce new HideSensitiveLogs parameter 2020-04-20 16:44:09 +02:00
ironic Merge "Set setgid mode bit for /var/lib/ironic" 2020-12-11 12:24:07 +00:00
iscsid Ensure cinder LVM volumes work after system restart 2020-11-25 12:06:06 -08:00
kernel Align kernel args for system upgrade using leapp 2020-08-04 20:23:52 +05:30
keystone Notification drivers need to be a list 2020-12-18 11:26:15 +00:00
logging Add more metadata to logs 2020-08-06 11:15:12 +02:00
login-defs Update all roles to use the new role name 2020-01-20 10:32:23 -06:00
logrotate Fix privilege escalation 2020-07-05 16:20:00 -04:00
manila Merge "Notification drivers need to be a list" 2020-12-22 19:42:16 +00:00
masquerade-networks Move masq-nets, swift-external, and validations to deployment 2019-05-30 20:37:30 +00:00
memcached Fix memcached logging 2020-11-04 19:00:23 +01:00
messaging Add mode option when creating persistent directories. 2020-04-20 15:37:08 +02:00
metrics Merge "Fix MetricsQdrUseSSL value" 2020-11-03 14:11:05 +00:00
multipathd Deploy multipathd using tripleo_multipathd ansible role 2020-10-22 06:07:15 -07:00
neutron Notification drivers need to be a list 2020-12-18 11:26:15 +00:00
nova Merge "Removing scheduler_default_filters for Nova" 2020-12-23 02:16:58 +00:00
octavia Notification drivers need to be a list 2020-12-18 11:26:15 +00:00
openvswitch Add TSO configuration for OVS DPDK datapath. 2020-07-05 12:14:43 +05:30
ovn Revert rolling certificate updates for HA services 2020-12-02 12:45:53 +01:00
pacemaker Serialize shutdown of pacemaker nodes 2020-12-24 14:06:32 +01:00
placement Enforce internal api for token verification 2020-10-11 15:46:08 +09:00
podman Force container fetch 2020-09-21 09:26:58 -06:00
qdr Add mode option when creating persistent directories. 2020-04-20 15:37:08 +02:00
rabbitmq Add setting to override rabbitmq tcp connection backlog 2020-12-01 15:03:47 +00:00
rhsm Convert firewall rules to use TripleO-Ansible 2019-11-18 15:40:22 -06:00
securetty Update all roles to use the new role name 2020-01-20 10:32:23 -06:00
snmp Use absolute name to include puppet classes 2020-04-11 08:13:23 +09:00
sshd Allow partial override about SshServerOptions 2020-09-30 10:06:51 +09:00
swift Merge "Fix swift containers idempotency" 2020-11-06 21:01:26 +00:00
tests Introduce {{role.name}}ExtraGroupVars 2020-04-04 03:49:17 +00:00
time Update all roles to use the new role name 2020-01-20 10:32:23 -06:00
timesync Convert firewall rules to use TripleO-Ansible 2019-11-18 15:40:22 -06:00
tls Deprecate novajoin 2020-09-30 01:23:38 -04:00
tripleo-firewall firewall: make ExtraFirewallRules role specific 2020-10-01 01:43:06 +00:00
tripleo-packages Merge "Set up right DNF module stream for Upgrades and Updates." 2020-12-19 00:04:23 +00:00
tuned Convert heat template to use tuned role 2019-06-26 23:01:43 +00:00
undercloud Set up right DNF module stream for Upgrades and Updates. 2020-12-16 11:41:40 +01:00
validations Update all roles to use the new role name 2020-01-20 10:32:23 -06:00
veritas-hyperscale Manage all Keystone resources with Ansible 2020-01-06 22:33:05 +00:00
vpp Use absolute name to include puppet classes 2020-04-11 08:13:23 +09:00
README.rst Remove ffwd-upgrade leftovers from THT. 2020-07-23 15:33:25 +00:00
containers-common.yaml Serialize shutdown of pacemaker nodes 2020-12-24 14:06:32 +01:00

README.rst

TripleO Deployments

This directory contains files that represent individual service deployments, orchestration tools, and the configuration tools used to deploy them.

Directory Structure

Each logical grouping of services will have a directory. Example: 'timesync'. Within this directory related timesync services would exist to for example configure timesync services on baremetal or via containers.

Filenaming conventions

As a convention each deployments service filename will reflect both the deployment engine (baremetal, or containers) along with the config tool used to deploy that service.

The convention is <service-name>-<engine>-<config management tool>.

Examples:

deployment/aodh/aodh-api-container-puppet.yaml (containerized Aodh service configured with Puppet)

deployment/aodh/aodh-api-container-ansible.yaml (containerized Aodh service configured with Ansible)

deployment/timesync/chrony-baremetal-ansible.yaml (baremetal Chrony service configured with Ansible)

deployment/timesync/chrony-baremetal-puppet.yaml (baremetal Chrony service configured with Puppet)

Building Kolla Images

TripleO currently relies on Kolla(Dockerfile) containers. Kolla supports container customization and we are making use of this feature within TripleO to inject puppet (our configuration tool of choice) into the Kolla base images. A variety of other customizations are being made via the tripleo-common/container-images/tripleo_kolla_template_overrides.j2 file.

To build Kolla images for TripleO adjust your kolla config1 to build your centos base image with puppet using the example below:

$ cat template-overrides.j2 {% extends parent_template %} {% set base_centos_binary_packages_append = ['puppet'] %} {% set nova_scheduler_packages_append = ['openstack-tripleo-common'] %}

kolla-build --base centos --template-override template-overrides.j2

Containerized Deployment Template Structure

Each deployment template may define a set of output values control the underlying service deployment in a variety of ways. These output sections are specific to the TripleO deployment architecture. The following sections are available for containerized services.

  • config_settings: This section contains service specific hiera data can be used to generate config files for each service. This data is ultimately processed via the container_puppet_config module in tripleo-ansible which generates config files for each service according to the settings here.

  • kolla_config: Contains YAML that represents how to map config files into the kolla container. This config file is typically mapped into the container itself at the /var/lib/kolla/config_files/config.json location and drives how kolla's external config mechanisms work.

  • docker_config: Data that is passed to tripleo_container_manage role to configure a container, or step of containers at each step. See the available steps documented below which are implemented by TripleO's cluster deployment architecture. If you want the tasks executed only once for the bootstrap node per a role in the cluster, use the /usr/bin/bootstrap_host_exec wrapper.

  • puppet_config: This section is a nested set of key value pairs that drive the creation of config files using puppet. Required parameters include:

    • puppet_tags: Puppet resource tag names that are used to generate config files with puppet. Only the named config resources are used to generate a config file. Any service that specifies tags will have the default tags of 'file,concat,file_line,augeas,cron' appended to the setting. Example: keystone_config
    • config_volume: The name of the volume (directory) where config files will be generated for this service. Use this as the location to bind mount into the running Kolla container for configuration.
    • config_image: The name of the container image that will be used for generating configuration files. This is often the same container that the runtime service uses. Some services share a common set of config files which are generated in a common base container.
    • step_config: This setting controls the manifest that is used to create container config files via puppet. The puppet tags below are used along with this manifest to generate a config directory for this container.
  • container_puppet_tasks: This section provides data to drive the puppet containers tooling directly. The task is executed for the defined steps before the corresponding docker_config's step. Puppet always sees the step number overrided as the step #6. It might be useful for initialization of things. Note that the tasks are executed only once for the bootstrap node per a role in the cluster. Make sure the puppet manifest ensures the wanted "at most once" semantics. That may be achieved via the <service_name>_short_bootstrap_node_name hiera parameters automatically evaluated for each service.

  • global_config_settings: the hiera keys will be distributed to all roles

  • service_config_settings: Takes an extra key to wire in values that are defined for a service that need to be consumed by some other service. For example: service_config_settings: haproxy: foo: bar This will set the hiera key 'foo' on all roles where haproxy is included.

Deployment steps

Similar to baremetal containers are brought up in a stepwise manner. The current architecture supports bringing up baremetal services alongside of containers. For each step the baremetal puppet manifests are executed first and then any containers are brought up afterwards.

Steps correlate to the following:

Pre) Containers config files generated per hiera settings. 1) Load Balancer configuration baremetal a) step 1 baremetal b) step 1 containers 2) Core Services (Database/Rabbit/NTP/etc.) a) step 2 baremetal b) step 2 containers 3) Early Openstack Service setup (Ringbuilder, etc.) a) step 3 baremetal b) step 3 containers 4) General OpenStack Services a) step 4 baremetal b) step 4 containers c) Keystone containers post initialization (tenant,service,endpoint creation) 5) Service activation (Pacemaker), online data migration a) step 5 baremetal b) step 5 containers

Update steps:

All services have an associated update_tasks output that is an ansible snippet that will be run during update in an rolling update that is expected to run in a rolling update fashion (one node at a time)

For Controller (where pacemaker is running) we have the following states:
  1. Step=1: stop the cluster on the updated node;
  2. Step=2: Pull the latest image and retag the it pcmklatest
  3. Step=3: yum upgrade happens on the host.
  4. Step=4: Restart the cluster on the node
  5. Step=5: Verification: Currently we test that the pacemaker services are running.

Then the usual deploy steps are run which pull in the latest image for all containerized services and the updated configuration if any.

Note: as pacemaker is not containerized, the points 1 and 4 happen in deployment/pacemaker/pacemaker-baremetal-puppet.yaml.

Input Parameters

Each service may define its own input parameters and defaults. Operators will use the parameter_defaults section of any Heat environment to set per service parameters.

Apart from sevice specific inputs, there are few default parameters for all the services. Following are the list of default parameters:

  • ServiceData: Mapping of service specific data. It is used to encapsulate all the service specific data. As of now, it contains net_cidr_map, which contains the CIDR map for all the networks. Additional data will be added as and when required.

  • ServiceNetMap: Mapping of service_name -> network name. Default mappings for service to network names are defined in ../network/service_net_map.j2.yaml, which may be overridden via ServiceNetMap values added to a user environment file via parameter_defaults.

  • EndpointMap: Mapping of service endpoint -> protocol. Contains a mapping of endpoint data generated for all services, based on the data included in ../network/endpoints/endpoint_data.yaml.

  • DefaultPasswords: Mapping of service -> default password. Used to pass some passwords from the parent templates, this is a legacy interface and should not be used by new services.

  • RoleName: Name of the role on which this service is deployed. A service can be deployed in multiple roles. This is an internal parameter (should not be set via environment file), which is fetched from the name attribute of the roles_data.yaml template.

  • RoleParameters: Parameter specific to a role on which the service is applied. Using the format "<RoleName>Parameters" in the parameter_defaults of user environment file, parameters can be provided for a specific role. For example, in order to provide a parameter specific to "Compute" role, below is the format:

    parameter_defaults:
      ComputeParameters:
        Param1: value

Update Steps

Each service template may optionally define a update_tasks key, which is a list of ansible tasks to be performed during the minor update process. These are executed in a rolling manner node-by-node.

We allow a series of steps for the per-service update sequence via conditionals referencing a step variable e.g when: step|int == 2.

Pre-upgrade Rolling Steps

Each service template may optionally define a pre_upgrade_rolling_tasks key, which is a list of ansible tasks to be performed before the main upgrade phase, and these tasks are executed in a node-by-node rolling manner on the overcloud, similarly as update_tasks.

Upgrade Steps

Each service template may optionally define a upgrade_tasks key, which is a list of ansible tasks to be performed during the upgrade process.

Similar to the update_tasks, we allow a series of steps for the per-service upgrade sequence, defined as ansible tasks with a "when: step|int == 1" for the first step, "== 2" for the second, etc.

Steps correlate to the following:

  1. Perform any pre-upgrade validations.
  2. Stop the control-plane services, e.g disable LoadBalancer, stop pacemaker cluster and stop any managed resources. The exact order is controlled by the cluster constraints.
  3. Perform a package update and install new packages: A general upgrade is done, and only new package should go into service ansible tasks.
  4. Start services needed for migration tasks (e.g DB)
  5. Perform any migration tasks, e.g DB sync commands

Note that the services are not started in the upgrade tasks - we instead re-run puppet which does any reconfiguration required for the new version, then starts the services.

When running an OS upgrade via the tags system_upgrade_prepare and system_upgrade_run, or the combined tag system_upgrade, the steps corellate to the following:

  1. Any pre-service-stop actions. (system_upgrade_prepare)
  2. Stop all services. (system_upgrade_prepare)
  3. Post-service-stop actions like removing packages before the upgrade. (system_upgrade_prepare)
  4. Step reserved for the tripleo-packages service. Only package download for upgrade (under system_upgrade_prepare tag), and reboot for performing the offline upgrade (under system_upgrade_run tag) happens here.
  5. Any post-upgrade tasks (system_upgrade_run).

Nova Server Metadata Settings

One can use the hook of type OS::TripleO::ServiceServerMetadataHook to pass entries to the nova instances' metadata. It is, however, disabled by default. In order to overwrite it one needs to define it in the resource registry. An implementation of this hook needs to conform to the following:

  • It needs to define an input called RoleData of json type. This gets as input the contents of the role_data for each role's ServiceChain.
  • This needs to define an output called metadata which will be given to the Nova Server resource as the instance's metadata.

Keystone resources management

Keystone resources, such as users, roles, domains, endpoints, services, role assignments, are now managed by tripleo-keystone-resources Ansible role.


  1. See the override file which can be used to build Kolla packages that work with TripleO.↩︎