CentOS Stream 9
Sponsored Link

OpenStack Yoga : Configure Neutron #1
2022/06/09
 
Configure OpenStack Network Service (Neutron).
This example is based on the environment like follows.
        eth0|10.0.0.30 
+-----------+-----------+
|   [ dlp.srv.world ]   |
|     (Control Node)    |
|                       |
|  MariaDB    RabbitMQ  |
|  Memcached  httpd     |
|  Keystone   Glance    |
|  Nova API             |
+-----------------------+

[1] Add user or service for Neutron on Keystone.
# create [neutron] user in [service] project

[root@dlp ~(keystone)]#
openstack user create --domain default --project service --password servicepassword neutron

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | 0f2625947bf0433a9519ba8a29434bdf |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | c32241d8cb664f50bda4db9a74d7e45d |
| name                | neutron                          |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

# add [neutron] user in [admin] role

[root@dlp ~(keystone)]#
openstack role add --project service --user neutron admin
# create service entry for [neutron]

[root@dlp ~(keystone)]#
openstack service create --name neutron --description "OpenStack Networking service" network

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking service     |
| enabled     | True                             |
| id          | 104c231cb35744d1a1206121d6d97369 |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+

# define Neutron API Host

[root@dlp ~(keystone)]#
export controller=dlp.srv.world
# create endpoint for [neutron] (public)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne network public https://$controller:9696

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | e8c25f8109974f679c5f21425a95e243 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 104c231cb35744d1a1206121d6d97369 |
| service_name | neutron                          |
| service_type | network                          |
| url          | https://dlp.srv.world:9696       |
+--------------+----------------------------------+

# create endpoint for [neutron] (internal)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne network internal https://$controller:9696

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 15db72aa1c114db8a823904c7967afdb |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 104c231cb35744d1a1206121d6d97369 |
| service_name | neutron                          |
| service_type | network                          |
| url          | https://dlp.srv.world:9696       |
+--------------+----------------------------------+

# create endpoint for [neutron] (admin)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne network admin https://$controller:9696

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 5ee555ecda8b424d880307eee77fad83 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 104c231cb35744d1a1206121d6d97369 |
| service_name | neutron                          |
| service_type | network                          |
| url          | https://dlp.srv.world:9696       |
+--------------+----------------------------------+
[2] Add a User and Database on MariaDB for Neutron.
[root@dlp ~(keystone)]#
mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 162
Server version: 10.5.13-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database neutron_ml2; 
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on neutron_ml2.* to neutron@'localhost' identified by 'password'; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all privileges on neutron_ml2.* to neutron@'%' identified by 'password'; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit 
Bye
Matched Content