Debian 12 bookworm
Sponsored Link

OpenStack Zed : Configure Neutron #22023/06/27

 
Configure OpenStack Network Service (Neutron).
This example is based on the environment like follows.
If you'd like to install Neutron services on another Host, refer to here.
Neutron needs a plugin software, it's possible to choose it from some softwares.
This example chooses ML2 plugin. ( it uses Open vSwitch under the backend )
        eth0|10.0.0.30 
+-----------+-----------+
|   [ dlp.srv.world ]   |
|     (Control Node)    |
|                       |
|  MariaDB    RabbitMQ  |
|  Memcached  Nginx     |
|  Keystone   httpd     |
|  Glance     Nova API  |
|  Nova Compute         |
|    Neutron Server     |
|   Neutron Metadata    |
|  Neutron L2/L3 Agent  |
|    Open vSwitch       |
+-----------------------+

[1] Install Neutron services. That's OK to answer [No] to questions during the installation.
root@dlp ~(keystone)#
apt -y install neutron-server neutron-metadata-agent neutron-plugin-ml2 neutron-openvswitch-agent neutron-l3-agent neutron-dhcp-agent neutron-metadata-agent openvswitch-switch python3-neutronclient
[2] Configure Neutron services.
root@dlp ~(keystone)#
mv /etc/neutron/neutron.conf /etc/neutron/neutron.conf.org

root@dlp ~(keystone)#
vi /etc/neutron/neutron.conf
# create new

[DEFAULT]
bind_host = 127.0.0.1
bind_port = 9696
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
state_path = /var/lib/neutron
dhcp_agent_notification = True
allow_overlapping_ips = True
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
# RabbitMQ connection info
transport_url = rabbit://openstack:password@dlp.srv.world

[agent]
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf

# Keystone auth info
[keystone_authtoken]
www_authenticate_uri = https://dlp.srv.world:5000
auth_url = https://dlp.srv.world:5000
memcached_servers = dlp.srv.world:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = servicepassword
# if using self-signed certs on Apache2 Keystone, turn to [true]
insecure = false

# MariaDB connection info
[database]
connection = mysql+pymysql://neutron:password@dlp.srv.world/neutron_ml2

# Nova auth info
[nova]
auth_url = https://dlp.srv.world:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = servicepassword
# if using self-signed certs on Apache2 Keystone, turn to [true]
insecure = false

[oslo_concurrency]
lock_path = $state_path/tmp

[oslo_policy]
enforce_new_defaults = true

root@dlp ~(keystone)#
vi /etc/neutron/metadata_agent.ini
[DEFAULT]
# line 2 : add
# specify Nova API host

nova_metadata_host = dlp.srv.world
nova_metadata_protocol = https
# specify any secret key you like

metadata_proxy_shared_secret = metadata_secret
# specify Memcache server

memcache_servers = dlp.srv.world:11211
root@dlp ~(keystone)#
mv /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.org

root@dlp ~(keystone)#
vi /etc/neutron/plugins/ml2/ml2_conf.ini
# create new

[DEFAULT]

