Add new template for ml2 plugin.

Add new template for ml2 plugin since the vxlan depends on this
plugin.

Implements: blueprint neutron-ml2
Change-Id: Ie7307bebb0b9882d79d92b34aaf8e402d36af63c
This commit is contained in:
gengjh 2014-02-25 09:45:38 +08:00
parent fab87dd2c8
commit f923580086
8 changed files with 175 additions and 4 deletions

View File

@ -2,6 +2,9 @@
This file is used to list changes made in each version of cookbook-openstack-network.
## 8.4.0
* Add new template for ml2 plugin
## 8.3.0
* Add new attributes to support vxlan in linuxbridge plugin template

View File

@ -106,12 +106,23 @@ Linuxbridge plugin attributes
* `openstack['openstack']['network']['linuxbridge']['rpc_support_old_agents']` - (BoolOpt) Enable server RPC compatibility with old (pre-havana). (default false)
* `openstack['openstack']['network']['linuxbridge']['firewall_driver']` - Firewall driver for realizing neutron security group function
Modular Layer 2 Plugin Configuration
------------------------------------
* `openstack['openstack']['network']['ml2']['type_drivers']` - (ListOpt) List of network type driver entrypoints to be loaded from the neutron.ml2.type_drivers namespace.
* `openstack['openstack']['network']['ml2']['tenant_network_types']` - (ListOpt) Ordered list of net work_types to allocate as tenant networks. (default local)
* `openstack['openstack']['network']['ml2']['mechanism_drivers']` - (ListOpt) Ordered list of networ king mechanism driver entrypoints to be loaded from the neutron.ml2.mechanism_drivers namespace.
* `openstack['openstack']['network']['ml2']['flat_networks']` - (ListOpt) List of physical_network names with which flat networks can be created.
* `openstack['openstack']['network']['ml2']['network_vlan_ranges']` - (ListOpt) List of <physical_network>[:<vlan_min>:<vlan_max>] tuples specifying physical_network names usable for VLAN provider and tenant networks
* `openstack['openstack']['network']['ml2']['tunnel_id_ranges']` - (ListOpt) Comma-separated list of <tun_min>:<tun_max> tuples enumerating ranges of GRE tunnel IDs that are available for tenant network allocation
* `openstack['openstack']['network']['ml2']['vni_ranges']` - (ListOpt) Comma-separated list of <vni_min>:<vni_max> tuples enumerating ranges of VXLAN VNI IDs that are available for tenant network allocation.
* `openstack['openstack']['network']['ml2']['vxlan_group']` - (StrOpt) Multicast group for the VXLAN interface.
Templates
=========
* `api-paste.ini.erb` - Paste config for OpenStack Network server
* `neutron.conf.erb` - Config file for OpenStack Network server
* `policy.json.erb` - Configuration of ACLs for glance API server
* `ml2_conf.ini.erb` - Configuration of Network ML2 Plugins
Testing
=======

View File

