kolla-ansible/ansible/roles/ovs-dpdk/defaults/main.yml
Mark Goddard ade5bfa302 Use ansible_facts to reference facts
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
2021-06-23 10:38:06 +01:00

95 lines
4.4 KiB
YAML

---
####################
# Services
####################
ovsdpdk_services:
ovsdpdk-db:
container_name: "ovsdpdk_db"
image: "{{ ovsdpdk_db_image_full }}"
enabled: "{{ neutron_plugin_agent in ['openvswitch'] }}"
host_in_groups: >-
{{
inventory_hostname in groups['compute']
or (enable_manila | bool and inventory_hostname in groups['manila-share'])
or inventory_hostname in groups['neutron-dhcp-agent']
or inventory_hostname in groups['neutron-l3-agent']
or inventory_hostname in groups['neutron-metadata-agent']
}}
volumes: "{{ ovsdpdk_db_default_volumes + ovsdpdk_db_extra_volumes }}"
dimensions: "{{ ovsdpdk_db_dimensions }}"
ovsdpdk-vswitchd:
container_name: "ovsdpdk_vswitchd"
image: "{{ ovsdpdk_vswitchd_image_full }}"
enabled: "{{ neutron_plugin_agent in ['openvswitch'] }}"
privileged: True
host_in_groups: >-
{{
inventory_hostname in groups['compute']
or (enable_manila | bool and inventory_hostname in groups['manila-share'])
or inventory_hostname in groups['neutron-dhcp-agent']
or inventory_hostname in groups['neutron-l3-agent']
or inventory_hostname in groups['neutron-metadata-agent']
}}
volumes: "{{ ovsdpdk_vswitchd_default_volumes + ovsdpdk_vswitchd_extra_volumes }}"
dimensions: "{{ ovsdpdk_vswitchd_dimensions }}"
####################
# OVS
####################
ovs_bridge_mappings: "{% for bridge in neutron_bridge_name.split(',') %}physnet{{ loop.index0 + 1 }}:{{ bridge }}{% if not loop.last %},{% endif %}{% endfor %}"
ovs_port_mappings: "{% for bridge in neutron_bridge_name.split(',') %} {{ neutron_external_interface.split(',')[loop.index0] }}:{{ bridge }}{% if not loop.last %},{% endif %}{% endfor %}"
tunnel_interface_network: "{{ hostvars[inventory_hostname].ansible_facts[dpdk_tunnel_interface]['ipv4']['network']}}/{{hostvars[inventory_hostname].ansible_facts[dpdk_tunnel_interface]['ipv4']['netmask'] }}"
tunnel_interface_cidr: "{{ dpdk_tunnel_interface_address }}/{{ tunnel_interface_network | ipaddr('prefix') }}"
ovs_cidr_mappings: "{% if neutron_bridge_name.split(',')|length != 1 %} {neutron_bridge_name.split(',')[0]}:{{ tunnel_interface_cidr }} {% else %} {{ neutron_bridge_name }}:{{ tunnel_interface_cidr }} {% endif %}"
ovs_mem_channels: 4
ovs_socket_mem: 1024
ovs_hugepage_mountpoint: /dev/hugepages
# ovs <2.7 required dpdk phyical port names to be index
# in pci address order as dpdkX where X is the index
# ovs>=2.7 allows arbitray names but the pci address
# must be set in a new dpdkdev-opt field
# valid values are indexed or named.
ovs_physical_port_policy: named
project_name: "ovs"
neutron_bridge_name: "br_dpdk"
####################
# Docker
####################
ovsdpdk_install_type: "{{ kolla_install_type }}"
ovsdpdk_tag: "{{ openstack_tag }}"
ovsdpdk_db_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ ovsdpdk_install_type }}-ovsdpdk-db"
ovsdpdk_db_tag: "{{ ovsdpdk_tag }}"
ovsdpdk_db_image_full: "{{ ovsdpdk_db_image }}:{{ ovsdpdk_db_tag }}"
ovsdpdk_vswitchd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ ovsdpdk_install_type }}-ovsdpdk-vswitchd"
ovsdpdk_vswitchd_tag: "{{ ovsdpdk_tag }}"
ovsdpdk_vswitchd_image_full: "{{ ovsdpdk_vswitchd_image }}:{{ ovsdpdk_vswitchd_tag }}"
ovsdpdk_db_dimensions: "{{ default_container_dimensions }}"
ovsdpdk_vswitchd_dimensions: "{{ default_container_dimensions }}"
ovsdpdk_db_default_volumes:
- "{{ node_config_directory }}/ovsdpdk-db/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
- "/run/openvswitch:/run/openvswitch:shared"
- "kolla_logs:/var/log/kolla/"
- "ovsdpdk_db:/var/lib/openvswitch/"
ovsdpdk_vswitchd_default_volumes:
- "{{ node_config_directory }}/ovsdpdk-vswitchd/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
- "/lib/modules:/lib/modules:ro"
- "/run/openvswitch:/run/openvswitch:shared"
- "/dev:/dev:shared"
- "kolla_logs:/var/log/kolla/"
ovsdpdk_extra_volumes: "{{ default_extra_volumes }}"
ovsdpdk_db_extra_volumes: "{{ ovsdpdk_extra_volumes }}"
ovsdpdk_vswitchd_extra_volumes: "{{ ovsdpdk_extra_volumes }}"