Mellanox-Neutron-Havana-Ubuntu
目录
概述
此 wiki 页面描述了如何在 Ubuntu 12.04 服务器上调整 Mellanox OpenStack
先决条件
您至少需要 3 个节点
- 运行 neutron-server 服务的控制器节点。
- 运行 eswitchd、nova-compute 和 neutron-plugin-mlnx-agent 服务的计算节点。
- 运行 neutron-plugin-linuxbridge-agent、neutron-dhcp-agent 和 neutron-l3-agent 服务的网络节点。
以太网网络
控制器节点
在 /etc/nova/nova.conf 中,请确保有以下行
security_group_api=nova
如果您更改,请重启 nova 服务
# for i in $(initctl list | grep '^nova' | awk '{print $1}'); do service $i restart; done
Neutron 服务器节点
安装
1. Neutron 服务器使用 MySQL 数据库。 确保您拥有运行的 MySQL 数据库用于 neutron。
如果 Neutron 服务器已在运行,则应停止它。
#/etc/init.d/neutron-server stop
如果您想使用已创建的数据库,则必须删除它并创建另一个数据库。例如
mysql -u root -ppassword <<EOF drop database if exists neutron; create database neutron; EOF
如果您想创建一个新的数据库
mysql -u root -ppassword <<EOF drop database if exists neutron; create database neutron; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron' IDENTIFIED BY 'password'; FLUSH PRIVILEGES; EOF
2. 安装 Mellanox Neutron 插件所需的 Deb 包
apt-get install -y neutron-plugin-mlnx-agent
3. 修改 /etc/neutron/plugins/mlnx/mlnx_conf.ini 文件以反映您的环境。
4. 更改 /etc/default/neutron-server
NEUTRON_PLUGIN_CONFIG="/etc/neutron/plugins/mlnx/mlnx_conf.ini"
配置
1. 通过编辑 neutron.conf 并更改 core_plugin,使 Mellanox 插件成为当前的 Neutron 插件。
core_plugin = neutron.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin
2. 插件配置:编辑配置文件:/etc/neutron/plugins/mlnx/mlnx_conf.ini
[MLNX]
tenant_network_type - must be set on of supported tenant network types.
Possible values: 'vlan' for Ethernet or 'ib' for Infiniband.'vlan' is the default.
network_vlan_ranges - must be configured to specify the names of the physical
networks managed by the mellanox plugin,
along with the ranges of VLAN IDs available on each physical network for allocation to virtual networks.
Possible range is vlan range is 1-4093.
The default is "default:1:100"
<fabric name >:<vlan range start>:<vlan end range>
[agent] rpc_support_old_agents = True Note: rpc_support_old_agents should be set to 'True' (non default).
启动服务
启动(或重启)Neutron 服务器
#/etc/init.d/neutron-server start
计算节点
安装
1. 如果您没有下载 Mellanox OpenStack debian 文件,请下载它
http://www.mellanox.com/downloads/solutions/openstack/
2. 安装 eswitchd RPM
dpkg -i eswitchd_0.8-1_amd64.deb dpkg -i python-mlnxvif_0.6-1_all.deb apt-get install -f # fix dependencies apt-get install -y neutron-plugin-mlnx-agent
3. 如果您想以半虚拟化模式使用以太网,VIF 驱动程序已经包含在 Nova 包中。 否则,安装 Mellanox VIF 驱动程序(确保您的服务器上已安装 nova)
配置
1. 如有需要,配置 /etc/eswitchd/eswitchd.conf
请参阅 Mellanox Community 以获取 eSwitchd 安装说明(单击 此处)
2. 修改 /etc/nova/nova.conf
compute_driver=nova.virt.libvirt.driver.LibvirtDriver libvirt_vif_driver=mlnxvif.vif.MlxEthVIFDriver security_group_api=nova connection_type=libvirt
如果您没有安装 Mellanox VIF 驱动程序,并且计划仅以半虚拟化模式使用以太网:更改以下内容
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtGenericVIFDriver
3. 修改 /etc/neutron/plugins/mlnx/mlnx_conf.ini 文件以反映您的环境。
[AGENT]
rpc_support_old_agents = True
[ESWITCH]
physical_interface_mapping - the network_interface_mappings maps each physical network name to the physical interface (on top of Mellanox Adapter) connecting the node to that physical network. The format of this paramter is: <fabric name>:< PF name> (Only releavant on Compute node). PF Name can either be the PF (Physical Function) Name or 'autoeth' for automatic Ethernet configuration,'autoib' for automatic Infiniband configuration.The default is "default:autoeth".
vnic_type - type of VM network interface: 'mlnx_direct' or 'hostdev' according to libvirt terminology.
hostdev: this is the traditional method of assigning any generic PCI device to a guest (SR-IOV).
mlnx_direct: this is a method to provide macvtap device on top of the PCI device (default).
bridge: - When using Linux Bridge Plugin on top of eIPoIB device
daemon_endpoint - 'tcp://127.0.0.1:60001'
有关插件配置文件示例(Havana),请参阅 Mellanox config *ini 文件(单击 此处)
4. (可选)如 LP bug #1257732 中所述,修改 /etc/init/neutron-plugin-mlnx-agent.conf
5. (可选)检查 ebrctl 是否列在 /etc/nova/rootwrap.d/* 中的某个位置,否则将其添加到 /etc/nova/rootwrap.d/compute.filters 文件中的 [Filters] 部分。
ebrctl: CommandFilter, ebrctl, root
启动服务
1. 重启 Nova。
#/etc/init.d/nova-compute restart
2. 启动 eswitch Daemon
#/etc/init.d/eswitchd start
3. 启动 Neutron 代理
#/etc/init.d/neutron-plugin-mlnx-agent start
注意:在启动 Neutron Agent 之前,应启动 eswitch 守护进程。
网络节点
1. 安装 Neutron Linux bridge 插件、Neutron DHCP 代理和 Neutron L3 代理
# apt-get install neutron-plugin-linuxbridge-agent neutron-dhcp-agent neutron-l3-agent
2. 从计算节点复制 /etc/neutron/neutron.conf。
3. 更改 ini 文件(/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini)的以下配置。 示例中的“default”是如 /etc/neutron/plugins/mlnx/mlnx_conf.ini 中配置的物理网络的名称。
[linux_bridge] physical_interface_mappings = default:eth2
4. 按照以下指南配置 DHCP 代理
使用以下内容更新以下文件:/etc/neutron/dhcp_agent.ini
[DEFAULT] interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
有关更多信息,请参阅 OpenStack 文档
5. 按照以下指南配置 L3 代理
使用以下内容更新以下文件:/etc/neutron/l3_agent.ini
[DEFAULT] interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
有关更多信息,请参阅 OpenStack 文档
6. 按照 OpenStack 文档 配置 Metadata 代理
7. 启动 Neutron Linux Bridge、DHCP 和 L3 代理
# restart neutron-plugin-linuxbridge-agent # restart neutron-dhcp-agent # restart neutron-l3-agent # restart neutron-metadata-agent
故障排除
- 如果您在插件的日志中看到请求超时错误,请确保已启动 eswitchd 服务,并尝试增加插件配置文件中的 request_timeout 值。