天天看點

OpenStack kilo版DVR功能搭建小記

一、基本環境部署

環境說明:4 節點,每節點三個網卡,第一個網卡做管理用,第二個網卡做内部tunnel網絡,第三個網卡做外部網絡:

節點角色 管理網絡IP 内部tunnel網絡 外部網絡
dvr-controller 172.16.30.2 172.16.40.2 172.16.50.2
dvr-network 172.16.30.6 172.16.40.6 172.16.50.6
dvr-dvr-compute1 172.16.30.7 172.16.40.7 172.16.50.7
compute2 172.16.30.8 172.16.40.8 172.16.50.8

根據官方安裝部署文檔搭建環境(使用neutron傳統模式),搭建過程省略。

二、DVR相關配置

本部分主要記錄在第一部分基礎上需要修改哪些配置才能使用DVR功能。

1. 配置控制節點:

neutron/neutron.conf

[DEFAULT]
router_distributed = True
dhcp_agents_per_network = 計算節點+網絡節點數 

/etc/neutron/plugins/ml2/ml2_conf.ini

[ml2]
mechanism_drivers = openvswitch,l2population
[agent]
l2_population = True
enable_distributed_routing = True 

  重新開機neutron-server

systemctl restart neutron-server.service

2. 配置網絡節點:

    neutron/neutron.conf
[DEFAULT]
router_distributed = True
dhcp_agents_per_network = 計算節點+網絡節點數 
    /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
mechanism_drivers = openvswitch,l2population
[agent]
l2_population = True
enable_distributed_routing = True
    neutron/l3_agent.ini
agent_mode = dvr_snat
    重新開機neutron-agent
systemctl restart openvswitch.service
systemctl restart neutron-openvswitch-agent.service
systemctl restart neutron-l3-agent.service 
systemctl restart neutron-dhcp-agent.service 
systemctl restart neutron-metadata-agent.service

3. 配置計算節點:

    neutron/neutron.conf
[DEFAULT]
router_distributed = True
dhcp_agents_per_network = 計算節點+網絡節點數 
    /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
mechanism_drivers = openvswitch,l2population
[agent]
l2_population = True
arp_responder = True
enable_distributed_routing = True
[ovs]
bridge_mappings = external:br-ex                
計算節點上有FloatingIP的VM,資料是用過該節點上的Vrouter直接出去的,是以要建立br-ex橋(後邊有建立) 
    neutron/l3_agent.ini
[DEFAULT]
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
use_namespaces = True
external_network_bridge = 
agent_mode = dvr
計算節點上需要額外運作L3-agent 和Metadata-agent。
neutron/metadata_agent.ini
 [DEFAULT]
auth_uri = http://dvr-controller:5000
auth_url = http://dvr-controller:35357
auth_region = RegionOne
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = 123456
metadata_proxy_shared_secret =12345678
nova_metadata_ip = dvr-controller
 計算節點上要建立br-ex的ovs橋,并将對應的接口加進去
ovs-vsctl add-br br-ex
ovs-vsctl add-port br-ex eth2

修改ifcfg-eth2 和 ifcfg-br-ex,固化相應的IP位址(省略);

重新開機網絡服務;

systemctl restart network.service
在計算節點上啟動l3-agent和metadata-agent
systemctl enable neutron-metadata-agent.service
systemctl restart neutron-metadata-agent.service
systemctl enable neutron-l3-agent.service
systemctl restart neutron-l3-agent.service
總結重點:
1、計算節點上需要額外運作L3-agent 和Metadata-agent
2、在測試驗證DVR功能前,需要将所有之前測試非DVR功能時建立的網絡資源删除,重建。

繼續閱讀