跳转到: 导航, 搜索

Mellanox-Neutron-Liberty-Ubuntu-InfiniBand

概述

Mellanox Neutron ML2 驱动程序

Mellanox ML2 机制驱动程序实现了 ML2 插件机制驱动程序 API。

此驱动程序支持作为 InfiniBand HCA 的一部分的 Mellanox 嵌入式交换机功能。Mellanox ML2 机制驱动程序提供与 Mellanox Neutron 插件的功能对等性。

Mellanox ML2 机制驱动程序支持 DIRECT(PCI 直通)vnic 类型。有关 vnic 类型配置 API 详细信息,请参阅配置参考指南。映射到客户机 VM 的硬件 vNIC 允许更高的性能和高级功能,例如 RDMA(远程直接内存访问)。

该驱动程序支持 VLAN 网络类型,以便在 InfiniBand 织物上实现虚拟网络。

  • Mellanox OpenStack Neutron Agent(L2 Agent)在每个计算节点上运行。
  • Agent 应根据 VIF(VM vNIC)和嵌入式交换机端口之间的映射应用 VIF 连接性。

先决条件

InfiniBand 网络

Mellanox Neutron 插件使用 InfiniBand 分区(PKeys)来分隔网络。

SM 节点

使用 SDN 机制驱动程序的 OpenSM 配置

SDN 机制驱动程序 允许 OpenSM 动态分配 IB 网络中的 PK。

有关使用 NEO 应用 SDN 机制驱动程序的更多详细信息,请参见 此处

手动 OpenSM 配置

配置 OpenSM

1. 确保所有 PKeys 都在 /etc/opensm/partitions.conf 中预定义。

management=0xffff,ipoib, sl=0, defmember=full: ALL, ALL_SWITCHES=full,SELF=full;

2. 对于您想在 Neutron 中配置的每个网络,您必须配置与该网络 VLAN 关联的 PKey(在 Neutron 中定义):vlan1=0x1, ipoib, sl=0, defmember=full : ALL;

以下是配置文件 /etc/neutron/plugins/mlnx/mlnx_conf.ini 中定义了 10 个 VLAN 的情况下的 partitions.conf 文件的配置示例:( network_vlan_ranges = physnet1:1:10)

management=0x7fff,ipoib, sl=0, defmember=full : ALL, ALL_SWITCHES=full,SELF=full;
vlan1=0x1, ipoib, sl=0, defmember=full: ALL_CAS;
vlan2=0x2, ipoib, sl=0, defmember=full: ALL_CAS;
vlan3=0x3, ipoib, sl=0, defmember=full: ALL_CAS;
vlan4=0x4, ipoib, sl=0, defmember=full: ALL_CAS;
vlan5=0x5, ipoib, sl=0, defmember=full: ALL_CAS;
vlan6=0x6, ipoib, sl=0, defmember=full: ALL_CAS;
vlan7=0x7, ipoib, sl=0, defmember=full: ALL_CAS;
vlan8=0x8, ipoib, sl=0, defmember=full: ALL_CAS;
vlan9=0x9, ipoib, sl=0, defmember=full: ALL_CAS;
vlan10=0xa, ipoib, sl=0, defmember=full: ALL_CAS;

4. 将文件 /etc/opensm/opensm.conf 中的以下行从 FALSE 修改为 TRUE

allow_both_pkeys TRUE

5. 重启 OpenSM

# service opensmd restart

控制器节点

配置 Controller 节点:1 wget http://www.mellanox.com/repository/solutions/openstack/liberty/ubuntu/14.04/python-networking-mlnx_7.0.0-1_all.deb 2.wget http://www.mellanox.com/repository/solutions/openstack/liberty/ubuntu/14.04/eswitchd_1.0.0-18_amd64.deb

Install Mellanox DEB: 
# sudo apt-get install -y neutron-plugin-mlnx 
# sudo dpkg  -i python-networking-mlnx_7.0.0-1_all.deb
# sudo dpkg  -i eswitchd_1.0.0-18_amd64.deb


3. 编辑以下文件:/etc/init.d/neutron-mlnx-agent

Change the /etc/neutron/plugins/mlnx/mlnx.ini to /etc/neutron/plugins/mlnx/mlnx_conf.ini

