RDO是由红帽RedHat公司推出的部署OpenStack集群的一个基于Puppet的部署工具,可以很快地通过RDO部署一套复杂的OpenStack环境,当前的RDO默认情况下,使用Neutron进行网络管理,默认部署的是OpenStack Havana版本。
本文参考:
1、RDO官方文档:http://openstack.redhat.com/GettingStartedHavana_w_GRE
2、陈沙克博客:http://www.chenshake.com/how-node-installation-centos-6-4-openstack-havana-ovsgre/
双网卡物理机三台、外网路由器一台、内网交换机一台
NIC1接路由器,NIC2接交换机
RDO只支持RedHat或者基于RedHat衍生的Linux版本,如RHEL, Fedora, CentOS等
本环境中使用CentOS6.4的最小化安装
下载地址:http://mirror.bit.edu.cn/centos/6.4/isos/x86_64/CentOS-6.4-x86_64-minimal.iso
采购的物理机器是DELL R410服务器,默认网卡名称为em1、em2,对于习惯了eth的我来说,不太方便,所以修改了一下网卡名称,步骤如下:
修改/etc/udev/rules.d/70-persistent-net.rules
# PCI device 0x14e4:0x163b (bnx2) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d4:ae:53:c4:ff:22", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x14e4:0x163b (bnx2) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d4:ae:53:c4:ff:23", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
重命名并修改网卡配置文件
mv /etc/sysconfig/network-scripts/ifcfg-em1 /etc/sysconfig/network-scripts/ifcfg-eth0
mv /etc/sysconfig/network-scripts/ifcfg-em2 /etc/sysconfig/network-scripts/ifcfg-eth1
将其中的DEVICE=em1改为eth0,DEVICE=em2改为eth1
修改完之后重启机器。
主机名 | 角色 | NIC1 | IP地址(外网) | NIC2 | IP地址(内网) |
controller | 控制节点、网络节点 | eth0 | 10.68.19.61 | eht1 | 50.50.0.11 |
compute01 | 计算节点 | eth0 | 10.68.19.62 | eth1 | 50.50.0.12 |
compute02 | 计算节点 | eth0 | 10.68.19.63 | eth1 | 50.50.0.13 |
NIC1(/etc/sysconfig/network-scripts/ifcfg-eth0)
DEVICE=eth0
TYPE=Ethernet
UUID=bd14706a-5f1c-4d86-a3eb-362b4a89da26
ONBOOT=yes
NM_CONTROLLED="no"
BOOTPROTO=none
IPADDR=10.68.19.61
NETMASK=255.255.255.0
GATEWAY=10.68.19.1
HWADDR=90:B1:1C:23:72:0E
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NIC2(/etc/sysconfig/network-scripts/ifcfg-eth1)
DEVICE=eth1
HWADDR=90:B1:1C:23:72:0F
TYPE=Ethernet
UUID=2f620087-adf5-4bff-acf8-ff20c16fee25
ONBOOT=yes
NM_CONTROLLED="no"
BOOTPROTO=none
IPADDR=50.50.0.11
NETMASK=255.255.255.0
这一步可以无需配置,而采用RDO自动设置的分区,但是本环境中控制节点上有一块专用的硬盘/dev/sdb1用来做Cinder存储,所以预先配置
pvcreate /dev/sdb1
vgcreate cinder-volumes /dev/sdb1
SSH到controller节点上
yum install -y http://rdo.fedorapeople.org/openstack/openstack-havana/rdo-release-havana.rpm
yum install -y openstack-packstack
yum -y update
注意:更新完成之后,重启机器
packstack --gen-answer-file venu_answers.txt
修改以下内容:
CONFIG_CINDER_VOLUMES_CREATE=n
CONFIG_NTP_SERVERS=0.uk.pool.ntp.org
CONFIG_NOVA_COMPUTE_HOSTS=10.68.19.62,10.68.19.63
CONFIG_NEUTRON_OVS_TENANT_NETWORK_TYPE=gre
CONFIG_NEUTRON_OVS_TUNNEL_RANGES=1:1000
CONFIG_NEUTRON_OVS_TUNNEL_IF=eth1
注意:若之前未手动创建cinder-volume的话,请去掉:CONFIG_CINDER_VOLUMES_CREATE=n
packstack --answer-file=venu_answers.txt
安装过程中因为网络原因可能会发生多次中断,重复执行即可。
RDO不会自动创建br-ex,所以需要手动创建,否则,虚拟机不能访问外网
在网络节点(本环境中即控制节点)上进行修改:
vi /etc/sysconfig/network-scripts/ifcfg-br-ex
DEVICE=br-ex
IPADDR=10.68.19.61
PREFIX=16
GATEWAY=10.68.19.1
DNS1=8.8.8.8
ONBOOT=yes
修改NIC1
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
HWADDR=D4:AE:52:C4:FF:35
添加Port并重启网络
ovs-vsctl add-port br-ex eth0; service network restart
正常的网桥信息如下:
[root@controller ~]# ovs-vsctl show
Bridge br-ex
Port br-ex
Interface br-ex
type: internal
Port "eth0"
Interface "eth0"
Bridge br-int
Port br-int
Interface br-int
type: internal
Port patch-tun
Interface patch-tun
type: patch
options: {peer=patch-int}
Bridge br-tun
Port "gre-1"
Interface "gre-1"
type: gre
options: {in_key=flow, local_ip="50.50.0.11", out_key=flow, remote_ip="50.50.0.13"}
Port "gre-2"
Interface "gre-2"
type: gre
options: {in_key=flow, local_ip="50.50.0.11", out_key=flow, remote_ip="50.50.0.12"}
Port patch-int
Interface patch-int
type: patch
options: {peer=patch-tun}
Port br-tun
Interface br-tun
type: internal
ovs_version: "1.11.0"
账号:admin
密码:XXXX(部署成功后会生成一个keystonerc_admin文件,密码在其中)
创建网络、租户、启动第一个实例等,参考:http://www.ustack.com/blog/neutron_intro/
这个问题是OpenStack的经典问题,RDO安装出现这种问题可能性已经小多了,但是还是存在
查看/var/log/neutron/dhcp-agent.log,确认是否有以下错误出现:
2013-11-15 17:18:07.785 9808 WARNING neutron.agent.linux.dhcp [-] FAILED VERSION REQUIREMENT FOR DNSMASQ. DHCP AGENT MAY NOT RUN CORRECTLY! Please ensure that its version is 2.59 or above!
RuntimeError:
2013-11-15 18:02:39.974 9808 TRACE neutron.agent.dhcp_agent Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'add', 'qdhcp-85c85884-3d8f-4f2a-8f81-97f1aa686837']
2013-11-15 18:02:39.974 9808 TRACE neutron.agent.dhcp_agent Exit code: 255
2013-11-15 18:02:39.974 9808 TRACE neutron.agent.dhcp_agent Stdout: ''
2013-11-15 18:02:39.974 9808 TRACE neutron.agent.dhcp_agent Stderr: 'Bind /proc/self/ns/net -> /var/run/netns/qdhcp-85c85884-3d8f-4f2a-8f81-97f1aa686837 failed: No such file or directory\n'
解决办法:下载并安装新版本的dnsmasq
wget http://pkgs.repoforge.org/dnsmasq/dnsmasq-2.65-1.el6.rfx.x86_64.rpm
rpm -Uvh dnsmasq-2.65-1.el6.rfx.x86_64.rpm
创建实例的时候请使用Ubuntu的镜像测试,请勿使用Cirros。
11.2、http://10.68.19.61:5000/v2.0等API接口不能访问
解决办法:
在确认OpenStack其他情况都正常的前提下,检查是否防火墙未开,打开方法:
/sbin/iptables -I INPUT -p tcp --dport 5000 -j ACCEPT #开启5000端口
/etc/rc.d/init.d/iptables save #保存配置
/etc/rc.d/init.d/iptables restart #重启服务