1、官方文档
在OpenStack官方安装文档中,提供了两个网络配置选项:
- Option1:Provider networks
- Option2:Self-service networks
这两个选项并不冲突,可以在OpenStack环境中同时配置。
在《OpenStack Yoga版安装笔记(十三)neutron安装》中,对这两个选项做了说明,并参考官方文档《Networking Option 1: Provider networks》已经完成Provider networks配置。
本文补充选项2 :Self-serivice network配置,注意配置完成后,还需要执行配置后的工作。
建议从Yoga版的Neutron安装界面进入:
2、两个配置选项的差异比较
Option1: Provider networks (在之前的文档中已经完成配置) | Option2: Self-service networks (红色标记为本次需要补充配置) | |
controller node | controller node | |
# apt install neutron-server neutron-plugin-ml2 \neutron-linuxbridge-agent neutron-dhcp-agent \neutron-metadata-agent | # apt install neutron-server neutron-plugin-ml2 \neutron-linuxbridge-agent neutron-l3-agent neutron-dhcp-agent \neutron-metadata-agent | |
/etc/neutron /neutron.conf | [DEFAULT] # ... core_plugin = ml2 service_plugins = | [DEFAULT]
# ...
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true |
/etc/neutron/plugins /ml2/ml2_conf.ini | [ml2] # ... type_drivers = flat,vlan | [ml2]
# ...
type_drivers = flat,vlan,vxlan |
[ml2] # ... tenant_network_types = | [ml2]
# ...
tenant_network_types = vxlan | |
[ml2] # ... mechanism_drivers = linuxbridge | [ml2]
# ...
mechanism_drivers = linuxbridge,l2population | |
[ml2]
# ...
extension_drivers = port_security | [ml2]
# ...
extension_drivers = port_security | |
[ml2_type_flat]
# ...
flat_networks = provider | [ml2_type_flat]
# ...
flat_networks = provider | |
[ml2_type_vxlan]
# ...
vni_ranges = 1:1000 | ||
[securitygroup] # ... enable_ipset = true | [securitygroup]
# ...
enable_ipset = true | |
/etc/neutron/plugins /ml2/linuxbridge_agent.ini | [linux_bridge]
physical_interface_mappings = provider:ens34 | [linux_bridge]
physical_interface_mappings = provider:ens34 |
[vxlan] enable_vxlan = false | [vxlan]
enable_vxlan = true
local_ip = 10.0.20.11
l2_population = true | |
[securitygroup]
# ...
enable_security_group = true
firewall_driver = neutron.agent.linux.
iptables_firewall.
IptablesFirewallDriver | [securitygroup]
# ...
enable_security_group = true
firewall_driver = neutron.agent.linux.
iptables_firewall.
IptablesFirewallDriver | |
/etc/neutron/l3_agent.ini | 无 | [DEFAULT]
# ...
interface_driver = linuxbridge |
compute1 node | compute1 node | |
/etc/neutron/plugins /ml2/linuxbridge_agent.ini | apt install neutron-linuxbridge-agent | apt install neutron-linuxbridge-agent |
[linux_bridge]
physical_interface_mappings = ens35 | [linux_bridge]
physical_interface_mappings = 35 | |
[vxlan] enable_vxlan = false | [vxlan]
enable_vxlan = true
local_ip = 10.0.20.12
l2_population = true |
3、Self-service Networks配置
3.1 前提
1、已经完成Neutron服务安装
2、已经完成Option 1: Provider networks配置
3.2 Controller node补充配置
1、安装软件包
root@controller:~# apt install neutron-l3-agent
注意:安装过程中,出现以下提示的时候,选择保留现有的neutron.conf文件:
Configuration file '/etc/neutron/neutron.conf'==> Modified (by you or by a script) since installation.==> Package distributor has shipped an updated version.What would you like to do about it ? Your options are:Y or I : install the package maintainer's versionN or O : keep your currently-installed versionD : show the differences between the versionsZ : start a shell to examine the situationThe default action is to keep your current version.
*** neutron.conf (Y/I/N/O/D/Z) [default=N] ? N
2、vi /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
3、vi /etc/neutron/plugins/ml2/ml2_conf.ini
root@controller:~# vi /etc/neutron/plugins/ml2/ml2_conf.ini
...
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security[ml2_type_vxlan]
vni_ranges = 1:1000
4、vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
root@controller:~# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[vxlan]
enable_vxlan = true
local_ip = 10.0.20.11
l2_population = true
5、vi /etc/neutron/l3_agent.ini
root@controller:~# vi /etc/neutron/l3_agent.ini
[DEFAULT]
interface_driver = linuxbridge
3.3 Compute1 node补充配置
root@compute1:~# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
root@compute1:~# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[vxlan]
enable_vxlan = true
local_ip = 10.0.20.12
l2_population = true
3.4 Finalize installation(controller node)
root@controller:~# 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
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.Running upgrade for neutron ...
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.OK
root@controller:~# root@controller:~# service nova-api restart
root@controller:~# service neutron-server restart
root@controller:~# service neutron-linuxbridge-agent restart
root@controller:~# service neutron-dhcp-agent restart
root@controller:~# service neutron-metadata-agent restart
root@controller:~# service neutron-l3-agent restart
3.5 Finalize installation(compute1 node)
root@compute1:~# service nova-compute restart
root@compute1:~# service neutron-linuxbridge-agent restart
3.6 Verify operation
- List agents to verify successful launch of the neutron agents:
root@osclient ~(admin/amdin)# openstack network agent list
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| 4516d406-7b90-4029-93a9-6a7fbe964bc2 | DHCP agent | controller | nova | :-) | UP | neutron-dhcp-agent |
| 784c22ee-79e2-4bfa-84c5-4a2456a805e4 | L3 agent | controller | nova | :-) | UP | neutron-l3-agent |
| dd50147c-5a72-4386-9073-a4431c47a3b4 | Metadata agent | controller | None | :-) | UP | neutron-metadata-agent |
| f05c0a19-5657-4e12-8f4c-f5ea5dfc7043 | Linux bridge agent | compute1 | None | :-) | UP | neutron-linuxbridge-agent |
| fc147e91-1504-4a3c-8709-0665c97b4cb6 | Linux bridge agent | controller | None | :-) | UP | neutron-linuxbridge-agent |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
root@osclient ~(admin/amdin)#
The output should indicate four agents on the controller node and one agent on each compute node.