From 849ef266c764af13566ecde7495f3731c2863453 Mon Sep 17 00:00:00 2001 From: Arnaud Morin Date: Mon, 7 Oct 2019 11:58:19 +0200 Subject: [PATCH] C --- libvirt.pp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libvirt.pp b/libvirt.pp index 261b258..9ae8cd5 100644 --- a/libvirt.pp +++ b/libvirt.pp @@ -137,6 +137,16 @@ # https://libvirt.org/logging.html # Defaults to undef # +# [*rx_queue_size*] +# (optional) virtio-net rx queue size +# Valid values are 256, 512, 1024 +# Defaults to $::os_service_default +# +# [*tx_queue_size*] +# (optional) virtio-net tx queue size +# Valid values are 256, 512, 1024 +# Defaults to $::os_service_default +# class nova::compute::libvirt ( $ensure_package = 'present', $libvirt_virt_type = 'kvm', @@ -163,6 +173,8 @@ class nova::compute::libvirt ( $preallocate_images = $::os_service_default, $manage_libvirt_services = true, $log_outputs = undef, + $rx_queue_size = $::os_service_default, + $tx_queue_size = $::os_service_default, ) inherits nova::params { include ::nova::deps @@ -199,6 +211,14 @@ class nova::compute::libvirt ( } } + unless $rx_queue_size == $::os_service_default or $rx_queue_size in [256, 512, 1024] { + fail("Invalid rx_queue_size parameter: ${rx_queue_size}") + } + + unless $tx_queue_size == $::os_service_default or $tx_queue_size in [256, 512, 1024] { + fail("Invalid_tx_queue_size parameter: ${tx_queue_size}") + } + # manage_libvirt_services is here for backward compatibility to support # deployments that do not include nova::compute::libvirt::services # @@ -234,6 +254,8 @@ class nova::compute::libvirt ( 'libvirt/hw_disk_discard': value => $libvirt_hw_disk_discard; 'libvirt/hw_machine_type': value => $libvirt_hw_machine_type; 'libvirt/enabled_perf_events': value => join(any2array($libvirt_enabled_perf_events), ','); + 'libvirt/rx_queue_size': value => $rx_queue_size; + 'libvirt/tx_queue_size': value => $tx_queue_size; } # cpu_model param is only valid if cpu_mode=custom