Skip to content

Commit

Permalink
Add parameters for Neutron QoS support
Browse files Browse the repository at this point in the history
Quality of Service advanced service is a feature introduced in Liberty.
This patch adds options required for this service deployment:
- ml2-ovs extensions (to use qos extension)
- ml2-sriov extensions (to use qos extension)
- ml2 plugin extension_drivers (to use qos extension driver)
- qos notification drivers

Change-Id: Iefc289a6eee13b9c66f8131c258af982f232df4b
(cherry picked from commit eaf2f39)
  • Loading branch information
skolekonov authored and EmilienM committed Dec 2, 2015
1 parent 27d9bb5 commit e81bc87
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 5 deletions.
6 changes: 6 additions & 0 deletions manifests/agents/ml2/ovs.pp
Expand Up @@ -109,10 +109,15 @@
# (optional) Enable or not ARP Spoofing Protection
# Defaults to true
#
# [*extensions*]
# (optional) Extensions list to use
# Defaults to []
#
class neutron::agents::ml2::ovs (
$package_ensure = 'present',
$enabled = true,
$manage_service = true,
$extensions = [],
$bridge_uplinks = [],
$bridge_mappings = [],
$integration_bridge = 'br-int',
Expand Down Expand Up @@ -182,6 +187,7 @@
'agent/enable_distributed_routing': value => $enable_distributed_routing;
'agent/drop_flows_on_start': value => $drop_flows_on_start;
'agent/prevent_arp_spoofing': value => $prevent_arp_spoofing;
'agent/extensions': value => join(any2array($extensions), ',');
'ovs/integration_bridge': value => $integration_bridge;
}

Expand Down
7 changes: 6 additions & 1 deletion manifests/agents/ml2/sriov.pp
Expand Up @@ -52,14 +52,18 @@
# semicolon separated list of virtual functions to exclude from network_device.
# The network_device in the mapping should appear in the physical_device_mappings list.
#

# [*extensions*]
# (optional) Extensions list to use
# Defaults to []
#
class neutron::agents::ml2::sriov (
$package_ensure = 'present',
$enabled = true,
$manage_service = true,
$physical_device_mappings = [],
$polling_interval = 2,
$exclude_devices = [],
$extensions = [],
) {

include ::neutron::params
Expand All @@ -70,6 +74,7 @@
'sriov_nic/polling_interval': value => $polling_interval;
'sriov_nic/exclude_devices': value => join($exclude_devices, ',');
'sriov_nic/physical_device_mappings': value => join($physical_device_mappings, ',');
'agent/extensions': value => join(any2array($extensions), ',');
}

Package['neutron-sriov-nic-agent'] -> Neutron_sriov_agent_config <||>
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Expand Up @@ -43,7 +43,7 @@
# [*service_plugins*]
# (optional) Advanced service modules.
# Could be an array that can have these elements:
# router, firewall, lbaas, vpnaas, metering
# router, firewall, lbaas, vpnaas, metering, qos
# Defaults to empty
#
# [*auth_strategy*]
Expand Down
7 changes: 7 additions & 0 deletions manifests/plugins/ml2.pp
Expand Up @@ -29,6 +29,11 @@
# local, flat, vlan, gre, vxlan
# Defaults to ['local', 'flat', 'vlan', 'gre', 'vxlan'].
#
# [*extension_drivers*]
# (optional) Ordered list of extension driver entrypoints to be loaded
# from the neutron.ml2.extension_drivers namespace.
# Defaults to [].
#
# [*tenant_network_types*]
# (optional) Ordered list of network_types to allocate as tenant networks.
# The value 'local' is only useful for single-box testing
Expand Down Expand Up @@ -118,6 +123,7 @@

class neutron::plugins::ml2 (
$type_drivers = ['local', 'flat', 'vlan', 'gre', 'vxlan'],
$extension_drivers = [],
$tenant_network_types = ['local', 'flat', 'vlan', 'gre', 'vxlan'],
$mechanism_drivers = ['openvswitch', 'linuxbridge'],
$flat_networks = '*',
Expand Down Expand Up @@ -198,6 +204,7 @@
'ml2/tenant_network_types': value => join(any2array($tenant_network_types), ',');
'ml2/mechanism_drivers': value => join(any2array($mechanism_drivers), ',');
'ml2/path_mtu': value => $path_mtu;
'ml2/extension_drivers': value => join(any2array($extension_drivers), ',');
'securitygroup/enable_security_group': value => $enable_security_group;
}

Expand Down
7 changes: 7 additions & 0 deletions manifests/server.pp
Expand Up @@ -196,6 +196,10 @@
# (optional) Deprecated, does nothing.
# Defaults to 'undef'.
#
# [*qos_notification_drivers*]
# (optional) Drivers list to use to send the update notification
# Defaults to [].
#
class neutron::server (
$package_ensure = 'present',
$enabled = true,
Expand Down Expand Up @@ -226,6 +230,7 @@
$max_l3_agents_per_router = 3,
$min_l3_agents_per_router = 2,
$l3_ha_net_cidr = '169.254.192.0/18',
$qos_notification_drivers = [],
# DEPRECATED PARAMETERS
$auth_host = 'localhost',
$auth_port = '35357',
Expand Down Expand Up @@ -301,6 +306,8 @@
}
}

neutron_config { 'qos/notification_drivers': value => join(any2array($qos_notification_drivers), ',') }