4. 确保 ML2 是当前的 Neutron 插件,方法是检查文件 /etc/neutron/neutron.conf 中的 core_plugin 参数

core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin

5. 确保 /etc/neutron/plugin.ini 指向 /etc/neutron/plugins/ml2/ml2_conf.ini(符号链接)

6. 通过添加以下内容修改 /etc/neutron/plugins/ml2/ml2_conf.ini

[ml2]
type_drivers = vlan,flat
tenant_network_types = vlan
mechanism_drivers = mlnx, openvswitch
# or mechanism_drivers = mlnx, linuxbridge
[ml2_type_vlan]
network_vlan_ranges = physnet1:1:10

7. 启动(或重新启动)Neutron 服务器

# service neutron-server restart

网络节点

要配置网络节点

先决条件

E_IPoIB port is configured and up

1. 确保 eIPoIB 模块已启动并在 /etc/infiniband/openib.conf 中配置:有关更多信息,请参阅 Mellanox OFED 用户手册中的 eIPoIB 配置。

E_IPOIB_LOAD=yes


2. 重新启动 openibd

# service openibd restart


3. 根据 OpenVswitch 或 LinuxBridge 的使用情况修改网络桥接配置

  • 3.1 OpenVswitch /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
[ovs]
bridge_mappings = physnet1:br-<eIPoIB interface>
  • 3.2 LinuxBridge 文件 /etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini
[linux_bridge] 
physical_interface_mappings = physnet1:<eIPoIB interface>


注意:为了获得 eIPoIB 接口名称,请运行 ethtool 工具命令(如下所示)并检查驱动程序名称是否为 eth_ipoib

# ethtool -i <eIPoIB_interface> 
driver: eth_ipoib
.....


4. 重新启动网络桥接和 neutron-dhcp-agent

# service neutron-dhcp-agent restart
  • 4.1 OpenVswitch
# service neutron-linuxbridge-agent restart
  • 4.2 LinuxBridge
# service neutron-openvswitch-agent restart

注意:为了支持 DHCP,网络节点应使用 Mellanox Dnsmasq 驱动程序作为 DHCP 驱动程序。

DHCP 服务器(通常是网络节点的一部分)

1. 根据 OVS 或 Linuxbridge 修改 /etc/neutron/dhcp_agent.ini,如下所示

dhcp_driver = mlnx_dhcp.MlnxDnsmasq
dhcp_broadcast_reply = True
# or interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver


2. 启动 DHCP 服务器

# service neutron-dhcp-agent restart


计算节点

要配置计算节点

1 wget http://www.mellanox.com/repository/solutions/openstack/liberty/ubuntu/14.04/python-networking-mlnx_7.0.0-1_all.deb 2.wget http://www.mellanox.com/repository/solutions/openstack/liberty/ubuntu/14.04/eswitchd_1.0.0-18_amd64.deb

Install Mellanox DEB: 
# sudo apt-get install -y neutron-plugin-mlnx neutron-plugin-mlnx-agent 
# sudo dpkg  -i python-networking-mlnx_7.0.0-1_all.deb
# sudo dpkg  -i eswitchd_1.0.0-18_amd64.deb

3. 运行

# initctl start neutron-plugin-mlnx-agent

4. 验证 Mellanox agent 服务的正确名称

# sed -i s/neutron-plugin-mlnx-agent/neutron-mlnx-agent/g /etc/init/neutron-plugin-mlnx-agent.conf

5. 在文件 /etc/neutron/plugins/mlnx/mlnx_conf.ini 中,应将 tenant_network_type 和 network_vlan_ranges 参数配置为控制器

# physical_interface_mappings = physnet1:<ib_interface>(for example physnet1:ib0)

6. 按照以下方式修改文件 /etc/eswitchd/eswitchd.conf

# fabrics = physnet1:<ib_interface> (for example physnet1:ib0)

7. 启动 eSwitchd

# initctl start eswitchd

8. 启动 Neutron agent

# initctl start neutron-plugin-mlnx-agent

9. 重新启动 Nova compute

# service nova-compute restart

已知问题和故障排除

有关已知问题和故障排除选项,请参阅 Mellanox OpenStack 故障排除