部署需求:创建neutron服务数据库,服务凭证和API端点
[root@controller ~]# mysql -u root -p123456
MariaDB [(none)]> CREATE DATABASE neutron; #创建neutron数据库
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY '123456'; #对neutron数据库授予恰当的访问权限
Query OK, 0 rows affected (0.03 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> q
Bye
[root@controller ~]# source admin-openrc.sh #获得 admin 凭证来获取只有管理员能执行命令的访问权限
创建服务证书
[root@controller ~]# openstack user create --domain default --password-prompt neutron #创建neutron用户
User Password: #密码为123456
Repeat User Password:
----------- ----------------------------------
| Field | Value |
----------- ----------------------------------
| domain_id | default |
| enabled | True |
| id | c704bcba775b43b4b9b12a06f60af725 |
| name | neutron |
----------- ----------------------------------
[root@controller ~]# openstack role add --project service --user neutron admin #添加admin 角色到neutron 用户
[root@controller ~]# openstack service create --name neutron --description "OpenStack Networking" network #创建neutron服务实体
------------- ----------------------------------
| Field | Value |
------------- ----------------------------------
| description | OpenStack Networking |
| enabled | True |
| id | 71ddd68d6f6c463f8656274270650d68 |
| name | neutron |
| type | network |
------------- ----------------------------------
[root@controller ~]# openstack endpoint create --region RegionOne network public http://controller:9696 #创建网络服务API端点
-------------- ----------------------------------
| Field | Value |
-------------- ----------------------------------
| enabled | True |
| id | 7761b18170534542af7a614f53025110 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 71ddd68d6f6c463f8656274270650d68 |
| service_name | neutron |
| service_type | network |
| url | http://controller:9696 |
-------------- ----------------------------------
[root@controller ~]# openstack endpoint create --region RegionOne network internal http://controller:9696
-------------- ----------------------------------
| Field | Value |
-------------- ----------------------------------
| enabled | True |
| id | 1e92ad2a17854c678d37079dd9a9e297 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 71ddd68d6f6c463f8656274270650d68 |
| service_name | neutron |
| service_type | network |
| url | http://controller:9696 |
-------------- ----------------------------------
[root@controller ~]# openstack endpoint create --region RegionOne network admin http://controller:9696
-------------- ----------------------------------
| Field | Value |
-------------- ----------------------------------
| enabled | True |
| id | 077b1b1213a84699b6c5fda239db148d |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 71ddd68d6f6c463f8656274270650d68 |
| service_name | neutron |
| service_type | network |
| url | http://controller:9696 |
-------------- ----------------------------------