一、基本環境部署
環境說明: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 = Truedhcp_agents_per_network = 計算節點+網絡節點數
/etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]mechanism_drivers = openvswitch,l2population[agent]l2_population = Trueenable_distributed_routing = True
重新開機neutron-server
systemctl restart neutron-server.service
2. 配置網絡節點:
neutron/neutron.conf[DEFAULT]router_distributed = Truedhcp_agents_per_network = 計算節點+網絡節點數/etc/neutron/plugins/ml2/ml2_conf.ini[ml2]mechanism_drivers = openvswitch,l2population[agent]l2_population = Trueenable_distributed_routing = Trueneutron/l3_agent.iniagent_mode = dvr_snat重新開機neutron-agentsystemctl restart openvswitch.servicesystemctl restart neutron-openvswitch-agent.servicesystemctl restart neutron-l3-agent.servicesystemctl restart neutron-dhcp-agent.servicesystemctl restart neutron-metadata-agent.service3. 配置計算節點:
neutron/neutron.conf[DEFAULT]router_distributed = Truedhcp_agents_per_network = 計算節點+網絡節點數/etc/neutron/plugins/ml2/ml2_conf.ini[ml2]mechanism_drivers = openvswitch,l2population[agent]l2_population = Truearp_responder = Trueenable_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.OVSInterfaceDriveruse_namespaces = Trueexternal_network_bridge =agent_mode = dvr計算節點上需要額外運作L3-agent 和Metadata-agent。neutron/metadata_agent.ini[DEFAULT]auth_uri = http://dvr-controller:5000auth_url = http://dvr-controller:35357auth_region = RegionOneauth_plugin = passwordproject_domain_id = defaultuser_domain_id = defaultproject_name = serviceusername = neutronpassword = 123456metadata_proxy_shared_secret =12345678nova_metadata_ip = dvr-controller計算節點上要建立br-ex的ovs橋,并将對應的接口加進去ovs-vsctl add-br br-exovs-vsctl add-port br-ex eth2修改ifcfg-eth2 和 ifcfg-br-ex,固化相應的IP位址(省略);
重新開機網絡服務;
systemctl restart network.service在計算節點上啟動l3-agent和metadata-agentsystemctl enable neutron-metadata-agent.servicesystemctl restart neutron-metadata-agent.servicesystemctl enable neutron-l3-agent.servicesystemctl restart neutron-l3-agent.service總結重點:1、計算節點上需要額外運作L3-agent 和Metadata-agent2、在測試驗證DVR功能前,需要将所有之前測試非DVR功能時建立的網絡資源删除,重建。