From 44d5d79394e29d783a7ef73ba742052d97fad124 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Thu, 10 Jun 2021 12:04:23 +0100 Subject: [ansible] Use collectd_config for virt and rdt Only one of virt and intel_rdt can be enabled at a time, and the existing checks are based on the existance of a {rdt,virt}.conf file to determine whether the other plugin is enabled. This check needed updating, and is now based on whether the other plugin is in the collectd_plugins value. Signed-off-by: Emma Foley Change-Id: I175d60111bf133965e1ecbf3764cb12a25356576 --- docker/ansible/roles/config_files/tasks/rdt.yml | 7 ++--- docker/ansible/roles/config_files/tasks/virt.yml | 16 +++++------ .../roles/config_files/templates/rdt.conf.j2 | 22 --------------- .../roles/config_files/templates/virt.conf.j2 | 32 ---------------------- docker/ansible/roles/config_files/vars/main.yml | 6 ++++ 5 files changed, 16 insertions(+), 67 deletions(-) delete mode 100644 docker/ansible/roles/config_files/templates/rdt.conf.j2 delete mode 100644 docker/ansible/roles/config_files/templates/virt.conf.j2 (limited to 'docker') diff --git a/docker/ansible/roles/config_files/tasks/rdt.yml b/docker/ansible/roles/config_files/tasks/rdt.yml index bad67b78..f0a46261 100644 --- a/docker/ansible/roles/config_files/tasks/rdt.yml +++ b/docker/ansible/roles/config_files/tasks/rdt.yml @@ -1,4 +1,4 @@ -#Copyright 2018 OPNFV and Intel Corporation +# Copyright 2018-21 Anuket, Intel Corporation and others # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,9 +29,8 @@ - rdt - name: enable rdt plugin - template: - src: rdt.conf.j2 - dest: "{{ config_file_dir }}/rdt.conf" + set_fact: + collectd_plugins: "{{ collectd_plugins | union(['intel_rdt']) | unique }}" when: (rdt_result is succeeded) and (virt_file.stat.exists == False) tags: - rdt diff --git a/docker/ansible/roles/config_files/tasks/virt.yml b/docker/ansible/roles/config_files/tasks/virt.yml index 7fb0bb92..75a17a18 100644 --- a/docker/ansible/roles/config_files/tasks/virt.yml +++ b/docker/ansible/roles/config_files/tasks/virt.yml @@ -1,4 +1,4 @@ -#Copyright 2018 OPNFV and Intel Corporation +# Copyright 2018-21 Anuket, Intel Corporation and others # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,16 +21,14 @@ - virt - name: (virt) check if rdt is enabled - stat: - path: "{{ config_file_dir }}/rdt.conf" - register: rdt_file + set_fact: + rdt_enabled: true tags: - - virt + - rdt - name: enable virt plugin - template: - src: virt.conf.j2 - dest: "{{ config_file_dir }}/virt.conf" - when: libvirt_result is succeeded and rdt_file.stat.exists == False + set_fact: + collectd_plugins: "{{ collectd_plugins | union(['virt']) | unique }}" + when: libvirt_result is succeeded and not (rdt_enabled | default(false)) tags: - virt diff --git a/docker/ansible/roles/config_files/templates/rdt.conf.j2 b/docker/ansible/roles/config_files/templates/rdt.conf.j2 deleted file mode 100644 index 0e1afcfc..00000000 --- a/docker/ansible/roles/config_files/templates/rdt.conf.j2 +++ /dev/null @@ -1,22 +0,0 @@ -#Copyright 2018 OPNFV and Intel Corporation -# -# 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. - - - Interval {{ rdt_interval }} - - - - Cores "" - - diff --git a/docker/ansible/roles/config_files/templates/virt.conf.j2 b/docker/ansible/roles/config_files/templates/virt.conf.j2 deleted file mode 100644 index f1ba324d..00000000 --- a/docker/ansible/roles/config_files/templates/virt.conf.j2 +++ /dev/null @@ -1,32 +0,0 @@ -#Copyright 2018 OPNFV and Intel Corporation -# -# 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. - -LoadPlugin virt - - -# Connection "xen:///" - RefreshInterval 60 -# Domain "name" -# BlockDevice "name:device" -# BlockDeviceFormat target -# BlockDeviceFormatBasename false -# InterfaceDevice "name:device" -# IgnoreSelected false -# HostnameFormat name -# InterfaceFormat name -# PluginInstanceFormat name -# Instances 1 - ExtraStats "cpu_util disk disk_err domain_state fs_info job_stats_background pcpu perf vcpupin" - - diff --git a/docker/ansible/roles/config_files/vars/main.yml b/docker/ansible/roles/config_files/vars/main.yml index 4e42791b..410e24ed 100644 --- a/docker/ansible/roles/config_files/vars/main.yml +++ b/docker/ansible/roles/config_files/vars/main.yml @@ -42,6 +42,9 @@ collectd_plugin_intel_pmu_report_kernel_pmu_events: True collectd_plugin_intel_pmu_report_software_events: True collectd_plugin_intel_pmu_cores: ["0-4"] +collectd_plugin_intel_rdt_cores: [""] +collectd_plugin_intel_rdt_interval: "{{ rdt_interval }}" + collectd_plugin_logfile_loglevel: "{{ logfile_log_level }}" collectd_plugin_logfile_file: "{{ logfile_dir }}/collectd.log" collectd_plugin_logfile_timestamp: True @@ -49,6 +52,9 @@ collectd_plugin_logfile_timestamp: True collectd_plugin_ovs_events_dispatch_values: True collectd_plugin_ovs_events_send_notification: True +collectd_plugin_virt_extra_stats: "cpu_util disk disk_err domain_state fs_info job_stats_background pcpu perf vcpupin" +collectd_plugin_virt_refresh_interval: 60 + collectd_plugin_write_kafka_hosts: - "{{ kafka_ip_addr }}:{{ kafka_port }}" collectd_plugin_write_kafka_topics: '{{ { kafka_topic: { "format": "JSON" }} }}' -- cgit 1.2.3-korg