跳转到: 导航, 搜索

Mellanox-Neutron-Icehouse-Ubuntu-InfiniBand

概述

此 wiki 页面描述了如何在 Ubuntu 12.04 服务器上调整 Mellanox OpenStack

先决条件

InfiniBand 网络

OpenSM 节点

配置 OpenSM 节点

1. 编辑文件 /etc/opensm/partitions.conf,添加以下行

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

如果文件不存在,请创建它。

对于 VLAN 网络分段中使用的 VLAN 范围内的每个 VLAN 值,在文件 /etc/opensm/partitions.conf 中添加以下行(用于 vlan-pkey 关联)

vlan<decimal-value>=0x<hexadecimal-value>, ipoib, sl=0, defmember=full: ALL;

在本手册中,VLAN 范围是 2-10 (mlnx_agent.conf /ml2_conf.ini)。因此,添加以下行

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;

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

allow_both_pkeys TRUE

3. 重启 OpenSM

service opensmd restart

4. 验证所有节点上的所有端口是否已激活其 ib 接口(即 ib0),在所有主机上运行 ibdev2netdev,并确保端口已启动

mlx4_0 port 1 ==> ib0 (Up)

如果端口未启动,请尝试通过运行“ifconfig ib0 up”将其启动,并确保您的交换机端口类型为“InfiniBand”,并且所有节点都可以通过运行“sminfo”到达 OpenSM 节点。

控制器节点

要配置控制器节点

1. 确保文件 /etc/nova/nova.conf 包含以下行

security_group_api=nova

2. 如果更改了安全组值,请重启 Nova 服务

# for i in $(initctl list | grep '^nova' | awk '{print $1}'); do service $i restart; done

Neutron 服务器节点

注意:Neutron 服务器有时可以作为控制器节点的一部分。

配置 Neutron 服务器节点

1. 编辑 /etc/neutron/neutron.conf,并确保 Neutron 正在使用 ML2 插件

[DEFAULT]
core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin

2. 按照以下方式编辑 ML2 配置文件 /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=<physical_network>:<min_vlan>:<max_vlan> //(i.e. default:2:10)

[securitygroup]
enable_security_group = True

[eswitch]
vnic_type = hostdev
apply_profile_patch = True

3. 安装适用于 Mellanox Neutron 插件的所需 Deb 包(来自 Ubuntu 仓库)

apt-get install neutron-plugin-mlnx-agent

4. 编辑 /etc/neutron/plugins/mlnx/mlnx_conf.ini 以匹配您的环境

[mlnx]
network_vlan_ranges = <physical_network>:<min_vlan:<max_vlan> //(i.e. default:2:10)
tenant_network_type = vlan

[eswitch]
physical_interface_mappings = <physical_network>:<ib interface>  //(i.e. default:ib0)
vnic_type = hostdev

[agent]
support_old_agents = True

5. 重启 Neutron 服务器

/etc/init.d/neutron-server start

计算节点

要配置计算节点

1. 使用以下行创建文件 /etc/modprobe.d/mlx4_ib.conf

options mlx4_ib sm_guid_assign=0

2. 从此链接下载 mlnxvif、eSwitch Daemon (eSwitchd) 和 mlnx-dnsmasq

http://www.mellanox.com/downloads/solutions/openstack/icehouse/debian/

3. 安装 Mellanox 插件服务 mlnxvif 和 eSwitchd

dpkg –i python-mlnxvif_2014.1.1-1_all.deb
dpkg –i python-eswitchd_0.10-1_all.deb

4. 按照以下方式编辑 /etc/eswitchd/eswitchd.conf

[DAEMON]
fabrics=<physical_network>:<ib-interface> //(i.e. default:ib0)

5. 按照以下方式编辑 /etc/nova/nova.conf

[DEFAULT]
compute_driver = libvirt.LibvirtDriver
libvirt_vif_driver = mlnxvif.vif.MlxEthVIFDriver
security_group_api = nova

6. 检查 “ebrctl” 是否出现在 Nova 的 rootwrap 文件之一中

grep 'ebrctl' /etc/nova/rootwrap.d/*
If “ebrctl” does not appear in one of Nova’s rootwrap files, edit the file /etc/nova/rootwrap.d/compute.filter as follows:
[Filters]
ebrctl: CommandFilter, ebrctl, root

7. 安装 Neutron Mellanox 代理(来自 Ubuntu 仓库)

apt-get install neutron-plugin-mlnx-agent

8. 将 /etc/neutron/plugins/mlnx/mlnx_conf.ini 从 Neutron 服务器节点复制到每个计算节点上的相同路径。

9. 重启以下服务

/etc/init.d/nova-compute restart
/etc/init.d/eswitchd start
/etc/init.d/neutron-plugin-mlnx-agent start

网络节点

要配置网络节点

1. 通过编辑文件 /etc/infiniband/openib.conf 配置 eIPoIB(用于 Linux bridge 插件),如下所示

E_IPOIB_LOAD=yes

2. 重启 OFED

service openibd restart

3. 使用 ibdev2netdev 验证新的以太网接口是否现在出现

# ibdev2netdev
mlx4_0 port 1 ==> ib0 (Up)
mlx4_0 port 2 ==> ib1 (Down)
mlx4_0 port 1 ==> eth2 (Up)
mlx4_0 port 2 ==> eth1 (Down)

在 eIPoIB 中,每个 ib 接口都有一个匹配的 eth 接口。这里使用的 ib 接口是 ib0,匹配的是 eth2(相同的网卡和端口名称:mlx4_0 port 1)。通过使用 Ethtool,您可以验证 ib0 是否正在使用 ib_ipoib 驱动程序工作,并且 eth2 正在使用 eth_ipoib 驱动程序工作,如下所示

# ethtool -i ib0
driver: ib_ipoib
version: 2.3-1.5.4_Sep 30 2014
firmware-version: 2.32.5100
bus-info: 0000:07:00.0# ethtool -i eth2
driver: eth_ipoib
version: 2.3-1.5.4 (Sep 30 2014)
firmware-version: 1
bus-info: ib0

4. 按照以下方式编辑 /etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini

[linux_bridge] 
physical_interface_mappings = <physical_network>:<eth_ipoib-interface> 
//(i.e. default:eth2)

5. 重启 Linux bridge 代理

service neutron-linuxbridge-agent restart

6. 为了允许 DHCP 支持,从此链接下载 mlnx-dnsmadq:http://www.mellanox.com/downloads/solutions/openstack/icehouse/debian/

7. 安装软件包

dpkg –i python-mlnx-dnsmasq_2014.1.1-1_all.deb

8. 配置文件 /etc/neutron/dhcp_agent.ini

[DEFAULT]
dhcp_driver = mlnx_dhcp.MlnxDnsmasq

9. 确保作为 OpenStack 的一部分安装的 Dnsmasq(而不是 mlnx-dnsmasq)环境的版本为 2.65。

10. 将 /etc/neutron/neutron.conf 从计算节点复制到网络节点上的相同路径。

11. 按照以下方式编辑 /etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini

[linux_bridge]  
physical_interface_mappings = <physical_network>:<eth_ipoib interface> 
(i.e. default:eth2)

12. 按照以下方式编辑 /etc/neutron/dhcp_agent.ini 和 /etc/neutron/l3_agent.ini

[DEFAULT] 
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver

13. 重启以下服务

service neutron-plugin-linuxbridge-agent restart
service neutron-dhcp-agent restart
service neutron-l3-agent restart

故障排除

  • 如果您在插件的日志中看到请求超时错误,请确保已启动 eswitchd 服务,并尝试增加插件配置文件中的 request_timeout 值。