From 3e7cd134f8bcb1290108b70962af144d1dd5e299 Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Tue, 4 Jun 2019 17:38:41 +0200 Subject: [PATCH] Add parameter for `libvirt/num_pcie_ports` Add parameter `num_pcie_ports` to specify the number of PCIe ports an instance will get. Libvirt allows a custom number of PCIe ports (pcie-root-port controllers) a target instance will get. Some will be used by default, rest will be available for hotplug use. Change-Id: I16732c9d6013112381cfad999540dd41ec3d7ba3 --- manifests/compute/libvirt.pp | 9 +++++++++ .../notes/libvirt_num_pcie_ports-427923117bd13a65.yaml | 8 ++++++++ spec/classes/nova_compute_libvirt_spec.rb | 5 ++++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/libvirt_num_pcie_ports-427923117bd13a65.yaml diff --git a/manifests/compute/libvirt.pp b/manifests/compute/libvirt.pp index 4a7b34b9f..cb635083a 100644 --- a/manifests/compute/libvirt.pp +++ b/manifests/compute/libvirt.pp @@ -162,6 +162,13 @@ # nfs man page for details. # Defaults to $::os_service_default # +# [*num_pcie_ports*] +# (optional) The number of PCIe ports an instance will get. +# Libvirt allows a custom number of PCIe ports (pcie-root-port controllers) a +# target instance will get. Some will be used by default, rest will be available +# for hotplug use. +# Defaults to $::os_service_default +# class nova::compute::libvirt ( $ensure_package = 'present', $libvirt_virt_type = 'kvm', @@ -193,6 +200,7 @@ class nova::compute::libvirt ( $file_backed_memory = undef, $volume_use_multipath = $::os_service_default, $nfs_mount_options = $::os_service_default, + $num_pcie_ports = $::os_service_default, ) inherits nova::params { include ::nova::deps @@ -277,6 +285,7 @@ class nova::compute::libvirt ( 'libvirt/file_backed_memory': value => $file_backed_memory; 'libvirt/volume_use_multipath': value => $volume_use_multipath; 'libvirt/nfs_mount_options': value => $nfs_mount_options; + 'libvirt/num_pcie_ports': value => $num_pcie_ports; } # cpu_model param is only valid if cpu_mode=custom diff --git a/releasenotes/notes/libvirt_num_pcie_ports-427923117bd13a65.yaml b/releasenotes/notes/libvirt_num_pcie_ports-427923117bd13a65.yaml new file mode 100644 index 000000000..2cdf9c621 --- /dev/null +++ b/releasenotes/notes/libvirt_num_pcie_ports-427923117bd13a65.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Add parameter `num_pcie_ports` to specify the number of PCIe ports an + instance will get. + Libvirt allows a custom number of PCIe ports (pcie-root-port controllers) a + target instance will get. Some will be used by default, rest will be available + for hotplug use. diff --git a/spec/classes/nova_compute_libvirt_spec.rb b/spec/classes/nova_compute_libvirt_spec.rb index cc0f8ee51..38f012360 100644 --- a/spec/classes/nova_compute_libvirt_spec.rb +++ b/spec/classes/nova_compute_libvirt_spec.rb @@ -66,6 +66,7 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_nova_config('libvirt/tx_queue_size').with_value('')} it { is_expected.to contain_nova_config('libvirt/volume_use_multipath').with_value('')} it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_ensure('')} + it { is_expected.to contain_nova_config('libvirt/num_pcie_ports').with_ensure('')} end describe 'with params' do @@ -93,7 +94,8 @@ describe 'nova::compute::libvirt' do :rx_queue_size => 512, :tx_queue_size => 1024, :volume_use_multipath => false, - :nfs_mount_options => 'rw,intr,nolock' + :nfs_mount_options => 'rw,intr,nolock', + :num_pcie_ports => 16 } end @@ -121,6 +123,7 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_nova_config('libvirt/tx_queue_size').with_value(1024)} it { is_expected.to contain_nova_config('libvirt/volume_use_multipath').with_value(false)} it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_value('rw,intr,nolock')} + it { is_expected.to contain_nova_config('libvirt/num_pcie_ports').with_value(16)} it { is_expected.to contain_service('libvirt').with( :name => 'custom_service',