Add `pmem_namespaces` parameter

This change adds parameter `libvirt/pmem_namespaces` that
configure persistent memory(pmem) namespaces for Nova.

Conflicts:
      spec/classes/nova_compute_libvirt_spec.rb

Resolved conflict which occured due to change
If5155db8635ad73ea1900a0143367802b9b159e8

Change-Id: I1789bd6afbdfb279f674b82cfb946698fa07248f
(cherry picked from commit 4139563f1c)
This commit is contained in:
Piotr Kopec 2020-03-17 08:19:45 +01:00 committed by Rajesh Tailor
parent 9491198804
commit 9629db4c97
3 changed files with 19 additions and 0 deletions

View File

@ -187,6 +187,15 @@
# the global default settings.
# Defaults to undef
#
# [*pmem_namespaces*]
# (optional) Configure persistent memory(pmem) namespaces. These namespaces
# must have been already created on the host. This config option is in the
# following format: "$LABEL:$NSNAME[|$NSNAME][,$LABEL:$NSNAME[|$NSNAME]]"
# $NSNAME is the name of the pmem namespace. $LABEL represents one resource
# class, this is used to generate the resource class name as
# CUSTOM_PMEM_NAMESPACE_$LABEL.
# Defaults to $::os_service_default
class nova::compute::libvirt (
$ensure_package = 'present',
$libvirt_virt_type = 'kvm',
@ -222,6 +231,7 @@ class nova::compute::libvirt (
$mem_stats_period_seconds = $::os_service_default,
$log_filters = undef,
$tls_priority = undef,
$pmem_namespaces = $::os_service_default,
) inherits nova::params {
include ::nova::deps
@ -320,6 +330,7 @@ class nova::compute::libvirt (
'libvirt/nfs_mount_options': value => $nfs_mount_options;
'libvirt/num_pcie_ports': value => $num_pcie_ports;
'libvirt/mem_stats_period_seconds': value => $mem_stats_period_seconds;
'libvirt/pmem_namespaces': value => $pmem_namespaces;
}
# cpu_model param is only valid if cpu_mode=custom

View File

@ -0,0 +1,5 @@
---
features:
- |
Add support for managing configuration for persistent memory(pmem)
namespaces.

View File

@ -66,6 +66,7 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_nova_config('libvirt/num_pcie_ports').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_nova_config('libvirt/mem_stats_period_seconds').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_nova_config('libvirt/pmem_namespaces').with_value('<SERVICE DEFAULT>')}
it { is_expected.to_not contain_libvirtd_config('log_outputs')}
it { is_expected.to_not contain_libvirtd_config('log_filters')}
it { is_expected.to_not contain_libvirtd_config('tls_priority')}
@ -101,6 +102,7 @@ describe 'nova::compute::libvirt' do
:mem_stats_period_seconds => 20,
:log_filters => '1:qemu',
:tls_priority => 'NORMAL:-VERS-SSL3.0',
:pmem_namespaces => '128G:ns0|ns1|ns2|ns3'
}
end
@ -130,6 +132,7 @@ describe 'nova::compute::libvirt' do
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_nova_config('libvirt/mem_stats_period_seconds').with_value(20)}
it { is_expected.to contain_nova_config('libvirt/pmem_namespaces').with_value("128G:ns0|ns1|ns2|ns3")}
it { is_expected.to contain_libvirtd_config('log_filters').with_value("\"#{params[:log_filters]}\"")}
it { is_expected.to contain_libvirtd_config('tls_priority').with_value("\"#{params[:tls_priority]}\"")}
it {