第 10 章 配置分布式虚拟路由(DVR)
分布式虚拟路由(Distributed Virtual Routing,简称 DVR)允许用户在 Compute 节点上直接放置 L3 路由。这可以在不首先通过一个网络节点路由的情况下,在 Compute 节点间(East-West)进行网络通信。另外,浮动 IP 的命名空间会在相关的 Compute 节点间进行复制,分配了浮动 IP 的实例就可以在不通过网络节点路由的情况下向外部(North-South)发送网络数据。没有浮动 IP 地址的实例仍然需要通过 Network 节点路由 SNAT 网络数据。
Red Hat Enterprise Linux OpenStack Platform 7(kilo)添加了在使用分布式路由时,对 VLAN 和 VXLAN/GRE 之间连接的支持。现在,DVR 中的 VLAN 和 VXLAN/GRE 通道间可以进行相互连接。
DVR 作为一个技术预览包括在 Red Hat Enterprise Linux OpenStack Platform 7 中。关于技术预览的支持范围的更多信息,请参考 https://access.redhat.com/support/offerings/techpreview/。
在以下的图例中,独立子网间的实例可以在不通过 Network 节点路由的情况下进行相互通讯:

10.1. 配置 DVR
1. 在 Network 节点中的 neutron.conf
文件中启用 router_distributed
。这保证了以后所有创建的路由器在默认情况下都是分布式的。
router_distributed = True
您可以通过修改 policy.json
文件来改变默认的行为:
neutron router-create --distributed=True/False <name>
2. 配置第 3 层代理
在 Compute 节点上,编辑 l3_agent.ini
文件来启用 DVR:
agent_mode = dvr
在 Network 节点中的分布式路由器上配置 dvr_snat
:
agent_mode = dvr_snat
3. 配置第 2 层 agent
在 Network 节点和 Compute 节点中的 L2 Agent 上启动 DVR 和 L2 population 功能。例如,如果使用 Open vSwitch,编辑 ovs_neutron_plugin.ini
文件:
enable_distributed_routing = True l2_population = True
4. 在 ML2 上启用 L2 population 机制驱动
在 Controller 上编辑 ml2_conf.ini
文件:
[ml2] mechanism_drivers = openvswitch, l2population #Other values may be listed here as well
在 Compute 节点上编辑 ml2_conf.ini
文件:
[agent] l2_population = True
5. 重启服务以使所做的修改生效:
在 Controller 上重启以下服务:
# systemctl restart neutron-server.service # systemctl restart neutron-l3-agent.service # systemctl restart neutron-openvswitch-agent.service
在 Compute 节点上重启以下服务:
# systemctl restart neutron-l3-agent.service # systemctl restart neutron-metadata-agent
当前,还不支持把已存在的、非分布式的路由器转换为 DVR。