From f17f82a0fc107bfd8298abacd0536895c9f52f06 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 16 Aug 2017 15:27:22 +0000 Subject: [PATCH] Improve configuration of IPA collectors and benchmarks Rather than specifying kernel command line arguments directly, configuration of IPA introspection data collectors and benchmarks is now possible by extending lists of collector (ipa_collect_extra) and benchmark (ipa_benchmark_extra) names. LLDP collection is now controlled via a flag, ipa_collect_lldp. Additional kernel arguments may be passed via ipa_kernel_options_extra. --- ansible/group_vars/all/inspector | 4 +-- ansible/group_vars/all/ipa | 52 ++++++++++++++++++++++++++------ etc/kayobe/ipa.yml | 35 +++++++++++++++++---- 3 files changed, 73 insertions(+), 18 deletions(-) diff --git a/ansible/group_vars/all/inspector b/ansible/group_vars/all/inspector index 6474f8e41..6c04a3c05 100644 --- a/ansible/group_vars/all/inspector +++ b/ansible/group_vars/all/inspector @@ -3,9 +3,7 @@ # Ironic inspector PXE configuration. # List of extra kernel parameters for the inspector default PXE configuration. -inspector_extra_kernel_options: > - {{ ipa_kernel_options_collect_lldp + - ipa_kernel_options_inspection_collectors_all }} +inspector_extra_kernel_options: "{{ ipa_kernel_options }}" # URL of Ironic Python Agent (IPA) kernel image. inspector_ipa_kernel_upstream_url: "{{ ipa_kernel_upstream_url }}" diff --git a/ansible/group_vars/all/ipa b/ansible/group_vars/all/ipa index d4513e435..05a266458 100644 --- a/ansible/group_vars/all/ipa +++ b/ansible/group_vars/all/ipa @@ -74,16 +74,50 @@ ipa_ramdisk_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/co ############################################################################### # Ironic Python Agent (IPA) deployment configuration. -# List of extra kernel parameters to enable LLDP collection. -ipa_kernel_options_collect_lldp: - - "ipa-collect-lldp=1" +# Whether to enable collection of LLDP TLVs. +ipa_collect_lldp: True -# List of extra kernel parameters to enable all inspector collectors. +# List of default inspection collectors to run. # NOTE: extra-hardware is not currently included as it requires a ramdisk # with the hardware python module installed. -ipa_kernel_options_inspection_collectors_all: - - "ipa-inspection-collectors=default,logs,pci-devices" +ipa_collectors_default: + - "default" + - "logs" + - "pci-devices" -# List of extra kernel parameters to enable all inspector benchmarks. -ipa_kernel_options_inspection_benchmarks_all: - - "ipa-inspection-benchmarks=cpu,disk,mem" +# List of additional inspection collectors to run. +ipa_collectors_extra: [] + +# List of inspection collectors to run. +ipa_collectors: > + {{ ipa_collectors_default + + ipa_collectors_extra }} + +# List of default inspection benchmarks to run. +ipa_benchmarks_default: + - "cpu" + - "disk" + - "mem" + +# List of extra inspection benchmarks to run. +ipa_benchmarks_extra: [] + +# List of inspection benchmarks to run. +ipa_benchmarks: > + {{ (ipa_benchmarks_default + + ipa_benchmarks_extra) + if 'extra-hardware' in ipa_collectors else [] }} + +# List of default kernel parameters for Ironic python agent. +ipa_kernel_options_default: > + {{ ['ipa-collect-lldp=' ~ '1' if ipa_collect_lldp else '0'] + + ['ipa-inspection-collectors=' ~ ipa_collectors | join(',')] + + ['ipa-inspection-benchmarks=' ~ ipa_benchmarks | join(',')] }} + +# List of additional kernel parameters for Ironic python agent. +ipa_kernel_options_extra: [] + +# List of kernel parameters for Ironic python agent. +ipa_kernel_options: > + {{ ipa_kernel_options_default + + ipa_kernel_options_extra }} diff --git a/etc/kayobe/ipa.yml b/etc/kayobe/ipa.yml index 176ae9836..3464ef288 100644 --- a/etc/kayobe/ipa.yml +++ b/etc/kayobe/ipa.yml @@ -65,14 +65,37 @@ ############################################################################### # Ironic Python Agent (IPA) deployment configuration. -# List of extra kernel parameters to enable LLDP collection. -#ipa_kernel_options_collect_lldp: +# Whether to enable collection of LLDP TLVs. +#ipa_collect_lldp: -# List of extra kernel parameters to enable all inspector collectors. -#ipa_kernel_options_inspection_collectors_all: +# List of default inspection collectors to run. +# NOTE: extra-hardware is not currently included as it requires a ramdisk +# with the hardware python module installed. +#ipa_collectors_default: -# List of extra kernel parameters to enable all inspector benchmarks. -#ipa_kernel_options_inspection_benchmarks_all: +# List of additional inspection collectors to run. +#ipa_collectors_extra: + +# List of inspection collectors to run. +#ipa_collectors: + +# List of default inspection benchmarks to run. +#ipa_benchmarks_default: + +# List of extra inspection benchmarks to run. +#ipa_benchmarks_extra: + +# List of inspection benchmarks to run. +#ipa_benchmarks: + +# List of default kernel parameters for Ironic python agent. +#ipa_kernel_options_default: + +# List of additional kernel parameters for Ironic python agent. +#ipa_kernel_options_extra: + +# List of kernel parameters for Ironic python agent. +#ipa_kernel_options: ############################################################################### # Dummy variable to allow Ansible to accept this file.