Openstack installation : Networking service – Neutron (On Controller Node)

Content from “openstack.org”, listed here with minor/no changes – just noting down what I did – online notes.

Create database, service credentials, and API endpoints.

CREATE DATABASE neutron;

GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY '{password}';

GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY '{password}';

Create the service credentials. Create the neutron user:

$ . admin-openrc
$ openstack user create --domain default --password-prompt neutron

User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | fdb0f541e28141719b6a43c8944bf1fb |
| name | neutron |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+

Add the admin role to the neutron user:

$ openstack role add --project service --user neutron admin

Create the neutron service entity:

$ openstack service create --name neutron --description "OpenStack Networking" network
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Networking |
| enabled | True |
| id | f71529314dab4a4d8eca427e701d209e |
| name | neutron |
| type | network |
+-------------+----------------------------------+

Create the Networking service API endpoints:

$ openstack endpoint create --region RegionOne network public http://controller:9696 
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 85d80a6d02fc4b7683f611d7fc1493a3 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f71529314dab4a4d8eca427e701d209e |
| service_name | neutron |
| service_type | network |
| url | http://controller:9696 |
+--------------+----------------------------------+

$ openstack endpoint create --region RegionOne network internal http://controller:9696

+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 09753b537ac74422a68d2d791cf3714f |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f71529314dab4a4d8eca427e701d209e |
| service_name | neutron |
| service_type | network |
| url | http://controller:9696 |
+--------------+----------------------------------+

$ openstack endpoint create --region RegionOne network admin http://controller:9696

+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 1ee14289c9374dffb5db92a5c112fc4e |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f71529314dab4a4d8eca427e701d209e |
| service_name | neutron |
| service_type | network |
| url | http://controller:9696 |
+--------------+----------------------------------+

Install and configure the Networking components

apt install --assume-yes neutron-server neutron-plugin-ml2 neutron-linuxbridge-agent neutron-l3-agent neutron-dhcp-agent neutron-metadata-agent

Edit the /etc/neutron/neutron.conf file and complete the following actions:

In the [database] section, configure database access:
Comment out or remove any other connection options in the [database] section.

[database]
...
connection = mysql+pymysql://neutron:midlodza@controller/neutron

In the [DEFAULT] section

  • Enable the Modular Layer 2 (ML2) plug-in, router service, and overlapping IP addresses
  • Configure RabbitMQ message queue access
  • Configure Identity service access
  • Configure Networking to notify Compute of network topology changes

[DEFAULT]
...
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
...
transport_url = rabbit://openstack:midlodza@controller
...
auth_strategy = keystone
...

notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true

In the [keystone_authtoken] section, configure Identity service access:
Comment out or remove any other options

[keystone_authtoken]
...
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = {password}

In [nova] section :

[nova]
...
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = {password}

[oslo_concurrency]
...
lock_path = /var/log/neutron/tmp

Configure the Modular Layer 2 (ML2) plug-in, uses the Linux bridge mechanism to build layer-2 (bridging and switching) virtual networking infrastructure for instances.

Edit the /etc/neutron/plugins/ml2/ml2_conf.ini file and complete the following actions:

Note : The Linux bridge agent only supports VXLAN overlay networks.

In the [ml2] section

  • Enable flat, VLAN, and VXLAN networks:
  • Enable the port security extension driver
[ml2]
...
type_drivers = flat,vlan,vxlan
...
tenant_network_types = vxlan
...
mechanism_drivers = linuxbridge,l2population
...
extension_drivers = port_security

In the [ml2_type_flat] section, configure the provider virtual network as a flat network:

[ml2_type_flat]
...
flat_networks = provider

In the [ml2_type_vxlan] section, configure the VXLAN network identifier range for self-service networks:

[ml2_type_vxlan]
...
vni_ranges = 1:1000

In the [securitygroup] section, enable ipset to increase efficiency of security group rules:

[securitygroup]
...
enable_ipset = true

Configure the Linux bridge agent, builds layer-2 (bridging and switching) virtual networking infrastructure for instances and handles security groups.

Edit the /etc/neutron/plugins/ml2/linuxbridge_agent.ini file and complete the following actions:

In the [linux_bridge] section, map the provider virtual network to the provider physical network interface: [enp3s0 is the interface name in my system, the second physical interface i would like to configure for provider networks]

[linux_bridge]
...
physical_interface_mappings = provider:enp3s0

In the [vxlan] section, enable VXLAN overlay networks, configure the IP address of the physical network interface that handles overlay networks, and enable layer-2 population:
OVERLAY_IP_ADDRESS – IP address associated with enp2s0 in my system.

[vxlan]
...
enable_vxlan = true
local_ip = 10.0.0.15
l2_population = true

In the [securitygroup] section, enable security groups and configure the Linux bridge iptables firewall driver:

[securitygroup]
...
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

Configure the layer-3 agent, provides routing and NAT services for self-service virtual networks. Edit the /etc/neutron/l3_agent.ini file and complete the following actions:

In the [DEFAULT] section, configure the Linux bridge interface driver and external network bridge:

[DEFAULT]
...
interface_driver = linuxbridge

Configure the DHCP agent, provides DHCP services for virtual networks.

Edit the /etc/neutron/dhcp_agent.ini file : In the [DEFAULT] section, configure the Linux bridge interface driver, Dnsmasq DHCP driver, and enable isolated metadata so instances on provider networks can access metadata over the network:

[DEFAULT]
...
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true

Configure the metadata agent, provides configuration information such as credentials to instances.

Edit the /etc/neutron/metadata_agent.ini file and complete the following actions:

In the [DEFAULT] section, configure the metadata host and shared secret:

[DEFAULT]
...
nova_metadata_host = controller
metadata_proxy_shared_secret = {secret}

Configure the Compute service to use the Networking service
Edit the /etc/nova/nova.conf file and perform the following actions:

Edit the /etc/nova/nova.conf file and perform the following actions:

In the [neutron] section, configure access parameters, enable the metadata proxy, and configure the secret:

[neutron]
...
url = http://controller:9696
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = {password}
service_metadata_proxy = true
metadata_proxy_shared_secret = {secret}

Finalize installation : Populate the database

su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron

Restart the Compute API service:

service nova-api restart

Restart the Networking services.

service neutron-server restart
service neutron-linuxbridge-agent restart
service neutron-dhcp-agent restart
service neutron-metadata-agent restart
service neutron-l3-agent restart


About sandeep

Passionate about sharing information on "how to".
This entry was posted in Installation / How To, Notes and tagged , , , , , , , , . Bookmark the permalink.