L3 schedulers support

Icehouse brings new schedulers for virtual routing.
This patch aims to:
- add router_scheduler_driver flag support
- document which schedulers we could use

Change-Id: I9ed4464201e1b888ae7474221babe8e5aad38642
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi 2013-12-25 00:46:23 +01:00
parent d2f8d89f6e
commit a57669a9dc
2 changed files with 60 additions and 50 deletions
manifests
spec/classes

@ -98,32 +98,39 @@
# agent_down_time, best if it is half or less than agent_down_time.
# Defaults to: 4
#
# [*router_scheduler_driver*]
# (optional) Driver to use for scheduling router to a default L3 agent. Could be:
# neutron.scheduler.l3_agent_scheduler.ChanceScheduler to schedule a router in a random way
# neutron.scheduler.l3_agent_scheduler.LeastRoutersScheduler to allocate on an L3 agent with the least number of routers bound.
# Defaults to: neutron.scheduler.l3_agent_scheduler.ChanceScheduler
#
class neutron::server (
$package_ensure = 'present',
$enabled = true,
$auth_password = false,
$auth_type = 'keystone',
$auth_host = 'localhost',
$auth_port = '35357',
$auth_admin_prefix = false,
$auth_tenant = 'services',
$auth_user = 'neutron',
$auth_protocol = 'http',
$auth_uri = false,
$sql_connection = false,
$connection = 'sqlite:////var/lib/neutron/ovs.sqlite',
$max_retries = '10',
$sql_max_retries = '10',
$sql_idle_timeout = '3600',
$idle_timeout = '3600',
$reconnect_interval = '10',
$retry_interval = '10',
$log_file = false,
$log_dir = '/var/log/neutron',
$api_workers = '0',
$agent_down_time = '9',
$report_interval = '4'
$package_ensure = 'present',
$enabled = true,
$auth_password = false,
$auth_type = 'keystone',
$auth_host = 'localhost',
$auth_port = '35357',
$auth_admin_prefix = false,
$auth_tenant = 'services',
$auth_user = 'neutron',
$auth_protocol = 'http',
$auth_uri = false,
$sql_connection = false,
$connection = 'sqlite:////var/lib/neutron/ovs.sqlite',
$max_retries = '10',
$sql_max_retries = '10',
$sql_idle_timeout = '3600',
$idle_timeout = '3600',
$reconnect_interval = '10',
$retry_interval = '10',
$log_file = false,
$log_dir = '/var/log/neutron',
$api_workers = '0',
$agent_down_time = '9',
$report_interval = '4',
$router_scheduler_driver = 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler'
) {
include neutron::params
@ -178,13 +185,14 @@ class neutron::server (
}
neutron_config {
'DEFAULT/api_workers': value => $api_workers;
'DEFAULT/agent_down_time': value => $agent_down_time;
'DEFAULT/report_interval': value => $report_interval;
'database/connection': value => $connection_real;
'database/idle_timeout': value => $idle_timeout_real;
'database/retry_interval': value => $retry_interval_real;
'database/max_retries': value => $max_retries_real;
'DEFAULT/api_workers': value => $api_workers;
'DEFAULT/agent_down_time': value => $agent_down_time;
'DEFAULT/report_interval': value => $report_interval;
'DEFAULT/router_scheduler_driver': value => $router_scheduler_driver;
'database/connection': value => $connection_real;
'database/idle_timeout': value => $idle_timeout_real;
'database/retry_interval': value => $retry_interval_real;
'database/max_retries': value => $max_retries_real;
}
if $log_file {

@ -12,25 +12,26 @@ describe 'neutron::server' do
end
let :default_params do
{ :package_ensure => 'present',
:enabled => true,
:log_dir => '/var/log/neutron',
:auth_type => 'keystone',
:auth_host => 'localhost',
:auth_port => '35357',
:auth_tenant => 'services',
:auth_user => 'neutron',
:sql_connection => false,
:connection => 'sqlite:////var/lib/neutron/ovs.sqlite',
:sql_max_retries => '10',
:max_retries => '10',
:sql_idle_timeout => '3600',
:idle_timeout => '3600',
:reconnect_interval => '10',
:retry_interval => '10',
:api_workers => '0',
:agent_down_time => '9',
:report_interval => '4'}
{ :package_ensure => 'present',
:enabled => true,
:log_dir => '/var/log/neutron',
:auth_type => 'keystone',
:auth_host => 'localhost',
:auth_port => '35357',
:auth_tenant => 'services',
:auth_user => 'neutron',
:sql_connection => false,
:connection => 'sqlite:////var/lib/neutron/ovs.sqlite',
:sql_max_retries => '10',
:max_retries => '10',
:sql_idle_timeout => '3600',
:idle_timeout => '3600',
:reconnect_interval => '10',
:retry_interval => '10',
:api_workers => '0',
:agent_down_time => '9',
:report_interval => '4',
:router_scheduler_driver => 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler'}
end
shared_examples_for 'a neutron server' do
@ -88,6 +89,7 @@ describe 'neutron::server' do
should contain_neutron_config('DEFAULT/api_workers').with_value('0')
should contain_neutron_config('DEFAULT/agent_down_time').with_value('9')
should contain_neutron_config('DEFAULT/report_interval').with_value('4')
should contain_neutron_config('DEFAULT/router_scheduler_driver').with_value('neutron.scheduler.l3_agent_scheduler.ChanceScheduler')
end
end