@ -4,6 +4,7 @@
# Attributes:: default
#
# Copyright 2013, AT&T
# Copyright 2014, IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -824,6 +825,63 @@ default['openstack']['network']['ryu']['firewall_driver'] = 'neutron.agent.linux
# Agent's polling interval in seconds
default['openstack']['network']['ryu']['polling_interval'] = 2
# ============================= ML2 Plugin Configuration ===================
# (ListOpt) List of network type driver entrypoints to be loaded from
# the neutron.ml2.type_drivers namespace.
#
# type_drivers = local,flat,vlan,gre,vxlan
# Example: type_drivers = flat,vlan,gre,vxlan
default['openstack']['network']['ml2']['type_drivers'] = 'local,flat,vlan,gre,vxlan'
# (ListOpt) Ordered list of network_types to allocate as tenant
# networks. The default value 'local' is useful for single-box testing
# but provides no connectivity between hosts.
#
# tenant_network_types = local
# Example: tenant_network_types = vlan,gre,vxlan
default['openstack']['network']['ml2']['tenant_network_types'] = 'local'
# (ListOpt) Ordered list of networking mechanism driver entrypoints
# to be loaded from the neutron.ml2.mechanism_drivers namespace.
# mechanism_drivers =
# Example: mechanism_drivers = arista
# Example: mechanism_drivers = cisco,logger
default['openstack']['network']['ml2']['mechanism_drivers'] = ''
# (ListOpt) List of physical_network names with which flat networks
# can be created. Use * to allow flat networks with arbitrary
# physical_network names.
#
# flat_networks =
# Example:flat_networks = physnet1,physnet2
# Example:flat_networks = *
default['openstack']['network']['ml2']['flat_networks'] = ''
# (ListOpt) List of <physical_network>[:<vlan_min>:<vlan_max>] tuples
# specifying physical_network names usable for VLAN provider and
# tenant networks, as well as ranges of VLAN tags on each
# physical_network available for allocation as tenant networks.
#
# network_vlan_ranges =
# Example: network_vlan_ranges = physnet1:1000:2999,physnet2
default['openstack']['network']['ml2']['network_vlan_ranges'] = ''
# (ListOpt) Comma-separated list of <tun_min>:<tun_max> tuples enumerating
# ranges of GRE tunnel IDs that are available for tenant network allocation
default['openstack']['network']['ml2']['tunnel_id_ranges'] = ''
# (ListOpt) Comma-separated list of <vni_min>:<vni_max> tuples enumerating
# ranges of VXLAN VNI IDs that are available for tenant network allocation.
default['openstack']['network']['ml2']['vni_ranges'] = ''
# (StrOpt) Multicast group for the VXLAN interface. When configured, will
# enable sending all broadcast traffic to this multicast group. When left
# unconfigured, will disable multicast VXLAN mode.
#
# vxlan_group =
# Example: vxlan_group = 239.1.1.1
default['openstack']['network']['ml2']['vxlan_group'] = ''
# platform-specific settings
case platform
when 'fedora', 'redhat', 'centos' # :pragma-foodcritic: ~FC024 - won't fix this
@ -834,7 +892,7 @@ when 'fedora', 'redhat', 'centos' # :pragma-foodcritic: ~FC024 - won't fix this
'db2_python_packages' => ['db2-odbc', 'python-ibm-db', 'python-ibm-db-sa'],
'postgresql_python_packages' => ['python-psycopg2'],
'nova_network_packages' => ['openstack-nova-network'],
'neutron_packages' => ['openstack-neutron'],
'neutron_packages' => ['openstack-neutron', 'openstack-neutron-ml2'],
'neutron_client_packages' => ['python-neutronclient'],
'neutron_dhcp_packages' => ['openstack-neutron'],
'neutron_dhcp_build_packages' => [],

View File

@ -5,7 +5,7 @@ maintainer 'Jay Pipes <jaypipes@gmail.com>'
license 'Apache 2.0'
description 'Installs and configures the OpenStack Network API Service and various agents and plugins'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '8.3.0'
version '8.4.0'
recipe 'openstack-network::client', 'Install packages required for network client'
recipe 'openstack-network::server', 'Installs packages required for a OpenStack Network server'
recipe 'openstack-network::openvswitch', 'Installs packages required for OVS'

View File

@ -194,6 +194,15 @@ end
# physical servers like the l3 agent, so we assume
# the plugin configuration is a "common" file
template '/etc/neutron/plugins/ml2/ml2_conf.ini' do
source 'plugins/ml2/ml2_conf.ini.erb'
owner node['openstack']['network']['platform']['user']
group node['openstack']['network']['platform']['group']
mode 00644
notifies :restart, 'service[neutron-server]', :delayed
end
template_file = nil
plugin_file = '/etc/neutron/plugin.ini'

View File

@ -45,7 +45,7 @@ end
# else migrate the database to latest version.
bash 'migrate network database' do
plugin_config_file = node['openstack']['network']['plugin_config_file']
migrate_command = "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file #{plugin_config_file}"
migrate_command = "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini --config-file #{plugin_config_file}"
code <<-EOF
current_version_line=`#{migrate_command} current 2>&1 | tail -n 1`
# determine if the $current_version_line ends with ": None"

