From b761808359bb9b38db9847e06bf6a074a09f7807 Mon Sep 17 00:00:00 2001 From: Janne Suominen Date: Fri, 10 May 2019 10:32:37 +0300 Subject: [PATCH] Remove references to any product Remove references to any particular product. Change-Id: Ic74a87d1fd29a18fe7cde61c76d61b07c8a8705f Signed-off-by: Janne Suominen --- roles/allocate_cpu_cores/defaults/main.yml | 4 +-- roles/allocate_cpu_cores/tasks/main.yml | 30 +++++++++++----------- roles/allocate_cpu_cores/tasks/make_cpu_sets.yaml | 12 ++++----- .../templates/cloud_cpu_allocation.fact.j2 | 9 +++++++ .../templates/ncir_cpu_allocation.fact.j2 | 9 ------- roles/change_kernel_cmdline/tasks/main.yml | 2 +- roles/logging/tasks/main.yml | 3 --- .../logging/tasks/restart_centralized_instance.yml | 17 ------------ roles/performance_nodes/tasks/ovsdpdk.yaml | 6 ++--- roles/performance_nodes_post/tasks/nova.yaml | 2 +- 10 files changed, 37 insertions(+), 57 deletions(-) create mode 100644 roles/allocate_cpu_cores/templates/cloud_cpu_allocation.fact.j2 delete mode 100644 roles/allocate_cpu_cores/templates/ncir_cpu_allocation.fact.j2 delete mode 100644 roles/logging/tasks/restart_centralized_instance.yml diff --git a/roles/allocate_cpu_cores/defaults/main.yml b/roles/allocate_cpu_cores/defaults/main.yml index 00d0741..0a43c76 100644 --- a/roles/allocate_cpu_cores/defaults/main.yml +++ b/roles/allocate_cpu_cores/defaults/main.yml @@ -13,7 +13,7 @@ # limitations under the License. # Number of platform CPUs to allocate per service by default. -ncir_default_platform_cpus: +cloud_default_platform_cpus: default: controller: own: 1 @@ -53,7 +53,7 @@ caas_service_profiles: - caas_master - caas_worker -allocation_fact_file: "/etc/ansible/facts.d/ncir_cpu_allocation.fact" +allocation_fact_file: "/etc/ansible/facts.d/cloud_cpu_allocation.fact" cpu_set_mapping: ovs_dpdk: diff --git a/roles/allocate_cpu_cores/tasks/main.yml b/roles/allocate_cpu_cores/tasks/main.yml index cca66d8..b1c835f 100644 --- a/roles/allocate_cpu_cores/tasks/main.yml +++ b/roles/allocate_cpu_cores/tasks/main.yml @@ -17,19 +17,19 @@ - name: Prepare. set_fact: - ncir_cpu_remain: [] - ncir_cpu_sets: {} + cloud_cpu_remain: [] + cloud_cpu_sets: {} - name: Get CPU topology. get_cpu_topology: - var: ncir_cpu_topology + var: cloud_cpu_topology - debug: - var: ncir_cpu_topology + var: cloud_cpu_topology - name: Make default performance profile. set_fact: perf_profile: { - platform_cpus: "{{ ncir_cpu_topology | cpu_topology_defaults(hosts[hostname]['service_profiles'], ncir_default_platform_cpus, virtual_env, hosts | length < 2) }}" + platform_cpus: "{{ cloud_cpu_topology | cpu_topology_defaults(hosts[hostname]['service_profiles'], cloud_default_platform_cpus, virtual_env, hosts | length < 2) }}" } - debug: var: perf_profile @@ -66,13 +66,13 @@ loop_control: loop_var: cpu_set with_items: - - { 'name': 'vm', 'request': "{{ ncir_cpu_topology | get_cpu_count_by_percent(vm_share_percent) }}", 'where': 'tail' } + - { 'name': 'vm', 'request': "{{ cloud_cpu_topology | get_cpu_count_by_percent(vm_share_percent) }}", 'where': 'tail' } when: - "'compute' in hosts[hostname]['service_profiles']" - name: Calculate CaaS CPU counts set_fact: - perf_profile: "{{ perf_profile | combine({ item.key: ncir_cpu_topology | get_cpu_count_by_percent(item.value) }) }}" + perf_profile: "{{ perf_profile | combine({ item.key: cloud_cpu_topology | get_cpu_count_by_percent(item.value) }) }}" with_dict: "{{ perf_profile['caas_cpu_pools'] | default({}) }}" when: hosts[hostname]['service_profiles'] | intersect(caas_service_profiles) @@ -89,19 +89,19 @@ - name: Make set of remaining CPUs. set_fact: - ncir_cpu_remain: "{{ ncir_cpu_remain | union(item) }}" - with_items: "{{ ncir_cpu_topology.values() }}" + cloud_cpu_remain: "{{ cloud_cpu_remain | union(item) }}" + with_items: "{{ cloud_cpu_topology.values() }}" - debug: - var: ncir_cpu_remain + var: cloud_cpu_remain - name: Allocate remaining CPUs to platform. set_fact: - ncir_cpu_sets: "{{ ncir_cpu_sets | combine({ 'platform': ncir_cpu_sets['platform'] | default([]) | union(ncir_cpu_remain) }) }}" - ncir_cpu_remain: [] - when: "ncir_cpu_remain | length > 0" + cloud_cpu_sets: "{{ cloud_cpu_sets | combine({ 'platform': cloud_cpu_sets['platform'] | default([]) | union(cloud_cpu_remain) }) }}" + cloud_cpu_remain: [] + when: "cloud_cpu_remain | length > 0" - debug: - var: ncir_cpu_sets + var: cloud_cpu_sets - name: Make sure facts directory exists. file: @@ -111,7 +111,7 @@ - name: Save CPU allocation. template: - src: ncir_cpu_allocation.fact.j2 + src: cloud_cpu_allocation.fact.j2 dest: "{{ allocation_fact_file }}" register: cpu_allocation diff --git a/roles/allocate_cpu_cores/tasks/make_cpu_sets.yaml b/roles/allocate_cpu_cores/tasks/make_cpu_sets.yaml index 4bb3816..a128fe7 100644 --- a/roles/allocate_cpu_cores/tasks/make_cpu_sets.yaml +++ b/roles/allocate_cpu_cores/tasks/make_cpu_sets.yaml @@ -7,21 +7,21 @@ - name: Allocate CPU set. set_fact: - allocated_cpu_set: "{{ ncir_cpu_topology | cpu_topology_alloc(cpu_request, cpu_set.where) }}" + allocated_cpu_set: "{{ cloud_cpu_topology | cpu_topology_alloc(cpu_request, cpu_set.where) }}" - name: Append allocated CPU set. set_fact: - combined_cpu_set: "{{ allocated_cpu_set | union(ncir_cpu_sets[cpu_set.name] | default([])) | sort }}" + combined_cpu_set: "{{ allocated_cpu_set | union(cloud_cpu_sets[cpu_set.name] | default([])) | sort }}" - name: Make CPU set. set_fact: - ncir_cpu_sets: "{{ ncir_cpu_sets | combine({ cpu_set.name: combined_cpu_set }) }}" - ncir_cpu_topology: "{{ ncir_cpu_topology | cpu_topology_trim(cpu_request, cpu_set.where) }}" + cloud_cpu_sets: "{{ cloud_cpu_sets | combine({ cpu_set.name: combined_cpu_set }) }}" + cloud_cpu_topology: "{{ cloud_cpu_topology | cpu_topology_trim(cpu_request, cpu_set.where) }}" - name: Show created CPU sets. debug: - var: ncir_cpu_sets + var: cloud_cpu_sets - name: Show CPU topology after sets creation. debug: - var: ncir_cpu_topology + var: cloud_cpu_topology diff --git a/roles/allocate_cpu_cores/templates/cloud_cpu_allocation.fact.j2 b/roles/allocate_cpu_cores/templates/cloud_cpu_allocation.fact.j2 new file mode 100644 index 0000000..e7074ef --- /dev/null +++ b/roles/allocate_cpu_cores/templates/cloud_cpu_allocation.fact.j2 @@ -0,0 +1,9 @@ +{# Copyright (C) 2018 Nokia #} +{ +{% for s in cloud_cpu_sets %} + "{{ s }}": { + "set" : {{ cloud_cpu_sets[s] | sort }}, + "list": "{{ cloud_cpu_sets[s] | set_to_cpulist }}" + }{{ "," if not loop.last else "" }} +{% endfor %} +} diff --git a/roles/allocate_cpu_cores/templates/ncir_cpu_allocation.fact.j2 b/roles/allocate_cpu_cores/templates/ncir_cpu_allocation.fact.j2 deleted file mode 100644 index ab31352..0000000 --- a/roles/allocate_cpu_cores/templates/ncir_cpu_allocation.fact.j2 +++ /dev/null @@ -1,9 +0,0 @@ -{# Copyright (C) 2018 Nokia #} -{ -{% for s in ncir_cpu_sets %} - "{{ s }}": { - "set" : {{ ncir_cpu_sets[s] | sort }}, - "list": "{{ ncir_cpu_sets[s] | set_to_cpulist }}" - }{{ "," if not loop.last else "" }} -{% endfor %} -} diff --git a/roles/change_kernel_cmdline/tasks/main.yml b/roles/change_kernel_cmdline/tasks/main.yml index a514f16..63e8f40 100644 --- a/roles/change_kernel_cmdline/tasks/main.yml +++ b/roles/change_kernel_cmdline/tasks/main.yml @@ -18,7 +18,7 @@ - name: Get configuration. set_fact: perf_profile: "{{ performance_profiles[hosts[hostname]['performance_profiles'][0]] if 'performance_profiles' in hosts[hostname] else {} }}" - cpu_alloc: "{{ ansible_local.ncir_cpu_allocation | default([]) }}" + cpu_alloc: "{{ ansible_local.cloud_cpu_allocation | default([]) }}" - debug: var: perf_profile - debug: diff --git a/roles/logging/tasks/main.yml b/roles/logging/tasks/main.yml index c57be00..1015def 100644 --- a/roles/logging/tasks/main.yml +++ b/roles/logging/tasks/main.yml @@ -16,6 +16,3 @@ tags: - generate_log_forwarding_config -- include: restart_centralized_instance.yml - tags: - - restart_centralized_instance diff --git a/roles/logging/tasks/restart_centralized_instance.yml b/roles/logging/tasks/restart_centralized_instance.yml deleted file mode 100644 index ae29d0e..0000000 --- a/roles/logging/tasks/restart_centralized_instance.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2019 Nokia - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -- name: Restart the centralized rsyslogd to activate updated configuration - shell: /usr/local/bin/hascli -r -o /rsyslog-master - ignore_errors: yes diff --git a/roles/performance_nodes/tasks/ovsdpdk.yaml b/roles/performance_nodes/tasks/ovsdpdk.yaml index a72e76f..ae43c56 100644 --- a/roles/performance_nodes/tasks/ovsdpdk.yaml +++ b/roles/performance_nodes/tasks/ovsdpdk.yaml @@ -16,8 +16,8 @@ - debug: msg: - - "DPDK cores {{ ansible_local.ncir_cpu_allocation['ovs_dpdk']['list'] }}" - - "Platform cores {{ ansible_local.ncir_cpu_allocation['platform']['list'] }}" + - "DPDK cores {{ ansible_local.cloud_cpu_allocation['ovs_dpdk']['list'] }}" + - "Platform cores {{ ansible_local.cloud_cpu_allocation['platform']['list'] }}" - "Host VPUs {{ansible_processor_vcpus}}, Processor cores {{ansible_processor_cores}}" - "Threads per core {{ansible_processor_threads_per_core}}, Sockets {{ansible_processor_count}}" @@ -42,7 +42,7 @@ script: > configure_ovsdpdk.py --cores {{ansible_processor_vcpus}} --pcore {{ansible_processor_cores}} --tcore {{ansible_processor_threads_per_core}} --sockets {{ansible_processor_count}} - --dpdkcores {{ ansible_local.ncir_cpu_allocation['ovs_dpdk']['list'] }} + --dpdkcores {{ ansible_local.cloud_cpu_allocation['ovs_dpdk']['list'] }} register: result changed_when: result.rc == 0 failed_when: result.rc == 2 diff --git a/roles/performance_nodes_post/tasks/nova.yaml b/roles/performance_nodes_post/tasks/nova.yaml index e94bfcf..00258c1 100644 --- a/roles/performance_nodes_post/tasks/nova.yaml +++ b/roles/performance_nodes_post/tasks/nova.yaml @@ -15,7 +15,7 @@ # limitations under the License. - name: Set vcpu_pin_set - ini_file: dest=/etc/nova/nova.conf section=DEFAULT option=vcpu_pin_set value={{ ansible_local.ncir_cpu_allocation['vm']['list'] }} backup=no + ini_file: dest=/etc/nova/nova.conf section=DEFAULT option=vcpu_pin_set value={{ ansible_local.cloud_cpu_allocation['vm']['list'] }} backup=no register: nova1_result - name: Get performance profile configuration -- 2.16.6