Skip to content
Snippets Groups Projects
  1. Apr 13, 2023
    • Matt Crees's avatar
      Remove RabbitMQ ha-all policy when not required · c85b64d1
      Matt Crees authored
      With the addition of the variable
      `om_enable_rabbitmq_high_availability`, this feature in the upgrade
      task should be brought back. It is also now used in the deploy task. The
      `ha-all` policy is cleared only when
      `om_enable_rabbitmq_high_availability` is set to `false`.
      
      Change-Id: Ia056aa40e996b1f0fed43c0f672466c7e4a2f547
      c85b64d1
  2. Apr 12, 2023
  3. Mar 21, 2023
  4. Feb 14, 2023
    • John Garbutt's avatar
      Improve RabbitMQ performance by reducing ha replicas · 6cf22b0c
      John Garbutt authored
      Currently we do not follow the RabbitMQ advice on replicas here:
      https://www.rabbitmq.com/ha.html#replication-factor
      
      Here we reduce the number of replicas to n // 2 + 1 as advised
      above. The hope it this helps speed up recovery from rabbit
      issues.
      
      Related-Bug: #1954925
      Change-Id: Ib6bcb26c499c9884faa4a0cd51abaec00cacb096
      6cf22b0c
    • Matt Crees's avatar
      Add flag to change RabbitMQ ha-mode definition · e13072a9
      Matt Crees authored
      Adds the flag `rabbitmq_ha_replica_count` to change how many different
      nodes a queue should be mirrored across. If the value is not set, then
      it defaults to "ha-mode":"all". This value is unset by default to avoid
      any unexpected changes to the RabbitMQ definitions.json file, as that
      would trigger an unexpected restart of RabbitMQ during the next deploy.
      
      Change-Id: Iee98cd937197a73a3b04aa8501fa325e8ecfff24
      e13072a9
  5. Feb 09, 2023
    • John Garbutt's avatar
      RabbitMQ: Support setting ha-promote-on-shutdown · 94f3ce0c
      John Garbutt authored
      By default ha-promote-on-shutdown=when-synced. However we are seeing
      issues with RabbitMQ automatically recovering when nodes are restarted.
      https://www.rabbitmq.com/ha.html#cluster-shutdown
      
      Rather than waiting for operator interventions, it is better we allow
      recovery to happen, even if that means we may loose some messages.
      A few failed and timed out operations is better than a totaly broken
      cloud. This is achieved using ha-promote-on-shutdown=always.
      
      Note, when a node failure is detected, this is already the default
      behaviour from 3.7.5 onwards:
      https://www.rabbitmq.com/ha.html#promoting-unsynchronised-mirrors
      
      This patch adds the option to change the ha-promote-on-shutdown
      definition, using the flag `rabbitmq_ha_promote_on_shutdown`. This
      value is unset by default to avoid any unexpected changes to the
      RabbitMQ definitions.json file, as that would trigger an unexpected
      restart of RabbitMQ during the next deploy.
      
      Related-Bug: #1954925
      
      Change-Id: I2146bda2c72ddac2c9923c6941b0596395fd9ab5
      94f3ce0c
  6. Jan 17, 2023
    • Michal Arbet's avatar
      Add ability to configure rabbitmq · 701dc20f
      Michal Arbet authored
      As rabbitmq's configuration file is not ini or yaml file,
      there is no option to extend configuration by new config
      options via merge_configs or merge_yaml.
      
      This patch moves config options to dictionary
      so it can be overriden in /etc/kolla/globals.yml.
      
      Change-Id: I5cd772f4fb80a0e200fb24d67be735ca81e3fdeb
      701dc20f
  7. Jan 13, 2023
    • Matt Crees's avatar
      Add a flag to handle RabbitMQ high availability · 09df6fc1
      Matt Crees authored
      A combination of durable queues and classic queue mirroring can be used
      to provide high availability of RabbitMQ. However, these options should
      only be used together, otherwise the system will become unstable. Using
      the flag ``om_enable_rabbitmq_high_availability`` will either enable
      both options at once, or neither of them.
      
      There are some queues that should not be mirrored:
      * ``reply`` queues (these have a single consumer and TTL policy)
      * ``fanout`` queues (these have a TTL policy)
      * ``amq`` queues (these are auto-delete queues, with a single consumer)
      An exclusionary pattern is used in the classic mirroring policy. This
      pattern is ``^(?!(amq\\.)|(.*_fanout_)|(reply_)).*``
      
      Change-Id: I51c8023b260eb40b2eaa91bd276b46890c215c25
      09df6fc1
  8. Jan 12, 2023
    • Mark Goddard's avatar
      Fix prechecks in check mode · 46aeb984
      Mark Goddard authored
      When running in check mode, some prechecks previously failed because
      they use the command module which is silently not run in check mode.
      Other prechecks were not running correctly in check mode due to e.g.
      looking for a string in empty command output or not querying which
      containers are running.
      
      This change fixes these issues.
      
      Closes-Bug: #2002657
      Change-Id: I5219cb42c48d5444943a2d48106dc338aa08fa7c
      46aeb984
  9. Jan 09, 2023
    • Erik Berg's avatar
      rabbitmq: Use assert on checks for readability · e0538c81
      Erik Berg authored
      assert will also fail when we're not meeting the conditions, makes
      clear what we're actually testing, and isn't listed as a skipped task
      when the condition is ok.
      
      Change-Id: I4c919b523dde2602c81179ab3d28b913650b4c9f
      e0538c81
  10. Dec 21, 2022
    • Matt Crees's avatar
      Integrate oslo-config-validator · 6c2aace8
      Matt Crees authored
      Regularly, we experience issues in Kolla Ansible deployments because we
      use wrong options in OpenStack configuration files. This is because
      OpenStack services ignore unknown options. We also need to keep on top
      of deprecated options that may be removed in the future. Integrating
      oslo-config-validator into Kolla Ansible will greatly help.
      
      Adds a shared role to run oslo-config-validator on each service. Takes
      into account that services have multiple containers, and these may also
      use multiple config files. Service roles are extended to use this shared
      role. Executed with the new command ``kolla-ansible validate-config``.
      
      Change-Id: Ic10b410fc115646d96d2ce39d9618e7c46cb3fbc
      6c2aace8
  11. Nov 02, 2022
  12. Oct 28, 2022
  13. Aug 09, 2022
  14. Jul 27, 2022
  15. Jul 25, 2022
    • Michal Nasiadka's avatar
      Fix var-spacing · dcf5a8b6
      Michal Nasiadka authored
      ansible-lint introduced var-spacing - let's fix our code.
      
      Change-Id: I0d8aaf3c522a5a6a5495032f6dbed8a2be0251f0
      dcf5a8b6
  16. May 23, 2022
  17. Apr 20, 2022
  18. Mar 24, 2022
  19. Mar 18, 2022
  20. Feb 21, 2022
    • Doug Szumski's avatar
      Remove classic queue mirroring for internal RabbitMQ · 6bfe1927
      Doug Szumski authored
      When OpenStack is deployed with Kolla-Ansible, by default there
      are no durable queues or exchanges created by the OpenStack
      services in RabbitMQ. In Rabbit terminology, not being durable
      is referred to as `transient`, and this means that the queue
      is generally held in memory.
      
      Whether OpenStack services create durable or transient queues is
      traditionally controlled by the Oslo Notification config option:
      `amqp_durable_queues`. In Kolla-Ansible, this remains set to
      the default of `False` in all services. The only `durable`
      objects are the `amq*` exchanges which are internal to RabbitMQ.
      
      More recently, Oslo Notification has introduced support for
      Quorum queues [7]. These are a successor to durable classic
      queues, however it isn't yet clear if they are a good fit for
      OpenStack in general [8].
      
      For clustered RabbitMQ deployments, Kolla-Ansible configures all
      queues as `replicated` [1]. Replication occurs over all nodes
      in the cluster. RabbitMQ refers to this as 'mirroring of classic
      queues'.
      
      In summary, this means that a multi-node Kolla-Ansible deployment
      will end up with a large number of transient, mirrored queues
      and exchanges. However, the RabbitMQ documentation warns against
      this, stating that 'For replicated queues, the only reasonable
      option is to use durable queues: [2]`. This is discussed
      further in the following bug report: [3].
      
      Whilst we could try enabling the `amqp_durable_queues` option
      for each service (this is suggested in [4]), there are
      a number of complexities with this approach, not limited to:
      
      1) RabbitMQ is planning to remove classic queue mirroring in
         favor of 'Quorum queues' in a forthcoming release [5].
      2) Durable queues will be written to disk, which may cause
         performance problems at scale. Note that this includes
         Quorum queues which are always durable.
      3) Potential for race conditions and other complexity
         discussed recently on the mailing list under:
         `[ops] [kolla] RabbitMQ High Availability`
      
      The remaining option, proposed here, is to use classic
      non-mirrored queues everywhere, and rely on services to recover
      if the node hosting a queue or exchange they are using fails.
      There is some discussion of this approach in [6]. The downside
      of potential message loss needs to be weighed against the real
      upsides of increasing the performance of RabbitMQ, and moving
      to a configuration which is officially supported and hopefully
      more stable. In the future, we can then consider promoting
      specific queues to quorum queues, in cases where message loss
      can result in failure states which are hard to recover from.
      
      [1] https://www.rabbitmq.com/ha.html
      [2] https://www.rabbitmq.com/queues.html
      [3] https://github.com/rabbitmq/rabbitmq-server/issues/2045
      [4] https://wiki.openstack.org/wiki/Large_Scale_Configuration_Rabbit
      [5] https://blog.rabbitmq.com/posts/2021/08/4.0-deprecation-announcements/
      [6] https://fuel-ccp.readthedocs.io/en/latest/design/ref_arch_1000_nodes.html#replication
      [7] https://bugs.launchpad.net/oslo.messaging/+bug/1942933
      [8] https://www.rabbitmq.com/quorum-queues.html#use-cases
      
      Partial-Bug: #1954925
      Change-Id: I91d0e23b22319cf3fdb7603f5401d24e3b76a56e
      6bfe1927
  21. Jan 12, 2022
  22. Jan 11, 2022
  23. Jan 09, 2022
    • LinPeiWen's avatar
      Support enable/disable rabbitmq prometheus plugins · 1f3dcce5
      LinPeiWen authored
      rabbitmq starting from 3.8.0, built-in Prometheus support,
      prometheus plugins are enabled by default, when the environment is
      "enable_prometheus is no", rabbitmq role will disable prometheus plugins
      
      Closes-Bug: #1885106
      
      Change-Id: I4d694d6224c813285d228d6bc7eece5731db1078
      1f3dcce5
  24. Dec 31, 2021
    • Pierre Riteau's avatar
      Move project_name and kolla_role_name to role vars · 56fc74f2
      Pierre Riteau authored
      Role vars have a higher precedence than role defaults. This allows to
      import default vars from another role via vars_files without overriding
      project_name (see related bug for details).
      
      Change-Id: I3d919736e53d6f3e1a70d1267cf42c8d2c0ad221
      Related-Bug: #1951785
      56fc74f2
  25. Aug 10, 2021
    • Radosław Piliszek's avatar
      Refactor and optimise image pulling · 9ff2ecb0
      Radosław Piliszek authored
      We get a nice optimisation by using a filtered loop instead
      of task skipping per service with 'when'.
      
      Partially-Implements: blueprint performance-improvements
      Change-Id: I8f68100870ab90cb2d6b68a66a4c97df9ea4ff52
      9ff2ecb0
  26. Jul 28, 2021
    • Radosław Piliszek's avatar
      Use more RMQ flags for less busy wait · d7cdad53
      Radosław Piliszek authored
      As mentioned in the Iced014acee7e590c10848e73feca166f48b622dc
      commit message, in Ussuri+ we can use ``+sbwtdcpu none
      +sbwtdio none`` as well. This is due to relying on RMQ-provided
      erlang in version 23.x.
      
      This change adds the extra arguments by default.
      It should be backported down to Ussuri before we do a release with
      Iced014acee7e590c10848e73feca166f48b622dc.
      
      Change-Id: I32e247a6cb34d7f6763b544f247fd408dce2b3a2
      d7cdad53
  27. Jun 23, 2021
    • Mark Goddard's avatar
      Use ansible_facts to reference facts · ade5bfa3
      Mark Goddard authored
      By default, Ansible injects a variable for every fact, prefixed with
      ansible_. This can result in a large number of variables for each host,
      which at scale can incur a performance penalty. Ansible provides a
      configuration option [0] that can be set to False to prevent this
      injection of facts. In this case, facts should be referenced via
      ansible_facts.<fact>.
      
      This change updates all references to Ansible facts within Kolla Ansible
      from using individual fact variables to using the items in the
      ansible_facts dictionary. This allows users to disable fact variable
      injection in their Ansible configuration, which may provide some
      performance improvement.
      
      This change disables fact variable injection in the ansible
      configuration used in CI, to catch any attempts to use the injected
      variables.
      
      [0] https://docs.ansible.com/ansible/latest/reference_appendices/config.html#inject-facts-as-vars
      
      Change-Id: I7e9d5c9b8b9164d4aee3abb4e37c8f28d98ff5d1
      Partially-Implements: blueprint performance-improvements
      ade5bfa3
  28. Jun 08, 2021
    • Mark Goddard's avatar
      Fix RabbitMQ restart ordering · 0cd5b027
      Mark Goddard authored
      The host list order seen during Ansible handlers may differ to the usual
      play host list order, due to race conditions in notifying handlers. This
      means that restart_services.yml for RabbitMQ may be included in a
      different order than the rabbitmq group, resulting in a node other than
      the 'first' being restarted first. This can cause some nodes to fail to
      join the cluster. The include_tasks loop was introduced in [1].
      
      This change fixes the issue by splitting the handler into two tasks, and
      restarting the first node before all others.
      
      [1] https://review.opendev.org/c/openstack/kolla-ansible/+/763137
      
      Change-Id: I1823301d5889589bfd48326ed7de03c6061ea5ba
      Closes-Bug: #1930293
      0cd5b027
  29. Jun 07, 2021
    • John Garbutt's avatar
      Reduce RabbitMQ busy waiting, lowering CPU load · 70f6f8e4
      John Garbutt authored
      On machines with many cores, we were seeing excessive CPU load on systems
      that were not very busy. With the following Erlang VM argument we saw
      RabbitMQ CPU usage drop from about 150% to around 20%, on a system with
      40 hyperthreads.
      
          +S 2:2
      
      By default RabbitMQ starts N schedulers where N is the number of CPU
      cores, including hyper-threaded cores. This is fine when you assume all
      your CPUs are dedicated to RabbitMQ. Its not a good idea in a typical
      Kolla Ansible setup. Here we go for two scheduler threads.
      More details can be found here:
      https://www.rabbitmq.com/runtime.html#scheduling
      and here:
      https://erlang.org/doc/man/erl.html#emulator-flags
      
          +sbwt none
      
      This stops busy waiting of the scheduler, for more details see:
      https://www.rabbitmq.com/runtime.html#busy-waiting
      Newer versions of rabbit may need additional flags:
      "+sbwt none +sbwtdcpu none +sbwtdio none"
      But this patch should be back portable to older versions of RabbitMQ
      used in Train and Stein.
      
      Note that information on this tuning was found by looking at data from:
      rabbitmq-diagnostics runtime_thread_stats
      More details on that can be found here:
      https://www.rabbitmq.com/runtime.html#thread-stats
      
      Related-Bug: #1846467
      
      Change-Id: Iced014acee7e590c10848e73feca166f48b622dc
      70f6f8e4
  30. May 21, 2021
  31. Apr 14, 2021
  32. Dec 14, 2020
    • Mark Goddard's avatar
      Revert "Performance: Use import_tasks in the main plays" · db4fc85c
      Mark Goddard authored
      This reverts commit 9cae59be.
      
      Reason for revert: This patch was found to introduce issues with fluentd customisation. The underlying issue is not currently fully understood, but could be a sign of other obscure issues.
      
      Change-Id: Ia4859c23d85699621a3b734d6cedb70225576dfc
      Closes-Bug: #1906288
      db4fc85c
  33. Nov 19, 2020
  34. Oct 27, 2020
    • Radosław Piliszek's avatar
      Performance: Use import_tasks in the main plays · 9cae59be
      Radosław Piliszek authored
      Main plays are action-redirect-stubs, ideal for import_tasks.
      
      This avoids 'include' penalty and makes logs/ara look nicer.
      
      Fixes haproxy and rabbitmq not to check the host group as well.
      
      Change-Id: I46136fc40b815e341befff80b54a91ef431eabc0
      Partially-Implements: blueprint performance-improvements
      9cae59be
  35. Oct 12, 2020
    • Radosław Piliszek's avatar
      Performance: optimize genconfig · 3411b9e4
      Radosław Piliszek authored
      Config plays do not need to check containers. This avoids skipping
      tasks during the genconfig action.
      
      Ironic and Glance rolling upgrades are handled specially.
      
      Swift and Bifrost do not use the handlers at all.
      
      Partially-Implements: blueprint performance-improvements
      Change-Id: I140bf71d62e8f0932c96270d1f08940a5ba4542a
      3411b9e4
  36. Sep 17, 2020
    • Mark Goddard's avatar
      Support TLS encryption of RabbitMQ client-server traffic · 761ea9a3
      Mark Goddard authored
      This change adds support for encryption of communication between
      OpenStack services and RabbitMQ. Server certificates are supported, but
      currently client certificates are not.
      
      The kolla-ansible certificates command has been updated to support
      generating certificates for RabbitMQ for development and testing.
      
      RabbitMQ TLS is enabled in the all-in-one source CI jobs, or when
      The Zuul 'tls_enabled' variable is true.
      
      Change-Id: I4f1d04150fb2b5af085b762890092f87ae6076b5
      Implements: blueprint message-queue-ssl-support
      761ea9a3
  37. Aug 28, 2020
  38. Aug 10, 2020
    • Mark Goddard's avatar
      Mount /etc/timezone based on host OS · 146b00ef
      Mark Goddard authored
      Previously we mounted /etc/timezone if the kolla_base_distro is debian
      or ubuntu. This would fail prechecks if debian or ubuntu images were
      deployed on CentOS. While this is not a supported combination, for
      correctness we should fix the condition to reference the host OS rather
      than the container OS, since that is where the /etc/timezone file is
      located.
      
      Change-Id: Ifc252ae793e6974356fcdca810b373f362d24ba5
      Closes-Bug: #1882553
      146b00ef
Loading