View File

@ -493,5 +493,35 @@ describe 'openstack-network::server' do
expect(@chef_run).to render_file(@file.name).with_content(
'service_provider = provider2')
end
describe '/etc/neutron/plugins/ml2/ml2_conf.ini' do
before do
@file = @chef_run.template('/etc/neutron/plugins/ml2/ml2_conf.ini')
end
it 'has proper owner' do
expect(@file.owner).to eq('neutron')
expect(@file.group).to eq('neutron')
end
it 'has proper modes' do
expect(sprintf('%o', @file.mode)).to eq '644'
end
[
/^type_drivers = local,flat,vlan,gre,vxlan$/,
/^tenant_network_types = local$/,
/^mechanism_drivers = $/,
/^flat_networks = $/,
/^network_vlan_ranges = $/,
/^tunnel_id_ranges = $/,
/^vni_ranges = $/,
/^vxlan_group = $/
].each do |content|
it "has a #{content.source[1...-1]} line" do
expect(@chef_run).to render_file(@file.name).with_content(content)
end
end
end
end
end

View File

@ -0,0 +1,60 @@
<%= node['openstack']['network']['custom_template_banner'] %>
[ml2]
# (ListOpt) List of network type driver entrypoints to be loaded from
# the neutron.ml2.type_drivers namespace.
#
# type_drivers = local,flat,vlan,gre,vxlan
# Example: type_drivers = flat,vlan,gre,vxlan
type_drivers = <%= node['openstack']['network']['ml2']['type_drivers'] %>
# (ListOpt) Ordered list of network_types to allocate as tenant
# networks. The default value 'local' is useful for single-box testing
# but provides no connectivity between hosts.
#
# tenant_network_types = local
# Example: tenant_network_types = vlan,gre,vxlan
tenant_network_types = <%= node['openstack']['network']['ml2']['tenant_network_types'] %>
# (ListOpt) Ordered list of networking mechanism driver entrypoints
# to be loaded from the neutron.ml2.mechanism_drivers namespace.
# mechanism_drivers =
# Example: mechanism_drivers = arista
# Example: mechanism_drivers = cisco,logger
mechanism_drivers = <%= node['openstack']['network']['ml2']['mechanism_drivers'] %>
[ml2_type_flat]
# (ListOpt) List of physical_network names with which flat networks
# can be created. Use * to allow flat networks with arbitrary
# physical_network names.
#
# flat_networks =
# Example:flat_networks = physnet1,physnet2
# Example:flat_networks = *
flat_networks = <%= node['openstack']['network']['ml2']['flat_networks'] %>
[ml2_type_vlan]
# (ListOpt) List of <physical_network>[:<vlan_min>:<vlan_max>] tuples
# specifying physical_network names usable for VLAN provider and
# tenant networks, as well as ranges of VLAN tags on each
# physical_network available for allocation as tenant networks.
#
# network_vlan_ranges =
# Example: network_vlan_ranges = physnet1:1000:2999,physnet2
network_vlan_ranges = <%= node['openstack']['network']['ml2']['network_vlan_ranges'] %>
[ml2_type_gre]
# (ListOpt) Comma-separated list of <tun_min>:<tun_max> tuples enumerating ranges of GRE tunnel IDs that are available for tenant network allocation
tunnel_id_ranges = <%= node['openstack']['network']['ml2']['tunnel_id_ranges'] %>
[ml2_type_vxlan]
# (ListOpt) Comma-separated list of <vni_min>:<vni_max> tuples enumerating
# ranges of VXLAN VNI IDs that are available for tenant network allocation.
vni_ranges = <%= node['openstack']['network']['ml2']['vni_ranges'] %>
# (StrOpt) Multicast group for the VXLAN interface. When configured, will
# enable sending all broadcast traffic to this multicast group. When left
# unconfigured, will disable multicast VXLAN mode.
#
# vxlan_group =
# Example: vxlan_group = 239.1.1.1
vxlan_group = <%= node['openstack']['network']['ml2']['vxlan_group'] %>