From 1d300eeb8b14c11275a52c7330c3b72626281cdc Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Fri, 19 Sep 2014 09:57:03 -0400 Subject: [PATCH] Allow to manage or not TSO issue We need to allow some flexibility with TSO issue and allow the end-user to disable the management of TSO. Since TSO issue only affects GRE tunnels, when running VXLAN we should be able to not manage TSO issue. So let's add a new parameter to manage or not this feature. Why not using facter to detect the kernel & using neutron flags to detect the tunneling mode? Because we want to be sure that we have a real flexibility and allow end-user to use a specific kernel (with a fix or not) and make the choice to enable or not TSO/GSO. --- manifests/compute/hypervisor.pp | 42 +++++++++++-------- manifests/network/l3.pp | 33 ++++++++------- spec/classes/cloud_compute_hypervisor_spec.rb | 12 ++++++ spec/classes/cloud_network_l3_spec.rb | 12 ++++++ 4 files changed, 66 insertions(+), 33 deletions(-) diff --git a/manifests/compute/hypervisor.pp b/manifests/compute/hypervisor.pp index eda64707..5b81a57d 100644 --- a/manifests/compute/hypervisor.pp +++ b/manifests/compute/hypervisor.pp @@ -19,16 +19,20 @@ # # === Parameters: # -# [*vm_rbd] +# [*vm_rbd*] # (optional) Enable or not ceph capabilities on compute node to store # nova instances on ceph storage. # Default to false. # -# [*volume_rbd] +# [*volume_rbd*] # (optional) Enable or not ceph capabilities on compute node to attach # cinder volumes backend by ceph on nova instances. # Default to false. # +# [*manage_tso*] +# (optional) Allow to manage or not TSO issue. +# Default to true. +# class cloud::compute::hypervisor( $server_proxyclient_address = '127.0.0.1', @@ -43,6 +47,7 @@ class cloud::compute::hypervisor( $nova_rbd_secret_uuid = undef, $vm_rbd = false, $volume_rbd = false, + $manage_tso = true, # set to false to keep backward compatibility $ks_spice_public_proto = false, $ks_spice_public_host = false, @@ -144,25 +149,26 @@ Host * } # Disabling TSO/GSO/GRO - if $::osfamily == 'Debian' { - ensure_resource ('exec','enable-tso-script', { - 'command' => '/usr/sbin/update-rc.d disable-tso defaults', - 'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', - 'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso' - }) - } elsif $::osfamily == 'RedHat' { - ensure_resource ('exec','enable-tso-script', { - 'command' => '/usr/sbin/chkconfig disable-tso on', - 'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', + if $manage_tso { + if $::osfamily == 'Debian' { + ensure_resource ('exec','enable-tso-script', { + 'command' => '/usr/sbin/update-rc.d disable-tso defaults', + 'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', + 'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso' + }) + } elsif $::osfamily == 'RedHat' { + ensure_resource ('exec','enable-tso-script', { + 'command' => '/usr/sbin/chkconfig disable-tso on', + 'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', + 'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso' + }) + } + ensure_resource ('exec','start-tso-script', { + 'command' => '/etc/init.d/disable-tso start', + 'unless' => '/usr/bin/test -f /tmp/disable-tso-lock', 'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso' }) } - ensure_resource ('exec','start-tso-script', { - 'command' => '/etc/init.d/disable-tso start', - 'unless' => '/usr/bin/test -f /tmp/disable-tso-lock', - 'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso' - }) - if $::operatingsystem == 'Ubuntu' { service { 'dbus': diff --git a/manifests/network/l3.pp b/manifests/network/l3.pp index c81d9645..2c2226ff 100644 --- a/manifests/network/l3.pp +++ b/manifests/network/l3.pp @@ -20,6 +20,7 @@ class cloud::network::l3( $external_int = 'eth1', $ext_provider_net = false, $debug = true, + $manage_tso = true, ) { include 'cloud::network' @@ -47,23 +48,25 @@ class cloud::network::l3( } # Disabling TSO/GSO/GRO - if $::osfamily == 'Debian' { - ensure_resource ('exec','enable-tso-script', { - 'command' => '/usr/sbin/update-rc.d disable-tso defaults', - 'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', - 'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso' - }) - } elsif $::osfamily == 'RedHat' { - ensure_resource ('exec','enable-tso-script', { - 'command' => '/usr/sbin/chkconfig disable-tso on', - 'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', + if $manage_tso { + if $::osfamily == 'Debian' { + ensure_resource ('exec','enable-tso-script', { + 'command' => '/usr/sbin/update-rc.d disable-tso defaults', + 'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', + 'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso' + }) + } elsif $::osfamily == 'RedHat' { + ensure_resource ('exec','enable-tso-script', { + 'command' => '/usr/sbin/chkconfig disable-tso on', + 'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', + 'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso' + }) + } + ensure_resource ('exec','start-tso-script', { + 'command' => '/etc/init.d/disable-tso start', + 'unless' => '/usr/bin/test -f /tmp/disable-tso-lock', 'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso' }) } - ensure_resource ('exec','start-tso-script', { - 'command' => '/etc/init.d/disable-tso start', - 'unless' => '/usr/bin/test -f /tmp/disable-tso-lock', - 'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso' - }) } diff --git a/spec/classes/cloud_compute_hypervisor_spec.rb b/spec/classes/cloud_compute_hypervisor_spec.rb index d217bb61..17f6c5ed 100644 --- a/spec/classes/cloud_compute_hypervisor_spec.rb +++ b/spec/classes/cloud_compute_hypervisor_spec.rb @@ -316,6 +316,18 @@ describe 'cloud::compute::hypervisor' do end end + context 'when not managing TSO/GSO/GRO' do + before :each do + params.merge!( :manage_tso => false) + end + it 'ensure TSO script is not managed at boot' do + should_not contain_exec('enable-tso-script') + end + it 'do not start TSO script' do + should_not contain_exec('start-tso-script') + end + end + context 'with RBD backend for instances and volumes on Debian plaforms' do before :each do facts.merge!( :osfamily => 'Debian', diff --git a/spec/classes/cloud_network_l3_spec.rb b/spec/classes/cloud_network_l3_spec.rb index adc2a52b..3617cd5b 100644 --- a/spec/classes/cloud_network_l3_spec.rb +++ b/spec/classes/cloud_network_l3_spec.rb @@ -193,6 +193,18 @@ describe 'cloud::network::l3' do ) end end + + context 'when not managing TSO/GSO/GRO' do + before :each do + params.merge!( :manage_tso => false) + end + it 'ensure TSO script is not enabled at boot' do + should_not contain_exec('enable-tso-script') + end + it 'do not start TSO script' do + should_not contain_exec('start-tso-script') + end + end end context 'on Debian platforms' do