diff --git a/manifests/compute/libvirt.pp b/manifests/compute/libvirt.pp index 77a729a5a..fb82f77d5 100644 --- a/manifests/compute/libvirt.pp +++ b/manifests/compute/libvirt.pp @@ -87,6 +87,17 @@ # which you may need to search key words ``VIR_PERF_PARAM_*`` # Defaults to $::os_service_default # +# [*device_detach_attempts*] +# (optional) Maximum number of attempts the driver tries to detach a device +# in libvirt. +# Defaults to $::os_service_default +# +# [*device_detach_timeout*] +# (optional) Maximum number of seconds the driver waits for the success or +# the failure event from libvirt for a given device detach attempt before +# it re-trigger the detach. +# Defaults to $::os_service_default +# # [*libvirt_service_name*] # (optional) libvirt service name. # Defaults to $::nova::params::libvirt_service_name @@ -232,6 +243,8 @@ class nova::compute::libvirt ( $inject_key = false, $inject_partition = -2, $enabled_perf_events = $::os_service_default, + $device_detach_attempts = $::os_service_default, + $device_detach_timeout = $::os_service_default, $libvirt_service_name = $::nova::params::libvirt_service_name, $virtlock_service_name = $::nova::params::virtlock_service_name, $virtlog_service_name = $::nova::params::virtlog_service_name, @@ -396,6 +409,8 @@ class nova::compute::libvirt ( 'libvirt/hw_disk_discard': value => $hw_disk_discard; 'libvirt/hw_machine_type': value => $hw_machine_type; 'libvirt/enabled_perf_events': value => join(any2array($enabled_perf_events), ','); + 'libvirt/device_detach_attempts': value => $device_detach_attempts; + 'libvirt/device_detach_timeout': value => $device_detach_timeout; 'libvirt/rx_queue_size': value => $rx_queue_size; 'libvirt/tx_queue_size': value => $tx_queue_size; 'libvirt/file_backed_memory': value => $file_backed_memory; diff --git a/releasenotes/notes/libvirt-device_detach-4873688e044e1aaf.yaml b/releasenotes/notes/libvirt-device_detach-4873688e044e1aaf.yaml new file mode 100644 index 000000000..62e9a0e64 --- /dev/null +++ b/releasenotes/notes/libvirt-device_detach-4873688e044e1aaf.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Now the ``nova::compute::libvirt`` class supports the following two + parameters. + + - ``device_detach_attempts`` + - ``device_detach_timeout`` diff --git a/spec/classes/nova_compute_libvirt_spec.rb b/spec/classes/nova_compute_libvirt_spec.rb index 6f0decbd0..fd4761ba5 100644 --- a/spec/classes/nova_compute_libvirt_spec.rb +++ b/spec/classes/nova_compute_libvirt_spec.rb @@ -57,6 +57,9 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_nova_config('libvirt/inject_password').with_value(false)} it { is_expected.to contain_nova_config('libvirt/inject_key').with_value(false)} it { is_expected.to contain_nova_config('libvirt/inject_partition').with_value(-2)} + it { is_expected.to contain_nova_config('libvirt/enabled_perf_events').with_value('')} + it { is_expected.to contain_nova_config('libvirt/device_detach_attempts').with_value('')} + it { is_expected.to contain_nova_config('libvirt/device_detach_timeout').with_value('')} it { is_expected.to contain_nova_config('vnc/server_listen').with_value('127.0.0.1')} it { is_expected.to contain_nova_config('libvirt/rx_queue_size').with_value('')} it { is_expected.to contain_nova_config('libvirt/tx_queue_size').with_value('')} @@ -90,6 +93,8 @@ describe 'nova::compute::libvirt' do :hw_disk_discard => 'unmap', :hw_machine_type => 'x86_64=machinetype1,armv7l=machinetype2', :enabled_perf_events => ['cmt', 'mbml', 'mbmt'], + :device_detach_attempts => 8, + :device_detach_timeout => 20, :libvirt_service_name => 'custom_service', :virtlock_service_name => 'virtlock', :virtlog_service_name => 'virtlog', @@ -131,6 +136,8 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_nova_config('libvirt/hw_disk_discard').with_value('unmap')} it { is_expected.to contain_nova_config('libvirt/hw_machine_type').with_value('x86_64=machinetype1,armv7l=machinetype2')} it { is_expected.to contain_nova_config('libvirt/enabled_perf_events').with_value('cmt,mbml,mbmt')} + it { is_expected.to contain_nova_config('libvirt/device_detach_attempts').with_value(8)} + it { is_expected.to contain_nova_config('libvirt/device_detach_timeout').with_value(20)} it { is_expected.to contain_nova_config('vnc/server_listen').with_value('0.0.0.0')} 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)} @@ -273,6 +280,9 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_nova_config('libvirt/inject_key').with_value(false)} it { is_expected.to contain_nova_config('libvirt/inject_partition').with_value(-2)} it { is_expected.to contain_nova_config('vnc/server_listen').with_value('127.0.0.1')} + it { is_expected.to contain_nova_config('libvirt/enabled_perf_events').with_value('')} + it { is_expected.to contain_nova_config('libvirt/device_detach_attempts').with_value('')} + it { is_expected.to contain_nova_config('libvirt/device_detach_timeout').with_value('')} it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_value('')} end @@ -281,6 +291,8 @@ describe 'nova::compute::libvirt' do { :virt_type => 'qemu', :vncserver_listen => '0.0.0.0', :enabled_perf_events => ['cmt', 'mbml', 'mbmt'], + :device_detach_attempts => 8, + :device_detach_timeout => 20, :nfs_mount_options => 'rw,intr,nolock', :mem_stats_period_seconds => 20, } @@ -289,6 +301,8 @@ describe 'nova::compute::libvirt' do it { is_expected.to contain_nova_config('libvirt/virt_type').with_value('qemu')} it { is_expected.to contain_nova_config('vnc/server_listen').with_value('0.0.0.0')} it { is_expected.to contain_nova_config('libvirt/enabled_perf_events').with_value('cmt,mbml,mbmt')} + it { is_expected.to contain_nova_config('libvirt/device_detach_attempts').with_value(8)} + it { is_expected.to contain_nova_config('libvirt/device_detach_timeout').with_value(20)} it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_value('rw,intr,nolock')} it { is_expected.to contain_nova_config('libvirt/mem_stats_period_seconds').with_value(20)} it { is_expected.to contain_package('libvirt').with(