Add `pmem_namespaces` parameter

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

Change-Id: I1789bd6afbdfb279f674b82cfb946698fa07248f
This commit is contained in:
Piotr Kopec 2020-03-17 08:19:45 +01:00
parent b77058f931
commit 4139563f1c
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
@ -332,6 +342,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

@ -71,6 +71,7 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_libvirtd_config('log_outputs').with_ensure('absent')}
it { is_expected.to contain_libvirtd_config('log_filters').with_ensure('absent')}
it { is_expected.to contain_libvirtd_config('tls_priority').with_ensure('absent')}
it { is_expected.to contain_libvirtd_config('pmem_namespaces').with_ensure('<SERVICE DEFAULT>')}
end
describe 'with params' do
@ -103,6 +104,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
@ -134,6 +136,7 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_nova_config('libvirt/mem_stats_period_seconds').with_value(20)}
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 { is_expected.to contain_libvirtd_config('pmem_namespaces').with_value("128G:ns0|ns1|ns2|ns3")}
it {
is_expected.to contain_service('libvirt').with(
:name => 'custom_service',