Mellanox-Neutron-Icehouse-Redhat-InfiniBand
目录
概述
Mellanox Neutron ML2 驱动程序
Mellanox ML2 机制驱动程序实现了 ML2 插件机制驱动程序 API。
该驱动程序支持 Mellanox 嵌入式交换机功能,作为 VPI(以太网/InfiniBand)HCA 的一部分。Mellanox ML2 机制驱动程序提供与 Mellanox Neutron 插件功能上的对等性。
Mellanox ML2 机制驱动程序支持 DIRECT(PCI 直通)和 MACVTAP(具有类似 tap 软件接口的虚拟接口)vnic 类型。有关 vnic 类型配置 API 详情,请参阅配置参考指南(点击 此处)。映射到客户机 VM 的硬件 vNIC 允许更高的性能和高级功能,例如 RDMA(远程直接内存访问)。
该驱动程序支持 VLAN 网络类型,以促进以太网或 InfiniBand 架构上的虚拟网络。
• Mellanox OpenStack Neutron Agent (L2 Agent) 在每个计算节点上运行。
• Agent 应根据 VIF(VM vNIC)和嵌入式交换机端口之间的映射应用 VIF 连接性。
Mellanox Neutron 插件
请注意,Mellanox 插件在 Icehouse 版本中已被弃用,并且在 Juno 版本中将不再支持。该插件中的功能现在以 Mellanox 机制驱动程序的形式包含在 ML2 插件中。
有关 Mellanox Neutron 插件的详细信息,请参阅 https://wiki.openstack.org/wiki/Mellanox-Neutron-Havana-Redhat。
Mellanox Nova VIF 驱动程序
在使用 Mellanox 机制驱动程序时,应使用 Mellanox Nova VIF 驱动程序。VIF 驱动程序通过将类型为 DIRECT 的 vNIC 绑定到嵌入式交换机端口来支持 VIF 插件。Nova libvirt 通用 vif 驱动程序中包含 MACVTAP 类型的 VIF 驱动程序。对于 SR-IOV 直通(vnic 类型 DIRECT),需要使用 Mellanox git 仓库或 RPM 中的 VIF 驱动程序。
先决条件
- 已安装 ML2 插件在 Linux Bridge 之上的运行 OpenStack 环境。
- 所有节点都配备了 Mellanox ConnectX®-3 网络适配器 (http://www.mellanox.com/page/products_dyn?product_family=119)
- 所有节点上都安装了 Mellanox OFED 2.2 或更高版本。请参阅 Mellanox 网站获取最新的 OFED:http://www.mellanox.com/page/products_dyn?product_family=26&mtag=linux_sw_drivers
- 所有计算节点上都启用了 SR-IOV。有关更多信息,请参阅 Mellanox 社区 点击此处。
- 软件包 iproute2 - (http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 ) 安装在所有计算节点上
- 交换机端口上配置了 VLAN。
InfiniBand 网络
Mellanox Neutron 插件使用 InfiniBand 分区(PKeys)来分隔网络。
SM 节点
OpenSM 配置 – 无 UFM
配置 OpenSM
1. 确保所有 PKey 都在 partitions.conf 文件中预定义(/etc/opensm/partitions.conf)。
2. 在 partitions.conf 文件中添加/更改以下内容
management=0xffff,ipoib, sl=0, defmember=full: ALL, ALL_SWITCHES=full,SELF=full;
3. 对于您希望在 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 = default: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
OpenSM 配置 - 有 UFM
配置 OpenSM
1. 确保 UFM 已安装并连接到您的 fabric。
2. 通过更改以下值编辑 /opt/ufm/conf/opensm/opensm.conf
a. 将 allow_both_pkeys 设置为 TRUE(默认情况下 allow_both_pkeys 为 FALSE)
Allow both full and limited membership on the same partition allow_both_pkeys TRUE
b. 将 sm_assign_guid_func 设置为 uniq_count(默认情况下 sm_assign_guid_func 为 base_port)
SM assigned Alias GUIDs algorithm sm_assign_guid_func uniq_count
3. 编辑 UFM 用户扩展 partitions.conf 以覆盖默认分区配置。
a. 编辑文件:/opt/ufm/conf/partitions.conf.user_ext(UFM 安装后应该为空)将以下行添加到该文件以启用完全和有限管理 PKey
management=0xffff,ipoib, sl=0, defmember=both : ALL, ALL_SWITCHES=full,SELF=full;
b. 添加与特定设置相关的其他 PKey 定义。例如
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; vlan10=0xb, ipoib, sl=0, defmember=full: ALL_CAS; vlan10=0xc, ipoib, sl=0, defmember=full: ALL_CAS; vlan10=0xd, ipoib, sl=0, defmember=full: ALL_CAS; vlan10=0xe, ipoib, sl=0, defmember=full: ALL_CAS; vlan10=0xf, ipoib, sl=0, defmember=full: ALL_CAS; vlan10=0x10, ipoib, sl=0, defmember=full: ALL_CAS; vlan10=0x11, ipoib, sl=0, defmember=full: ALL_CAS; vlan10=0x12, ipoib, sl=0, defmember=full: ALL_CAS;
4. 重启 UFM
• 独立
#/etc/init.d/ufmd restart
• 高可用性
#/etc/init.d/ufmha restart
Neutron 服务器节点
配置 Neutron 服务器节点
1. 通过检查 /etc/neutron/neutron.conf 中的 core_plugin 参数,确保 ML2 是当前的 Neutron 插件
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 = linuxbridge,mlnx [ml2_type_vlan] network_vlan_ranges = <network_name>:2:100 [eswitch] vnic_type = hostdev apply_profile_patch = True
4. 启动(或重新启动)Neutron 服务器
#service neutron-server restart
计算节点
要配置计算节点
1. 下载 Mellanox OpenStack 仓库文件
#wget http://www.mellanox.com/downloads/solutions/openstack/icehouse/repo/mlnx-icehouse/mlnx-icehouse.repo -O /etc/yum.repos.d/mlnx-icehouse.repo
2. 安装 eSwitch Daemon (eSwitchd) RPM
#yum install eswitchd
3. 安装 Mellanox VIF 驱动程序
#yum install mlnxvif
3. 安装 Neutron agent 所需的 RPM
#yum install openstack-neutron-mellanox
4. 创建文件 /etc/modprobe.d/mlx4_ib.conf 并添加以下内容
options mlx4_ib sm_guid_assign=0
5. 重启驱动程序
#service openibd restart
6.在文件 /etc/neutron/plugins/mlnx/mlnx_conf.ini 中,应将 tenant_network_type、vnic_type 和 network_vlan_ranges 参数配置为控制器
physical_interface_mapping = default:ib<your_interface>
7. 按照以下方式修改文件 /etc/eswitchd/eswitchd.conf
fabrics = default:ib<your_interface> (for example default:ib0)
8. 验证 Mellanox VIF 驱动程序是否在 /etc/nova/nova.conf 中配置
[libvirt] vif_driver=mlnxvif.vif.MlxEthVIFDriver
9. 重启 Nova
#service openstack-nova-compute restart
10. 启动 eSwitchd
#service eswitchd start
11. 启动 Neutron agent
#service neutron-mlnx-agent start
网络节点
要配置网络节点
1. 确保 eIPoIB 模块已启动并在 /etc/infiniband/openib.conf 中配置:有关更多信息,请参阅 Mellanox OFED 用户手册中的 eIPoIB 配置。
E_IPOIB_LOAD=yes
2. 重新启动 openibd
#service openibd restart
3. 按照以下方式修改文件 /etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini:[linux_bridge] physical_interface_mappings = default:<eIPoIB 接口>
注意:为了获得 eIPoIB 接口名称,请运行 ethtool 工具命令(如下所示)并检查驱动程序名称
#ethtool -i <eIPoIB_interface> driver: eth_ipoib version: 1.0.0 firmware-version: 1 bus-info: ib0 supports-statistics: yes supports-test: no supports-eeprom-access: no supports-register-dump: no supports-priv-flags: no
4. 重启 neutron-linuxbridge-agent 和 neutron-dhcp-agent
#service neutron-linuxbridge-agent restart
注意:为了支持 DHCP,网络节点应使用 Mellanox Dnsmasq 驱动程序作为 DHCP 驱动程序。
DHCP 服务器(通常是网络节点的一部分)
1. 安装 Mellanox Dnsmasq
#wget http://www.mellanox.com/downloads/solutions/openstack/icehouse/repo/mlnx-icehouse/mlnx-dnsmasq-2014.1.1-1.noarch.rpm #yum localinstall mlnx-dnsmasq-2014.1.1-1.noarch.rpm
2. 此外,Dnsmasq 必须升级到版本 2.66 或更高版本
#wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/kalyaka/CentOS_CentOS-6/x86_64/dnsmasq-2.66-3.1.x86_64.rpm
#yum localinstall dnsmasq-2.66-3.1.x86_64.rpm
3. 按照以下方式修改 /etc/neutron/dhcp_agent.ini
dhcp_driver = mlnx_dhcp.MlnxDnsmasq interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
4. 启动 DHCP 服务器
#service neutron-dhcp-agent restart
已知问题和故障排除
有关已知问题和故障排除选项,请参阅 Mellanox OpenStack 故障排除。
参考文献
1. http://www.mellanox.com/openstack/
2. 源代码仓库
4. Mellanox OpenStack 解决方案参考架构
有关更多详细信息,请将您的问题发送至 openstack@mellanox.com
返回到 Mellanox-OpenStack wiki 页面。