diff options
| author | Roman Krček <roman.krcek@tietoevry.com> | 2024-03-30 22:22:43 +0100 |
|---|---|---|
| committer | Roman Krček <roman.krcek@tietoevry.com> | 2024-06-28 09:04:43 +0200 |
| commit | fb3a8f5fa9373e0412bd8fd8317d7f1cd1083e37 (patch) | |
| tree | 3b277f9c42143bcd9eaa987cf0cf8f19a0e979e1 /ansible/roles/openvswitch | |
| parent | 6e88d3dc794dc58856c8f6e14eea8f5761972064 (diff) | |
| download | kolla-ansible-fb3a8f5fa9373e0412bd8fd8317d7f1cd1083e37.tar.gz kolla-ansible-fb3a8f5fa9373e0412bd8fd8317d7f1cd1083e37.zip | |
Performance: use filters for service dicts
Most roles are not leveraging the jinja filters available.
According to [1] filtering the list of services makes the execution
faster than skipping the tasks.
This patchset also includes some cosmetic changes to genconfig.
Individual services are now also using a jinja filter. This has
no impact on performance, just makes the tasks look cleaner.
Naming of some vars in genconfig was changed to "service" to make
the tasks more uniform as some were previously using
the service name and some were using "service".
Three metrics from the deployment were taken and those were
- overall deployment time [s]
- time spent on the specific role [s]
- CPU usage (measured with perf) [-]
Overall genconfig time went down on avg. from 209s to 195s
Time spent on the loadbalancer role went down on avg. from 27s to 23s
Time spent on the neutron role went down on avg from 102s to 95s
Time spent on the nova-cell role went down on avg. from 54s to 52s
Also the average CPUs utilized reported by perf went down
from 3.31 to 3.15.
For details of how this was measured see the comments in gerrit.
[1] - https://github.com/stackhpc/ansible-scaling/blob/master/doc/skip.md
Change-Id: Ib0f00aadb6c7022de6e8b455ac4b9b8cd6be5b1b
Signed-off-by: Roman Krček <roman.krcek@tietoevry.com>
Diffstat (limited to 'ansible/roles/openvswitch')
| -rw-r--r-- | ansible/roles/openvswitch/tasks/check-containers.yml | 5 | ||||
| -rw-r--r-- | ansible/roles/openvswitch/tasks/config.yml | 13 | ||||
| -rw-r--r-- | ansible/roles/openvswitch/tasks/precheck.yml | 5 |
3 files changed, 6 insertions, 17 deletions
diff --git a/ansible/roles/openvswitch/tasks/check-containers.yml b/ansible/roles/openvswitch/tasks/check-containers.yml index 406ed11a2..d030119b1 100644 --- a/ansible/roles/openvswitch/tasks/check-containers.yml +++ b/ansible/roles/openvswitch/tasks/check-containers.yml @@ -10,9 +10,6 @@ volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" healthcheck: "{{ item.value.healthcheck }}" - when: - - item.value.enabled | bool - - item.value.host_in_groups | bool - with_dict: "{{ openvswitch_services }}" + with_dict: "{{ openvswitch_services | select_services_enabled_and_mapped_to_host }}" notify: - "Restart {{ item.key }} container" diff --git a/ansible/roles/openvswitch/tasks/config.yml b/ansible/roles/openvswitch/tasks/config.yml index 6f622e652..29ec1a2db 100644 --- a/ansible/roles/openvswitch/tasks/config.yml +++ b/ansible/roles/openvswitch/tasks/config.yml @@ -7,10 +7,7 @@ owner: "{{ config_owner_user }}" group: "{{ config_owner_group }}" mode: "0770" - when: - - item.value.enabled | bool - - item.value.host_in_groups | bool - with_dict: "{{ openvswitch_services }}" + with_dict: "{{ openvswitch_services | select_services_enabled_and_mapped_to_host }}" - name: Copying over config.json files for services become: true @@ -18,10 +15,7 @@ src: "{{ item.key }}.json.j2" dest: "{{ node_config_directory }}/{{ item.key }}/config.json" mode: "0660" - when: - - item.value.enabled | bool - - item.value.host_in_groups | bool - with_dict: "{{ openvswitch_services }}" + with_dict: "{{ openvswitch_services | select_services_enabled_and_mapped_to_host }}" notify: - "Restart {{ item.key }} container" @@ -34,6 +28,5 @@ mode: "0755" become: true when: - - service.host_in_groups | bool - - service.enabled | bool + - service | service_enabled_and_mapped_to_host - openvswitch_ovs_vsctl_wrapper_enabled | bool diff --git a/ansible/roles/openvswitch/tasks/precheck.yml b/ansible/roles/openvswitch/tasks/precheck.yml index b3d411e96..8cc4aec44 100644 --- a/ansible/roles/openvswitch/tasks/precheck.yml +++ b/ansible/roles/openvswitch/tasks/precheck.yml @@ -16,7 +16,7 @@ - name: Checking free port for OVSDB vars: - openvswitch_db: "{{ openvswitch_services['openvswitch-db-server'] }}" + service: "{{ openvswitch_services['openvswitch-db-server'] }}" wait_for: host: "{{ api_interface_address }}" port: "{{ ovsdb_port }}" @@ -25,5 +25,4 @@ state: stopped when: - container_facts['openvswitch_db'] is not defined - - inventory_hostname in groups[openvswitch_db.group] - - openvswitch_db.enabled | bool + - service | service_enabled_and_mapped_to_host |
