diff --git a/manifests/compute/libvirt.pp b/manifests/compute/libvirt.pp index caf8353fc..f8f653650 100644 --- a/manifests/compute/libvirt.pp +++ b/manifests/compute/libvirt.pp @@ -63,6 +63,14 @@ # number (integer value) # Defaults to -2 # +# [*libvirt_enabled_perf_events*] +# (optional) This is a performance event list which could be used as monitor. +# A string list. For example: ``enabled_perf_events = cmt, mbml, mbmt`` +# The supported events list can be found in +# https://libvirt.org/html/libvirt-libvirt-domain.html , +# which you may need to search key words ``VIR_PERF_PARAM_*`` +# Defaults to $::os_service_default +# # [*remove_unused_base_images*] # (optional) Should unused base images be removed? # If undef is specified, remove the line in nova.conf @@ -126,6 +134,7 @@ class nova::compute::libvirt ( $libvirt_inject_password = false, $libvirt_inject_key = false, $libvirt_inject_partition = -2, + $libvirt_enabled_perf_events = $::os_service_default, $remove_unused_base_images = undef, $remove_unused_resized_minimum_age_seconds = undef, $remove_unused_original_minimum_age_seconds = undef, @@ -192,16 +201,17 @@ class nova::compute::libvirt ( } nova_config { - 'DEFAULT/compute_driver': value => $compute_driver; - 'DEFAULT/preallocate_images': value => $preallocate_images; - 'vnc/vncserver_listen': value => $vncserver_listen; - 'libvirt/virt_type': value => $libvirt_virt_type; - 'libvirt/cpu_mode': value => $libvirt_cpu_mode_real; - 'libvirt/inject_password': value => $libvirt_inject_password; - 'libvirt/inject_key': value => $libvirt_inject_key; - 'libvirt/inject_partition': value => $libvirt_inject_partition; - 'libvirt/hw_disk_discard': value => $libvirt_hw_disk_discard; - 'libvirt/hw_machine_type': value => $libvirt_hw_machine_type; + 'DEFAULT/compute_driver': value => $compute_driver; + 'DEFAULT/preallocate_images': value => $preallocate_images; + 'vnc/vncserver_listen': value => $vncserver_listen; + 'libvirt/virt_type': value => $libvirt_virt_type; + 'libvirt/cpu_mode': value => $libvirt_cpu_mode_real; + 'libvirt/inject_password': value => $libvirt_inject_password; + 'libvirt/inject_key': value => $libvirt_inject_key; + 'libvirt/inject_partition': value => $libvirt_inject_partition; + 'libvirt/hw_disk_discard': value => $libvirt_hw_disk_discard; + 'libvirt/hw_machine_type': value => $libvirt_hw_machine_type; + 'libvirt/enabled_perf_events': value => $libvirt_enabled_perf_events; } # cpu_model param is only valid if cpu_mode=custom diff --git a/releasenotes/notes/enable_perf_events-448c7c10e8965286.yaml b/releasenotes/notes/enable_perf_events-448c7c10e8965286.yaml new file mode 100644 index 000000000..a081f1d1c --- /dev/null +++ b/releasenotes/notes/enable_perf_events-448c7c10e8965286.yaml @@ -0,0 +1,5 @@ +--- +features: + - Expose enabled_perf_events option so it can be set in + libvirt nova config. This is required for cache + monitoring technologu feature to work end to end. diff --git a/spec/classes/nova_compute_libvirt_spec.rb b/spec/classes/nova_compute_libvirt_spec.rb index 3b18bd780..7150488cd 100644 --- a/spec/classes/nova_compute_libvirt_spec.rb +++ b/spec/classes/nova_compute_libvirt_spec.rb @@ -70,6 +70,7 @@ describe 'nova::compute::libvirt' do :libvirt_disk_cachemodes => ['file=directsync','block=none'], :libvirt_hw_disk_discard => 'unmap', :libvirt_hw_machine_type => 'x86_64=machinetype1,armv7l=machinetype2', + :libvirt_enabled_perf_events => ['cmt', 'mbml', 'mbmt'], :remove_unused_base_images => true, :remove_unused_resized_minimum_age_seconds => 3600, :remove_unused_original_minimum_age_seconds => 3600, @@ -93,6 +94,7 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_nova_config('libvirt/disk_cachemodes').with_value('file=directsync,block=none')} it { is_expected.to contain_nova_config('libvirt/hw_disk_discard').with_value('unmap')} it { is_expected.to contain_nova_config('libvirt/hw_machine_type').with_value('x86_64=machinetype1,armv7l=machinetype2')} + it { is_expected.to contain_nova_config('libvirt/enabled_perf_events').with_value('cmt,mbml,mbmt')} it { is_expected.to contain_nova_config('vnc/vncserver_listen').with_value('0.0.0.0')} it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_value(true)} it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}