官术网_书友最值得收藏!

  • OpenStack Networking Cookbook
  • Sriram Subramanian Chandan Dutta Chowdhury
  • 488字
  • 2021-07-09 21:40:44

Configuring Neutron to use the Open vSwitch mechanism driver

The ML2 plugin can support many mechanisms to provide the core functionality. We will see how Open vSwitch can act as a mechanism driver for the ML2 plugin.

Getting ready

Using OVS as the mechanism driver requires changes to the ML2 plugin configuration file. We also have to configure OVS with a tenant network type and physical network alias.

How to do it…

The following steps will show you how to configure Open vSwitch as the mechanism driver for the ML2 plugin:

  1. With the appropriate credentials, SSH into the node where the Neutron server is running. In our setup, it will be the Controller and Network node.
  2. Open the Neutron ML2 plugin configuration file using your desired editor. For example, the command for vi editor will be as follows:
    openstack@controller:~$ sudo vi /etc/neutron/plugins/ml2/ml2_conf.ini
    
  3. In the [ml2] section of the file, configure ML2 to use OVS as the mechanism driver:
    [ml2]
    ...
    mechanism_drivers = openvswitch
    
  4. In the [ovs] section of the file, configure OVS with the tenant network type and physical bridge mapping:
    [ovs]
    ...
    tenant_network_type = vlan
    bridge_mappings = physnet1:br-eth1
    
  5. In the previous step, br-eth1 represents the actual Open vSwitch instance that is bound to a physical interface and physnet1 represents the alias for the OVS instance.
  6. The OVS instance, br-eth1, can be created using the following steps (assuming that the eth1 interface is used for the data traffic):
    openstack@controller:~$ sudo ovs-vsctl add-br br-eth1
    openstack@controller:~$ sudo ovs-vsctl add-port br-eth1 eth1
    
  7. Restart the Neutron and Open vSwitch services on the Controller and Network nodes of our setup, using the following commands:
    openstack@controller:~$ sudo service neutron-server restart
    openstack@controller:~$ sudo service openvswitch-switch restart
    openstack@controller:~$ sudo service neutron-openvswitch-agent restart 
    
  8. Repeat these steps for the compute node in the setup.
  9. The next few steps will show you the changes that are needed on the Network node so that the Neutron agents can use the OVS-related drivers.
  10. Edit the [DEFAULT] section of the DHCP agent configuration file located at /etc/neutron/dhcp_agent.ini as follows:
    [DEFAULT]
    ...
    interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
    Edit the [DEFAULT] section of the L3 agent configuration file located at /etc/neutron/l3_agent.ini as follows:
    [DEFAULT]
    ...
    interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
    
  11. Edit the [securitygroup] section of the ML2 plugin configuration file located at /etc/neutron/plugins/ml2/ml2_conf.ini as follows:
    [securitygroup]
    ...
    firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
    
  12. Restart the Neutron-related services as mentioned in step 7.

How it works…

As part of its startup, the Neutron server will load the core plugin, which in our case is the ML2 plugin. As the ML2 plugin allows multiple ways to implement the physical and virtual networks, it uses the mechanism_drivers attribute to load the desired drivers. The previous steps showed you how to configure OVS as the mechanism driver for ML2. The OVS mechanism driver needs additional information such as the bridge name and physical interface mapping so as to provide network connectivity. Hence, these mappings are also a part of the mechanism driver configuration.

主站蜘蛛池模板: 元江| 靖江市| 南江县| 永寿县| 晋江市| 普格县| 阿拉尔市| 丹阳市| 海安县| 铁岭市| 瑞金市| 平邑县| 犍为县| 丽江市| 安平县| 宁阳县| 赤城县| 苍南县| 灵璧县| 桓台县| 奉化市| 静乐县| 博客| 剑川县| 安顺市| 桐乡市| 嘉峪关市| 三穗县| 昌平区| 西乡县| 邢台县| 威海市| 永兴县| 政和县| 丰都县| 香河县| 永兴县| 留坝县| 隆安县| 玉树县| 安平县|