Merge pull request #610 from enovance/tso-controllers

Allow to disable TSO on L3 agent nodes
This commit is contained in:
Yanis Guenane 2014-09-11 15:06:41 -04:00
commit 6bde7a39c3
4 changed files with 62 additions and 20 deletions

View File

@ -29,11 +29,6 @@
# cinder volumes backend by ceph on nova instances. # cinder volumes backend by ceph on nova instances.
# Default to false. # Default to false.
# #
# [*manage_tso]
# (optional) Enable or not TSO/GSO/GRO/UFO on neutron interfaces.
# Should be at True when running linux kernel 3.14.
# Default to true.
#
class cloud::compute::hypervisor( class cloud::compute::hypervisor(
$server_proxyclient_address = '127.0.0.1', $server_proxyclient_address = '127.0.0.1',
@ -48,7 +43,6 @@ class cloud::compute::hypervisor(
$nova_rbd_secret_uuid = undef, $nova_rbd_secret_uuid = undef,
$vm_rbd = false, $vm_rbd = false,
$volume_rbd = false, $volume_rbd = false,
$manage_tso = true,
# set to false to keep backward compatibility # set to false to keep backward compatibility
$ks_spice_public_proto = false, $ks_spice_public_proto = false,
$ks_spice_public_host = false, $ks_spice_public_host = false,
@ -130,7 +124,7 @@ Host *
} }
if $::operatingsystem == 'RedHat' { if $::osfamily == 'RedHat' {
file { '/etc/libvirt/qemu.conf': file { '/etc/libvirt/qemu.conf':
ensure => file, ensure => file,
source => 'puppet:///modules/cloud/qemu/qemu.conf', source => 'puppet:///modules/cloud/qemu/qemu.conf',
@ -145,7 +139,7 @@ Host *
} }
} else { } else {
# Disabling or not TSO/GSO/GRO on Debian systems # Disabling or not TSO/GSO/GRO on Debian systems
if $manage_tso { if $::kernelmajversion >= '3.14' {
ensure_resource ('exec','enable-tso-script', { ensure_resource ('exec','enable-tso-script', {
'command' => '/usr/sbin/update-rc.d disable-tso defaults', 'command' => '/usr/sbin/update-rc.d disable-tso defaults',
'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', 'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',

View File

@ -46,4 +46,18 @@ class cloud::network::l3(
debug => $debug, debug => $debug,
} }
# Disabling or not TSO/GSO/GRO on Debian systems
if $::osfamily == 'Debian' and $::kernelmajversion >= '3.14' {
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' => 'test -f /etc/init.d/disable-tso'
})
ensure_resource ('exec','start-tso-script', {
'command' => '/etc/init.d/disable-tso start',
'unless' => 'test -f /tmp/disable-tso-lock',
'onlyif' => 'test -f /etc/init.d/disable-tso'
})
}
} }

View File

@ -83,7 +83,6 @@ describe 'cloud::compute::hypervisor' do
:ks_spice_public_host => '10.0.0.2', :ks_spice_public_host => '10.0.0.2',
:vm_rbd => false, :vm_rbd => false,
:volume_rbd => false, :volume_rbd => false,
:manage_tso => true,
:ks_nova_public_host => '10.0.0.1' } :ks_nova_public_host => '10.0.0.1' }
end end
@ -272,13 +271,12 @@ describe 'cloud::compute::hypervisor' do
end end
context 'without TSO/GSO/GRO on Debian systems' do context 'without TSO/GSO/GRO on Debian systems' do
let :facts do before :each do
{ :osfamily => 'Debian', facts.merge!( :osfamily => 'Debian',
:operatingsystem => 'Debian', :operatingsystem => 'Debian',
:concat_basedir => '/var/lib/puppet/concat' :kernelmajversion => '3.14',
} :concat_basedir => '/var/lib/puppet/concat' )
end end
it 'ensure TSO script is enabled at boot' do it 'ensure TSO script is enabled at boot' do
should contain_exec('enable-tso-script').with( should contain_exec('enable-tso-script').with(
:command => '/usr/sbin/update-rc.d disable-tso defaults', :command => '/usr/sbin/update-rc.d disable-tso defaults',
@ -295,10 +293,10 @@ describe 'cloud::compute::hypervisor' do
end end
end end
context 'with TSO/GSO/GRO on Debian systems' do context 'ensure TSO/GSO/GRO is not managed on Debian systems with kernel < 3.14' do
before :each do before :each do
facts.merge!( :osfamily => 'Debian' ) facts.merge!( :osfamily => 'Debian',
params.merge!( :manage_tso => false ) :kernelmajversion => '3.12' )
end end
it 'ensure TSO script is not enabled at boot' do it 'ensure TSO script is not enabled at boot' do
@ -410,7 +408,7 @@ describe 'cloud::compute::hypervisor' do
context 'when trying to enable RBD backend on RedHat plaforms' do context 'when trying to enable RBD backend on RedHat plaforms' do
before :each do before :each do
facts.merge!( :operatingsystem => 'RedHat' ) facts.merge!( :osfamily => 'RedHat' )
params.merge!( params.merge!(
:vm_rbd => true, :vm_rbd => true,
:cinder_rbd_user => 'cinder', :cinder_rbd_user => 'cinder',
@ -422,7 +420,7 @@ describe 'cloud::compute::hypervisor' do
context 'when trying to enable RBD backend with deprecated parameter on RedHat plaforms' do context 'when trying to enable RBD backend with deprecated parameter on RedHat plaforms' do
before :each do before :each do
facts.merge!( :operatingsystem => 'RedHat' ) facts.merge!( :osfamily => 'RedHat' )
params.merge!( params.merge!(
:has_ceph => true, :has_ceph => true,
:cinder_rbd_user => 'cinder', :cinder_rbd_user => 'cinder',

View File

@ -151,6 +151,42 @@ describe 'cloud::network::l3' do
should_not contain__neutron_network('public') should_not contain__neutron_network('public')
end end
end end
context 'without TSO/GSO/GRO on Debian systems with 3.14 kernel' do
before :each do
facts.merge!( :osfamily => 'Debian',
:kernelmajversion => '3.14' )
end
it 'ensure TSO script is enabled at boot' do
should contain_exec('enable-tso-script').with(
:command => '/usr/sbin/update-rc.d disable-tso defaults',
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
:onlyif => 'test -f /etc/init.d/disable-tso'
)
end
it 'start TSO script' do
should contain_exec('start-tso-script').with(
:command => '/etc/init.d/disable-tso start',
:unless => 'test -f /tmp/disable-tso-lock',
:onlyif => 'test -f /etc/init.d/disable-tso'
)
end
end
context 'ensure TSO/GSO/GRO is not managed on Debian systems with kernel < 3.14' do
before :each do
facts.merge!( :osfamily => 'Debian',
:kernelmajversion => '3.12' )
end
it 'ensure TSO script is not enabled at boot' do
should_not contain_exec('enable-tso-script')
end
it 'do no tstart TSO script' do
should_not contain_exec('start-tso-script')
end
end
end end
context 'on Debian platforms' do context 'on Debian platforms' do