Skip to content
Snippets Groups Projects
  1. Jul 02, 2021
    • Rafael Weingärtner's avatar
      Make setup module arguments configurable · 15f2fdcd
      Rafael Weingärtner authored
      
      Ansible facts can have a large impact on the performance of the Ansible
      control host. This patch introduces some control over which facts are
      gathered (kolla_ansible_setup_gather_subset) and which facts are stored
      (kolla_ansible_setup_filter). By default we do not change the default
      values of these arguments to the setup module. The flexibility of these
      arguments is limited, but they do provide enough for a large performance
      improvement in a typical moderate to large OpenStack cloud.
      
      In particular, the large complex dict fact for each interface has a
      large effect, and on an OpenStack controller or hypervisor there may be
      many virtual interfaces. We can use the kolla_ansible_setup_filter
      variable to help:
      
          kolla_ansible_setup_filter: 'ansible_[!qt]*'
      
      This causes Ansible to collect but not store facts matching that
      pattern, which includes the virtual interface facts. Currently we are
      not referencing other facts matching the pattern within Kolla Ansible.
      Note that including the 'ansible_' prefix causes meta facts module_setup
      and gather_subset to be filtered, but this seems to be the only way to
      get a good match on the interface facts. To work around this, we use
      ansible_facts rather than module_setup to detect whether facts exist in
      the cache.
      
      The exact improvement will vary, but has been reported to be as large as
      18x on systems with many virtual interfaces.
      
      For reference, here are some other tunings tried:
      
      * Increased the number of forks (great speedup depending of the size of
        the deployment)
      * Use `strategy = mitogen_linear` (cut processing time in half)
      * Ansible caching (little speed up)
      * SSH tunning (little speed up)
      
      Co-Authored-By: default avatarMark Goddard <mark@stackhpc.com>
      Closes-Bug: #1921538
      Change-Id: Iae8ca4aae945892f1dc65e1b10381d2e26e88805
      15f2fdcd
  2. 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
  3. Mar 13, 2021
  4. Apr 02, 2020
    • Mark Goddard's avatar
      Avoid unconditional fact gathering · e0ba55a8
      Mark Goddard authored
      One way to improve the performance of Ansible is through fact caching.
      Rather than gather facts in every play, we can configure Ansible to
      cache them in a persistent store. An example Ansible configuration for
      doing this is as follows:
      
      [defaults]
      gathering = smart
      fact_caching = jsonfile
      fact_caching_connection = ./facts
      fact_caching_timeout = 86400
      
      This does not affect Kolla Ansible however, since we use the setup
      module which unconditionally gathers facts regardless of the state of
      the cache. This gets worse with large inventories limited to a small
      batch of hosts via --limit or serial, since the limited hosts must
      gather facts for all others.
      
      One way to detect whether facts exist for a host is via the
      'module_setup' variable, which exists only when facts exist. This change
      uses the 'module_setup' fact to determine whether facts need to be
      gathered for hosts outside of the batch. For hosts in the batch, we
      switch from using the setup module to gather_facts on the play, which
      can use the 'smart' gathering logic.
      
      Change-Id: I04841fb62b2e1d9e97ce4b75ce3a7349b9c74036
      Partially-Implements: blueprint performance-improvements
      e0ba55a8
  5. Dec 07, 2018
    • Mark Goddard's avatar
      Fix fact gathering with --limit · 56b4352f
      Mark Goddard authored
      Prior to this change, when the --limit argument is used, each host in the
      limit gathers facts for every other host. This is clearly unnecessary, and
      can result in up to (N-1)^2 fact gathers.
      
      This change gathers facts for each host only once. Hosts that are not in
      the limit are divided between those that are in the limit, and facts are
      gathered via delegation.
      
      This change also factors out the fact gathering logic into a separate
      playbook that is imported where necessary.
      
      Change-Id: I923df5af41a7f1b7b0142d0da185a9a0979be543
      56b4352f
  6. May 16, 2018
    • Mark Goddard's avatar
      Fix missed kolla_action and kolla_serial · 2e190597
      Mark Goddard authored
      In change I78cb60168aaa40bb6439198283546b7faf33917c, action was changed
      to kolla_action, and serial to kolla_serial, to avoid Ansible warnings
      due to use of reserved keywords. In that change, some keywords were
      missed, and some changes that were merged since then have not switched
      to the new variables. This change fixes all current instances of those
      issues.
      
      Change-Id: I357dffdfcb2b405e280a962d366ee65eebf0a8d1
      Implements: blueprint migrate-to-ansible-2-2-0
      2e190597
  7. Mar 26, 2018
    • Eduardo Gonzalez's avatar
      Verify YAML syntax in gates · ea1a1dee
      Eduardo Gonzalez authored
      This patchset implements yamllint test to all *.yml
      files.
      
      Also fixes syntax errors to make jobs to pass.
      
      Change-Id: I3186adf9835b4d0cada272d156b17d1bc9c2b799
      ea1a1dee
  8. Aug 29, 2017
    • Soeren Becker's avatar
      Enable use of --limit when using bootstrap-servers · c24afe6d
      Soeren Becker authored
      The ansible/kolla-host.yml playbook failed when called with a --limit
      flag.
      
      This was due to the fact that only the facts of the subset of hosts
      were gathered but the "Generate /etc/hosts for all of the nodes" task
      is using the ansible_<IFACE>.ipv4.address variable of all hosts.
      
      The code for this fix is copied from the site.yml playbook
      where it was used for the same reason.
      
      Change-Id: I7e70caf750506ad8ab36ec024bd9647dd733fbd0
      Closes-Bug: #1713725
      c24afe6d
  9. Dec 05, 2016
  10. Aug 10, 2016
Loading