Adds functionality to modudify the nfs clients mount options
Change-Id: I2d2934e36fbb5442607693c0c481c1d4c8f59cb0 Closes-Bug: #1803839
This commit is contained in:

committed by
Alex Schultz

parent
cb4c8f76ac
commit
9f12976e52
@@ -157,6 +157,11 @@
|
|||||||
# LibVirt as multipath devices.
|
# LibVirt as multipath devices.
|
||||||
# Defaults to $::os_service_default
|
# 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 (
|
class nova::compute::libvirt (
|
||||||
$ensure_package = 'present',
|
$ensure_package = 'present',
|
||||||
$libvirt_virt_type = 'kvm',
|
$libvirt_virt_type = 'kvm',
|
||||||
@@ -187,6 +192,7 @@ class nova::compute::libvirt (
|
|||||||
$tx_queue_size = $::os_service_default,
|
$tx_queue_size = $::os_service_default,
|
||||||
$file_backed_memory = undef,
|
$file_backed_memory = undef,
|
||||||
$volume_use_multipath = $::os_service_default,
|
$volume_use_multipath = $::os_service_default,
|
||||||
|
$nfs_mount_options = $::os_service_default,
|
||||||
) inherits nova::params {
|
) inherits nova::params {
|
||||||
|
|
||||||
include ::nova::deps
|
include ::nova::deps
|
||||||
@@ -270,6 +276,7 @@ class nova::compute::libvirt (
|
|||||||
'libvirt/tx_queue_size': value => $tx_queue_size;
|
'libvirt/tx_queue_size': value => $tx_queue_size;
|
||||||
'libvirt/file_backed_memory': value => $file_backed_memory;
|
'libvirt/file_backed_memory': value => $file_backed_memory;
|
||||||
'libvirt/volume_use_multipath': value => $volume_use_multipath;
|
'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
|
# 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>.
|
@@ -65,6 +65,7 @@ describe 'nova::compute::libvirt' do
|
|||||||
it { is_expected.to contain_nova_config('libvirt/rx_queue_size').with_value('<SERVICE DEFAULT>')}
|
it { is_expected.to contain_nova_config('libvirt/rx_queue_size').with_value('<SERVICE DEFAULT>')}
|
||||||
it { is_expected.to contain_nova_config('libvirt/tx_queue_size').with_value('<SERVICE DEFAULT>')}
|
it { is_expected.to contain_nova_config('libvirt/tx_queue_size').with_value('<SERVICE DEFAULT>')}
|
||||||
it { is_expected.to contain_nova_config('libvirt/volume_use_multipath').with_value('<SERVICE DEFAULT>')}
|
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
|
end
|
||||||
|
|
||||||
describe 'with params' do
|
describe 'with params' do
|
||||||
@@ -92,6 +93,7 @@ describe 'nova::compute::libvirt' do
|
|||||||
:rx_queue_size => 512,
|
:rx_queue_size => 512,
|
||||||
:tx_queue_size => 1024,
|
:tx_queue_size => 1024,
|
||||||
:volume_use_multipath => false,
|
:volume_use_multipath => false,
|
||||||
|
:nfs_mount_options => 'rw,intr,nolock'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -118,6 +120,7 @@ describe 'nova::compute::libvirt' do
|
|||||||
it { is_expected.to contain_nova_config('libvirt/rx_queue_size').with_value(512)}
|
it { is_expected.to contain_nova_config('libvirt/rx_queue_size').with_value(512)}
|
||||||
it { is_expected.to contain_nova_config('libvirt/tx_queue_size').with_value(1024)}
|
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/volume_use_multipath').with_value(false)}
|
||||||
|
it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_value('rw,intr,nolock')}
|
||||||
it {
|
it {
|
||||||
is_expected.to contain_service('libvirt').with(
|
is_expected.to contain_service('libvirt').with(
|
||||||
:name => 'custom_service',
|
:name => 'custom_service',
|
||||||
@@ -286,6 +289,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_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('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/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
|
end
|
||||||
|
|
||||||
describe 'with params' do
|
describe 'with params' do
|
||||||
@@ -295,7 +299,8 @@ describe 'nova::compute::libvirt' do
|
|||||||
:remove_unused_base_images => true,
|
:remove_unused_base_images => true,
|
||||||
:remove_unused_resized_minimum_age_seconds => 3600,
|
:remove_unused_resized_minimum_age_seconds => 3600,
|
||||||
:remove_unused_original_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
|
end
|
||||||
|
|
||||||
@@ -305,6 +310,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('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/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/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(
|
it { is_expected.to contain_package('libvirt').with(
|
||||||
:name => 'libvirt-daemon-kvm',
|
:name => 'libvirt-daemon-kvm',
|
||||||
:ensure => 'present'
|
:ensure => 'present'
|
||||||
|
Reference in New Issue
Block a user