RHEL-based distributions, such as CentOS, require the installation of the openstack-neutron-ml2
package on all nodes as follows:
# yum install openstack-neutron-ml2
The ML2 plugin attempts to use a common database and schema that can be shared amongst multiple layer 2 agents. On the controller node, create a new database specifically for use with the ML2 plugin using the MySQL client:
# mysql -u root -p
Use the password set earlier in the OpenStack installation. In this guide, the password was set to openstack
.
At the mysql>
prompt, execute the following commands to create a database named neutron_ml2
and to grant permissions to the existing neutron
user:
CREATE DATABASE neutron_ml2; GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron'; GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'%'; QUIT;
Use crudini
to overwrite the existing database connection string in the Neutron configuration file with the new string on all hosts as follows:
# crudini --set /etc/neutron/neutron.conf database connection mysql://neutron:neutron@controller/neutron_ml2
Before the ML2 plugin can be used, changes, which include specifying the core plugin and database options, must be made to the Neutron configuration on all hosts.
The core_plugin
configuration must be set to use the ML2 plugin. Use the following crudini
command to make this change on all hosts:
# crudini --set /etc/neutron/neutron.conf DEFAULT core_plugin neutron.plugins.ml2.plugin.Ml2Plugin
In addition to configuration file changes, a symbolic link named plugin.ini
must be created in the /etc/neutron/
directory that points to the appropriate plugin configuration file before neutron-server
will start. For ML2, the link can be created with the following command:
# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
If you previously used the LinuxBridge or Open vSwitch plugin and are switching to ML2, be sure to remove the corresponding symbolic link prior to creating a new one for ML2.
The Neutron database must be stamped as the havana
release before neutron-server
starts. Use the neutron-db-manage
command to accomplish this task only on the controller:
# neutron-db-manage --config-file /etc/neutron/plugin.ini --config-file /etc/neutron/neutron.conf stamp havana
When the ML2 plugin is used, the L3 router plugin must be defined as a service plugin in the neutron.conf
configuration file in addition to the FWaaS and LBaaS service plugins. The following are the service plugins for each of the services:
Routing:
neutron.services.l3_router.l3_router_plugin.L3RouterPlugin
Load balancing:
neutron.services.loadbalancer.plugin.LoadBalancerPlugin
Firewalling:
neutron.services.firewall.fwaas_plugin.FirewallPlugin
To add support for the aforementioned services, add them to the service_plugins
configuration option in /etc/neutron/neutron.conf
using a text editor as follows:
service_plugins= neutron.services.l3_router.l3_router_plugin.L3RouterPlugin, neutron.services.loadbalancer.plugin.LoadBalancerPlugin, neutron.services.firewall.fwaas_plugin.FirewallPlugin