[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types =
mechanism_drivers = openvswitch
extension_drivers = port_security

[ml2_type_flat]

[ml2_type_vxlan]

[securitygroup]
enable_security_group = True
enable_ipset = True

root@dlp ~(keystone)#
vi /etc/neutron/l3_agent.ini
# line 18 : confirm

interface_driver = openvswitch
root@dlp ~(keystone)#
vi /etc/neutron/dhcp_agent.ini
# line 18 : confirm

interface_driver = openvswitch
# line 37 : uncomment

dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
root@dlp ~(keystone)#
mv /etc/neutron/plugins/ml2/openvswitch_agent.ini /etc/neutron/plugins/ml2/openvswitch_agent.ini.org

root@dlp ~(keystone)#
vi /etc/neutron/plugins/ml2/openvswitch_agent.ini
# create new

[DEFAULT]

[agent]

[ovs]

[securitygroup]
firewall_driver = openvswitch
enable_security_group = True
enable_ipset = True

root@dlp ~(keystone)#
touch /etc/neutron/fwaas_driver.ini

root@dlp ~(keystone)#
chmod 640 /etc/neutron/{neutron.conf,fwaas_driver.ini}

root@dlp ~(keystone)#
chgrp neutron /etc/neutron/{neutron.conf,fwaas_driver.ini}
root@dlp ~(keystone)#
chmod 640 /etc/neutron/plugins/ml2/{ml2_conf.ini,openvswitch_agent.ini}

root@dlp ~(keystone)#
chgrp neutron /etc/neutron/plugins/ml2/{ml2_conf.ini,openvswitch_agent.ini}
root@dlp ~(keystone)#
vi /etc/nova/nova.conf
# add follows into the [DEFAULT] section

vif_plugging_is_fatal = True
vif_plugging_timeout = 300

# add follows to the end : Neutron auth info
# the value of [metadata_proxy_shared_secret] is the same with the one in [metadata_agent.ini]
[neutron]
auth_url = https://dlp.srv.world:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = servicepassword
service_metadata_proxy = True
metadata_proxy_shared_secret = metadata_secret
insecure = false

root@dlp ~(keystone)#
sed -i -e "s/UWSGI_BIND_IP=\"\"/UWSGI_BIND_IP=\"127.0.0.1\"/" /etc/init.d/neutron-api

[3] Configure Nginx for proxy settings.
root@dlp ~(keystone)#
vi /etc/nginx/nginx.conf
# add into the [stream] section

stream {
    upstream glance-api {
        server 127.0.0.1:9292;
    }
    server {
        listen 10.0.0.30:9292 ssl;
        proxy_pass glance-api;
    }
    upstream nova-api {
        server 127.0.0.1:8774;
    }
    server {
        listen 10.0.0.30:8774 ssl;
        proxy_pass nova-api;
    }
    upstream nova-metadata-api {
        server 127.0.0.1:8775;
    }
    server {
        listen 10.0.0.30:8775 ssl;
        proxy_pass nova-metadata-api;
    }
    upstream placement-api {
        server 127.0.0.1:8778;
    }
    server {
        listen 10.0.0.30:8778 ssl;
        proxy_pass placement-api;
    }
    upstream novncproxy {
        server 127.0.0.1:6080;
    }
    server {
        listen 10.0.0.30:6080 ssl;
        proxy_pass novncproxy;
    }
    upstream neutron-api {
        server 127.0.0.1:9696;
    }
    server {
        listen 10.0.0.30:9696 ssl;
        proxy_pass neutron-api;
    }
    ssl_certificate "/etc/letsencrypt/live/dlp.srv.world/fullchain.pem";
    ssl_certificate_key "/etc/letsencrypt/live/dlp.srv.world/privkey.pem";
}
[4] Start Neutron services.
root@dlp ~(keystone)#
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

root@dlp ~(keystone)#
su -s /bin/bash neutron -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head"
root@dlp ~(keystone)#
ip link set up ovs-system

root@dlp ~(keystone)#
echo -e '\nauto ovs-system\niface ovs-system inet manual' >> /etc/network/interfaces
root@dlp ~(keystone)#
systemctl restart neutron-api neutron-rpc-server neutron-l3-agent neutron-dhcp-agent neutron-metadata-agent neutron-openvswitch-agent nova-api nova-compute nginx

root@dlp ~(keystone)#
systemctl enable neutron-api neutron-rpc-server neutron-l3-agent neutron-dhcp-agent neutron-metadata-agent neutron-openvswitch-agent
# show status

root@dlp ~(keystone)#
openstack network agent list

+--------------------------------------+--------------------+---------------+-------------------+-------+-------+---------------------------+
| ID                                   | Agent Type         | Host          | Availability Zone | Alive | State | Binary                    |
+--------------------------------------+--------------------+---------------+-------------------+-------+-------+---------------------------+
| 317ea35b-6504-47a7-a7f8-d1cbf815c7a9 | Metadata agent     | dlp.srv.world | None              | :-)   | UP    | neutron-metadata-agent    |
| c4ac7ec3-d3a2-4fd8-9072-01851aaa2b4f | DHCP agent         | dlp.srv.world | nova              | :-)   | UP    | neutron-dhcp-agent        |
| d32e00f7-be57-4600-99f3-4efc43f4206e | Open vSwitch agent | dlp.srv.world | None              | :-)   | UP    | neutron-openvswitch-agent |
| da7e277f-4708-4421-8a47-5d7d0ba25810 | L3 agent           | dlp.srv.world | nova              | :-)   | UP    | neutron-l3-agent          |
+--------------------------------------+--------------------+---------------+-------------------+-------+-------+---------------------------+
Matched Content