部署Neutron網(wǎng)絡(luò)

安裝和配置控制節(jié)點(Controller node)

在配置Openstack網(wǎng)絡(luò)(項目代號為neutron)服務(wù)前,需要創(chuàng)建相關(guān)數(shù)據(jù)庫、服務(wù)認(rèn)證service credentials、API入口endpoints

  1. 創(chuàng)建數(shù)據(jù)庫
$ mysql -uroot -p
mysql> create database neutron;
mysql> grant all privileges on neutron.* to 'neutron'@'localhost' \
identified by '123456' with grant option;
mysql> grant all privileges on neutron.* to 'neutron'@'%' \
identified by '123456' with grant option;
mysql> exit;
  1. 切換到admin用戶環(huán)境,以獲得admin-only CLI權(quán)限
$ . admin-openrc
  1. 創(chuàng)建neutron服務(wù)認(rèn)證
    創(chuàng)建neutron用戶
$ openstack user create --domain default --password-prompt neutron
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | 5d9c95b32eaa4d80934f5d5d765bd3f5 |
| enabled             | True                             |
| id                  | c5be46da15fb42fc9b96a1b1c884fb6b |
| name                | neutron                          |
| password_expires_at | None                             |
+---------------------+----------------------------------+

neutron用戶添加admin角色

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

此命令無輸出
創(chuàng)建neutron服務(wù)入口

$ openstack service create --name neutron \
--description "OpenStack Networking" network
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking             |
| enabled     | True                             |
| id          | 1ce836e494024e4ea9e2e7899cf01e09 |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+
  1. 創(chuàng)建Networking服務(wù)的API endpoints
$ openstack endpoint create --region RegionOne \
network public http://controller:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 7184c9fcc8d544d7a3957c9810ce4142 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 1ce836e494024e4ea9e2e7899cf01e09 |
| 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           | 7228694155f440eda571df686b6c49be |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 1ce836e494024e4ea9e2e7899cf01e09 |
| 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           | 224bcf7ffa934baba1f75e029f64abab |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 1ce836e494024e4ea9e2e7899cf01e09 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+

配置 networking 選項

可以選擇option 1option 2架構(gòu)以部署Networking服務(wù)。

  • Option 1架構(gòu)是最簡單的,只支持將虛擬機實例接入provider(external)網(wǎng)絡(luò),沒有self-service(private)網(wǎng)絡(luò)、routers以及floating IP(浮動IP)。僅有admin用戶或其他同級用戶可管理provider網(wǎng)絡(luò)
  • Option 2架構(gòu)則使用layer-3服務(wù)擴展了option 1,支持虛擬機實例使用self-service網(wǎng)絡(luò)。demo用戶或其他用戶可以自行管理self-service網(wǎng)絡(luò),包括routers以及floating IP。floating IP可以讓虛擬機實例通過self-service網(wǎng)絡(luò)訪問external網(wǎng)絡(luò),例如外網(wǎng)。self-service網(wǎng)絡(luò)的數(shù)據(jù)包會使用 1500 的MTU

Option 2同樣支持將虛擬機實例接入provider網(wǎng)絡(luò)

配置完成下述任一網(wǎng)絡(luò)架構(gòu)后,再回到這里繼續(xù)配置 metadata 代理

  • Option 1: Provider 網(wǎng)絡(luò) 部署
    -Option 2: Self-service 網(wǎng)絡(luò)

配置metadata agent

metadata agent用于提供配置信息,例如虛擬機實例的憑據(jù)

  • 編輯/etc/neutron/metadata_agent.ini
[DEFAULT]
...
nova_metadata_ip = controller
metadata_proxy_shared_secret = METADATA_SECRET #可以設(shè)置為其他合適的密碼

配置Compute service使用網(wǎng)絡(luò)服務(wù)

  • 編輯/etc/nova/nova.conf
[neutron]
...
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = neutron
password = 123456
service_metadata_proxy = true
metadata_proxy_shared_secret = METADATA_SECRET

安裝收尾

# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini \
/etc/neutron/plugin.ini
# 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
# systemctl restart openstack-nova-api.service
  • 對于option 1option 2,都需要如下操作
# systemctl enable neutron-server.service \
neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
neutron-metadata-agent.service
# systemctl start neutron-server.service \
neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
neutron-metadata-agent.service
  • 對于option 2,還需要啟用layer-3服務(wù)
# systemctl enable neutron-l3-agent.service
# systemctl start neutron-l3-agent.service
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容