Adds functionality to modudify the nfs clients mount options
Change-Id: I2d2934e36fbb5442607693c0c481c1d4c8f59cb0 Closes-Bug: #1803839 (cherry picked from commit9f12976e52
) (cherry picked from commitf30766c327
) (cherry picked from commitbad938fcae
)
This commit is contained in:
parent
cc137c90a5
commit
bb9517e5e8
|
@ -143,6 +143,11 @@
|
|||
# LibVirt as multipath devices.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*nfs_mount_options*]
|
||||
# (optional) Mount options passed to the NFS client. See section of the
|
||||
# nfs man page for details.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
class nova::compute::libvirt (
|
||||
$ensure_package = 'present',
|
||||
$libvirt_virt_type = 'kvm',
|
||||
|
@ -170,6 +175,7 @@ class nova::compute::libvirt (
|
|||
$manage_libvirt_services = true,
|
||||
$log_outputs = undef,
|
||||
$volume_use_multipath = $::os_service_default,
|
||||
$nfs_mount_options = $::os_service_default,
|
||||
) inherits nova::params {
|
||||
|
||||
include ::nova::deps
|
||||
|
@ -242,6 +248,7 @@ class nova::compute::libvirt (
|
|||
'libvirt/hw_machine_type': value => $libvirt_hw_machine_type;
|
||||
'libvirt/enabled_perf_events': value => join(any2array($libvirt_enabled_perf_events), ',');
|
||||
'libvirt/volume_use_multipath': value => $volume_use_multipath;
|
||||
'libvirt/nfs_mount_options': value => $nfs_mount_options;
|
||||
}
|
||||
|
||||
# cpu_model param is only valid if cpu_mode=custom
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The libvirt driver allows passing different mount options to the
|
||||
nfs client.
|
||||
``[libvirt]/nfs_mount_options``, defaulting to <None>.
|
|
@ -61,6 +61,7 @@ describe 'nova::compute::libvirt' do
|
|||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/volume_use_multipath').with_value('<SERVICE DEFAULT>')}
|
||||
it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_ensure('<SERVICE DEFAULT>')}
|
||||
end
|
||||
|
||||
describe 'with params' do
|
||||
|
@ -86,6 +87,7 @@ describe 'nova::compute::libvirt' do
|
|||
:preallocate_images => 'space',
|
||||
:log_outputs => '1:file:/var/log/libvirt/libvirtd.log',
|
||||
:volume_use_multipath => false,
|
||||
:nfs_mount_options => 'rw,intr,nolock'
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -110,6 +112,7 @@ describe 'nova::compute::libvirt' do
|
|||
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
|
||||
it { is_expected.to contain_libvirtd_config('log_outputs').with_value("\"#{params[:log_outputs]}\"")}
|
||||
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_service('libvirt').with(
|
||||
:name => 'custom_service',
|
||||
|
@ -278,6 +281,7 @@ describe 'nova::compute::libvirt' do
|
|||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_ensure('<SERVICE DEFAULT>')}
|
||||
end
|
||||
|
||||
describe 'with params' do
|
||||
|
@ -287,7 +291,8 @@ describe 'nova::compute::libvirt' do
|
|||
:remove_unused_base_images => true,
|
||||
:remove_unused_resized_minimum_age_seconds => 3600,
|
||||
:remove_unused_original_minimum_age_seconds => 3600,
|
||||
:libvirt_enabled_perf_events => ['cmt', 'mbml', 'mbmt']
|
||||
:libvirt_enabled_perf_events => ['cmt', 'mbml', 'mbmt'],
|
||||
:nfs_mount_options => 'rw,intr,nolock'
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -297,6 +302,7 @@ describe 'nova::compute::libvirt' do
|
|||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
|
||||
it { is_expected.to contain_nova_config('libvirt/enabled_perf_events').with_value('cmt,mbml,mbmt')}
|
||||
it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_value('rw,intr,nolock')}
|
||||
it { is_expected.to contain_package('libvirt').with(
|
||||
:name => 'libvirt-daemon-kvm',
|
||||
:ensure => 'present'
|
||||
|
|
Loading…
Reference in New Issue