首页 > 代码库 > OpenStack: OVS安装
OpenStack: OVS安装
> OVS安装:
1. Install the Open vSwitch plug-in and its dependencies:
# apt-get install \
neutron-plugin-openvswitch-agent \
openvswitch-datapath-dkms \
2. Restart Open vSwitch:
# service openvswitch-switch restart
3. You must set some common configuration options. You must configure Networking core to use OVS. Edit the /etc/neutron/neutron.conf file:
core_plugin = neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2
在neutron设置core_plugin为OVS! 即设置neutron的网络由OVS来管理.
4. You must configure a firewall as well. You should use the same firewall plug-in that you chose to use when you set up the network node. To do this, edit /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini file and set the firewall_driver value under the securitygroup to the same value used on the network node. For instance, if you chose to use the Hybrid OVS-IPTables plug-in, your configuration looks like this:
[securitygroup]
# Firewall driver for realizing neutron security group function.
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
配置OVS防火墙策略!
5. Configure the networking type that you chose when you set up the network node: either GRE tunneling or VLANs.
根据选择的网络类型做具体配置.
(1)如果选择GRE:
# ovs-vsctl add-br br-int
创建虚拟网桥,但不需绑定具体的interface
[ovs]
tenant_network_type = gre
tunnel_id_ranges = 1:1000
enable_tunneling = True
integration_bridge = br-int #步骤5创建
tunnel_bridge = br-tun #自动创建
local_ip = DATA_INTERFACE_IP
(2)如果选择VLAN
# ovs-vsctl add-br br-DATA_INTERFACE
# ovs-vsctl add-port br-DATA_INTERFACE DATA_INTERFACE
创建虚拟网桥, 并绑定具体的interface.
之前提到OpenStack会使用三种interface:
MGMI_INTERFACE: 管理接口, 控制结点联系.
DATA_INTERFACE: 数据接口, 计算结点联系
EXTERNAL_INTERFACE: 外部接口,与外部联系.
一般地, MGMI_INTERFACE, DATA_INTERFACE会使用相同的interface,走内网.
EXTERNAL_INTERFAC会使用独立的interface,走外网,如果有多个ISP,例如电信,联通...都做为port的多个ip绑定. 即每个nic对应一个port,每个port对应多个IP. 二张网卡就要指定二个--nic port-id=‘xxx‘
[ovs]
tenant_network_type = vlan
network_vlan_ranges = physnet1:1:4094
bridge_mappings = physnet1:br-DATA_INTERFACE
-------------------------------------------------------
上述步骤:
1. 安装OVS及其依赖.
2. 配置neutron的core_plugin为OVS
3. OVS的common configuration: 设置firewall_driver为Iptables.
5. OVS的specifical configuration: 根据网络类型, 创建所需的bridge, 配置具体的参数.
OpenStack: OVS安装