Mellanox-Neutron-Juno-Redhat-InfiniBand
目录
概述
Mellanox Neutron ML2 驱动程序
Mellanox ML2 机制驱动程序实现了 ML2 插件机制驱动程序 API。
该驱动程序支持 Mellanox 嵌入式交换机功能,作为 VPI(以太网/InfiniBand)HCA 的一部分。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 连接性。
Mellanox Neutron 插件
有关 Mellanox Neutron 插件的详细信息,请参阅 https://wiki.openstack.org/wiki/Mellanox-Neutron-Havana-Redhat。
先决条件
- 安装了 ML2 插件在 OpenVswitch 或 Linux Bridge 之上的运行中的 OpenStack 环境。
- 所有节点都配备了,Mellanox ConnectX®-3/Mellanox ConnectX®-3 PRO 网络适配器
- Mellanox OFED 2.4 或更高版本安装在所有节点上。
- 在所有计算节点上启用 SR-IOV。有关更多信息,请参阅 Mellanox 社区:[1]。
- 软件包 iproute2 安装在所有计算节点上
- 添加仓库
yum-config-manager --add-repo http://www.mellanox.com/repository/solutions/openstack/juno/rhel7/
InfiniBand 网络
Mellanox Neutron 插件使用 InfiniBand 分区(PKeys)来分隔网络。
SM 节点
OpenSM 配置 – 无 UFM
所有 PKeys 均应在 partitions.conf 文件(/etc/opensm/partitions.conf)中预定义(未来阶段计划自动配置)
在 partitions.conf 文件中添加/更改以下内容
management=0x7fff,ipoib, sl=0, defmember=full : ALL, ALL_SWITCHES=full,SELF=full;
对于您希望在 Neutron 中配置的每个网络,您必须配置与该网络 VLAN(在 Neutron 中定义)关联的 pkey。
vlan1=0x1, ipoib, sl=0, defmember=full : ALL;
例如:如果我们在 /etc/neutron/plugins/mlnx/mlnx_conf.ini 中定义了 10 个 VLAN
[MLNX] network_vlan_ranges = default:1:10
我们将得到 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
4. 重新启动 OpenSM
# systemctl restart opensmd.service
RDO安装
安装和配置packstack
1. 安装packstack
# yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm # yum install -y openstack-packstack
2. 准备应答文件
# packstack --gen-answer-file=packstack.sriov
3. 修改应答文件
CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-enp3s0 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-enp3s0:enp3s0 CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vlan CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vlan CONFIG_NEUTRON_ML2_VLAN_RANGES=physnet1:1:10 CONFIG_NEUTRON_L2_AGENT=openvswitch
4. 运行 packstack
# packstack --answer-file=packstack.sriov
控制器节点
要配置控制器节点
1. 使用 Mellanox OpenStack Juno 仓库配置 yum
# yum-config-manager --add-repo http://www.mellanox.com/repository/solutions/openstack/juno/rhel7
2. 安装 Mellanox RPM 包
# yum install -y --nogpgcheck openstack-neutron-mellanox eswitchd mlnx-dnsmasq
3. 编辑以下文件:/usr/lib/systemd/system/neutron-mlnx-agent.service
Change the /etc/neutron/plugins/mlnx/mlnx.ini to /etc/neutron/plugins/mlnx/mlnx_conf.ini
4. 运行
# systemctl enable neutron-mlnx-agent.service
5. 运行
# systemctl daemon-reload
6. 确认 ML2 是当前的 Neutron 插件,方法是检查 /etc/neutron/neutron.conf 中的 core_plugin 参数
core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
7. 确保 /etc/neutron/plugin.ini 指向 /etc/neutron/plugins/ml2/ml2_conf.ini(符号链接)
8. 通过添加以下内容修改 /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 [eswitch] # (StrOpt) Type of Network Interface to allocate for VM: # mlnx_direct or hostdev according to libvirt terminology vnic_type = hostdev
9. 启动(或重启)Neutron 服务器
# systemctl restart neutron-server.service
网络节点
要配置网络节点
先决条件
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-openvswitch-agent restart
- 4.2 LinuxBridge
# service neutron-linuxbridge-agent restart
注意:为了支持 DHCP,网络节点应使用 Mellanox Dnsmasq 驱动程序作为 DHCP 驱动程序。
DHCP 服务器(通常是网络节点的一部分)
1. 根据 OVS 或 Linuxbridge 修改 /etc/neutron/dhcp_agent.ini,如下所示
dhcp_driver = mlnx_dhcp.MlnxDnsmasq
- 1.1 OVS
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
- 1.2 LinuxBridge
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
2. 启动 DHCP 服务器
# systemctl restart neutron-dhcp-agent.service
计算节点
要配置计算节点
1.使用 Mellanox OpenStack Juno 仓库配置 yum
# yum-config-manager --add-repo http://www.mellanox.com/repository/solutions/openstack/juno/rhel7
2. 安装 Mellanox RPM 包
modify gpgcheck=0 in /etc/yum.conf # yum install -y openstack-neutron-mellanox eswitchd mlnx-dnsmasq
3. 编辑以下文件:/usr/lib/systemd/system/neutron-mlnx-agent.service
Change the /etc/neutron/plugins/mlnx/mlnx.ini to /etc/neutron/plugins/mlnx/mlnx_conf.ini
4. 运行
# systemctl enable neutron-mlnx-agent.service
5. 运行
# systemctl daemon-reload
6. 应用 MLNX Juno 补丁
# pushd /usr/lib/python2.7/site-packages/nova/virt/libvirt/ # wget http://www.mellanox.com/repository/solutions/openstack/juno/patch/mlnx_juno.patch # patch < mlnx_juno.patch # popd
7. 创建文件 /etc/modprobe.d/mlx4_ib.conf 并添加以下内容
options mlx4_ib sm_guid_assign=0
8. 重启 Nova
# systemctl restart openstack-nova-compute
9. 重启驱动程序
# /bin/systemctl restart opensm.service # /etc/init.d/openibd restart
10. 在文件 /etc/neutron/plugins/mlnx/mlnx_conf.ini 中,应将 tenant_network_type 和 network_vlan_ranges 参数配置为控制器
physical_interface_mappings = physnet1:<ib_interface>(for example physnet1:ib0)
11. 按照以下方式修改文件 /etc/eswitchd/eswitchd.conf
fabrics = physnet1:<ib_interface> (for example physnet1:ib0)
12. 启动 eSwitchd
# systemctl restart eswitchd
13. 启动 Neutron agent
# systemctl restart neutron-mlnx-agent
已知问题和故障排除
有关已知问题和故障排除选项,请参阅 Mellanox OpenStack 故障排除
https://ask.openstack.org/en/question/63711/rdo-quickstart-juno-release-guide-for-fedora-20/ https://bugzilla.redhat.com/show_bug.cgi?id=1203744 https://bugs.launchpad.net/keystone/+bug/1457747