跳转到: 导航, 搜索

Mellanox-Neutron-Ocata-Redhat-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 连接性。

先决条件

  • Red Hat 安装 > 7.1
  • 安装了 ML2 插件(基于 OpenVswitch 或 Linux Bridge (RDO Manager 或 Packstack))的正在运行的 OpenStack 环境。
  • 所有节点均配备 Mellanox ConnectX®-3 / ConnectX®-4 网络适配器。
  • Mellanox OFED 最新 3.X 版本已安装在所有节点上。
  • SR-IOV 在所有计算节点上启用。
  • 软件包 iproute2 安装在所有计算节点上
  • 在每个节点上添加以下仓库
yum -y install yum-plugin-priorities
cd /etc/yum.repos.d/
sudo wget https://trunk.rdoproject.org/centos7-ocata/current/delorean.repo
yum update -y

InfiniBand 网络

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

SM 节点

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

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

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

手动 OpenSM 配置

所有 PKeys 均应在 partitions.conf 文件(/etc/opensm/partitions.conf)中预定义(未来阶段计划自动配置)

对于 ConnectX®-3/ConnectX®-3Pro,请使用以下配置

在 partitions.conf 文件中添加/更改以下内容

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

更改 /etc/opensm/opensm.conf 中的以下内容

  allow_both_pkeys TRUE

对于 ConnectX®-4,请使用以下配置

在 partitions.conf.user_ext 中添加/更改以下内容

vlan1=0x1, ipoib, sl=0, defmember=full: ALL_CAS;
#Storage and management vlan should be define as follow
vlan2=0x2, ipoib, sl=0, defmember=full: ALL_CAS;
vlan3=0x3, ipoib, sl=0, defmember=full: ALL_CAS;
#define OpenSM as a member for all OpenStack vlans. If not guest will have link down on “ibdev2netdev” and no connectivity.
vlan4=0x4, ipoib, sl=0, defmember=full: SELF;
vlan5=0x5, ipoib, sl=0, defmember=full: SELF;
vlan6=0x6, ipoib, sl=0, defmember=full: SELF;
vlan7=0x7, ipoib, sl=0, defmember=full: SELF;
vlan8=0x8, ipoib, sl=0, defmember=full: SELF;
vlan9=0x9, ipoib, sl=0, defmember=full: SELF;
vlan10=0xa, ipoib, sl=0, defmember=full: SELF;

更改 /etc/opensm/opensm.conf 中的以下内容

virt_enabled 2
no_partition_enforcement TRUE
part_enforce FALSE
allow_both_pkeys FALSE

4. 重新启动 OpenSM

# systemctl restart opensmd.service

控制器节点

要配置控制器节点

1. 安装 Mellanox RPM

# yum install -y --nogpgcheck python-networking-mlnx 

Neutron 服务器

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

core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin

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

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

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

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

# systemctl restart neutron-server.service

Nova Scheduler

启用 PciPassthroughFilter,修改 /etc/nova/nova.conf

 scheduler_available_filters = nova.scheduler.filters.all_filters
 scheduler_default_filters = RetryFilter, AvailabilityZoneFilter, RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, PciPassthroughFilter

网络节点

要配置网络节点

先决条件

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/ml2/openvswitch_agent.ini
[ovs]
bridge_mappings = default:br-<eIPoIB interface>
  • 3.2 LinuxBridge 文件 /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge] 
physical_interface_mappings = default:<eIPoIB interface>


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

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


4. 重新启动网络桥接

  • 4.1 OpenVswitch
systemctl restart neutron-openvswitch-agent.service
  • 4.2 LinuxBridge(如果使用 linux bridge)
# service neutron-linuxbridge-agent restart


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

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

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

dhcp_driver = networking_mlnx.dhcp.mlnx_dhcp.MlnxDnsmasq
dhcp_broadcast_reply = True
1.1 For OVS
    interface_driver =  neutron.agent.linux.interface.OVSInterfaceDriver
1.2 For Linux Bridge
     interface_driver =  neutron.agent.linux.interface.BridgeInterfaceDriver


2. 重新启动 DHCP 服务器

# systemctl restart neutron-dhcp-agent.service

计算节点

要配置计算节点

1. 安装 Mellanox RPM

# yum install --nogpgcheck -y python-networking-mlnx

2. 创建文件 /etc/modprobe.d/mlx4_ib.conf 并添加以下内容

options mlx4_ib sm_guid_assign=0

3. 重新启动驱动程序

# /etc/init.d/openibd restart

Nova Compute

Nova-compute 需要知道允许传递到 VM 的 PCI 设备。 此外,对于 SRIOV PCI 设备,它需要知道 VF 属于哪个物理网络。 这通过 /etc/nova/nova.conf 中默认部分下的 pci_passthrough_whitelist 参数来完成。 例如,如果我们要通过其 PCI 地址白名单和标记 VF,我们将使用以下设置:[pci] passthrough_whitelist = {"address":"*:0a:00.*","physical_network":"default"} 这会将地址包含 ':0a:00.' 的任何 VF 关联到物理网络默认。

1. 将 pci passthrough_whitelist 添加到 /etc/nova/nova.conf

2. 重新启动 Nova

# systemctl restart openstack-nova-compute

Neutron MLNX Agent

1. 运行

# systemctl enable neutron-mlnx-agent.service
# systemctl start neutron-mlnx-agent.service

2. 运行

# systemctl daemon-reload

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

physical_interface_mappings = default:<ib_interface>(for example default:ib0)

4. 修改文件 /etc/neutron/plugins/ml2/eswitchd.conf,如下所示

fabrics = default:<ib_interface> (for example default:ib0)

5. 启动 eSwitchd

# systemctl enable eswitchd.service
# systemctl start  eswitchd.service

6. 启动 Neutron agent

# systemctl restart neutron-mlnx-agent

已知问题和故障排除

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

问题:所有节点(控制器/计算)上缺少 zmq 包解决方案

 # wget https://bootstrap.pypa.io/get-pip.py
 # sudo python get-pip.py
 # sudo pip install pyzmq