if ($::neutron::params::server_package) {
Package['neutron-server'] -> Neutron_api_config<||>
Package['neutron-server'] -> Neutron_config<||>
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/neutron_agents_ml2_ovs_spec.rb
Expand Up @@ -48,6 +48,7 @@
is_expected.to contain_neutron_agent_ovs('agent/arp_responder').with_value(p[:arp_responder])
is_expected.to contain_neutron_agent_ovs('agent/prevent_arp_spoofing').with_value(p[:prevent_arp_spoofing])
is_expected.to contain_neutron_agent_ovs('agent/drop_flows_on_start').with_value(p[:drop_flows_on_start])
is_expected.to contain_neutron_agent_ovs('agent/extensions').with_value([''])
is_expected.to contain_neutron_agent_ovs('ovs/integration_bridge').with_value(p[:integration_bridge])
is_expected.to contain_neutron_agent_ovs('securitygroup/firewall_driver').\
with_value(p[:firewall_driver])
Expand Down Expand Up @@ -176,6 +177,16 @@
end
end

context 'when supplying extensions for ML2 plugin' do
before :each do
params.merge!(:extensions => ['qos'])
end

it 'configures extensions' do
is_expected.to contain_neutron_agent_ovs('agent/extensions').with_value(params[:extensions].join(','))
end
end

context 'when enabling tunneling' do
context 'without local ip address' do
before :each do
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/neutron_agents_ml2_sriov_spec.rb
Expand Up @@ -38,6 +38,7 @@
is_expected.to contain_neutron_sriov_agent_config('sriov_nic/polling_interval').with_value(p[:polling_interval])
is_expected.to contain_neutron_sriov_agent_config('sriov_nic/exclude_devices').with_value(p[:exclude_devices].join(','))
is_expected.to contain_neutron_sriov_agent_config('sriov_nic/physical_device_mappings').with_value(p[:physical_device_mappings].join(','))
is_expected.to contain_neutron_sriov_agent_config('agent/extensions').with_value([''])
end


Expand Down Expand Up @@ -82,6 +83,16 @@
is_expected.to contain_neutron_sriov_agent_config('sriov_nic/physical_device_mappings').with_value(['physnet1:eth1'])
end
end

context 'when supplying extensions for ML2 SR-IOV agent' do
before :each do
params.merge!(:extensions => ['qos'])
end

it 'configures extensions' do
is_expected.to contain_neutron_sriov_agent_config('agent/extensions').with_value(params[:extensions].join(','))
end
end
end

context 'on Debian platforms' do
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/neutron_init_spec.rb
Expand Up @@ -449,12 +449,12 @@
shared_examples_for 'with service_plugins' do
before do
params.merge!(
:service_plugins => ['router','firewall','lbaas','vpnaas','metering']
:service_plugins => ['router','firewall','lbaas','vpnaas','metering','qos']
)
end

it do
is_expected.to contain_neutron_config('DEFAULT/service_plugins').with_value('router,firewall,lbaas,vpnaas,metering')
is_expected.to contain_neutron_config('DEFAULT/service_plugins').with_value('router,firewall,lbaas,vpnaas,metering,qos')
end

end
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/neutron_plugins_ml2_spec.rb
Expand Up @@ -67,6 +67,7 @@
is_expected.to contain_neutron_plugin_ml2('ml2/type_drivers').with_value(p[:type_drivers].join(','))
is_expected.to contain_neutron_plugin_ml2('ml2/tenant_network_types').with_value(p[:tenant_network_types].join(','))
is_expected.to contain_neutron_plugin_ml2('ml2/mechanism_drivers').with_value(p[:mechanism_drivers].join(','))
is_expected.to contain_neutron_plugin_ml2('ml2/extension_drivers').with_value([''])
is_expected.to contain_neutron_plugin_ml2('ml2/path_mtu').with_value(p[:path_mtu])
is_expected.to contain_neutron_plugin_ml2('ml2/physical_network_mtus').with_ensure('absent')
end
Expand All @@ -88,6 +89,16 @@
end
end

context 'when using extension drivers for ML2 plugin' do
before :each do
params.merge!(:extension_drivers => ['port_security','qos'])
end

it 'configures extension drivers' do
is_expected.to contain_neutron_plugin_ml2('ml2/extension_drivers').with_value(p[:extension_drivers].join(','))
end
end

context 'configure ml2 with bad driver value' do
before :each do
params.merge!(:type_drivers => ['foobar'])
Expand Down
12 changes: 11 additions & 1 deletion spec/classes/neutron_server_spec.rb
Expand Up @@ -34,7 +34,7 @@
:max_l3_agents_per_router => 3,
:min_l3_agents_per_router => 2,
:l3_ha_net_cidr => '169.254.192.0/18',
:allow_automatic_l3agent_failover => false
:allow_automatic_l3agent_failover => false,
}
end

Expand Down Expand Up @@ -96,6 +96,7 @@
is_expected.to contain_neutron_config('DEFAULT/rpc_workers').with_value(facts[:processorcount])
is_expected.to contain_neutron_config('DEFAULT/agent_down_time').with_value(p[:agent_down_time])
is_expected.to contain_neutron_config('DEFAULT/router_scheduler_driver').with_value(p[:router_scheduler_driver])
is_expected.to contain_neutron_config('qos/notification_drivers').with_value([''])
end

context 'with manage_service as false' do
Expand Down Expand Up @@ -182,6 +183,15 @@
is_expected.to contain_neutron_config('DEFAULT/allow_automatic_l3agent_failover').with_value(p[:allow_automatic_l3agent_failover])
end
end

context 'with qos_notification_drivers parameter' do
before :each do
params.merge!(:qos_notification_drivers => 'message_queue')
end
it 'should configure qos_notification_drivers' do
is_expected.to contain_neutron_config('qos/notification_drivers').with_value('message_queue')
end
end
end

shared_examples_for 'a neutron server with auth_admin_prefix set' do
Expand Down

0 comments on commit e81bc87

Please sign in to comment.