RDO是由红帽RedHat公司推出的部署OpenStack集群的一个基于Puppet的部署工具,可以很快地通过RDO部署一套复杂的OpenStack环境,当前的RDO默认情况下,使用Neutron进行网络管理,默认部署的是OpenStack Havana版本。
本文参考:
1、物理环境
双网卡物理机三台、外网路由器一台、内网交换机一台
NIC1接路由器,NIC2接交换机
2、安装操作系统
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
3、修改网卡名称(可选)
采购的物理机器是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
修改完之后重启机器。
4、配置IP地址
主机名 | 角色 | 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
- 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
5、创建cinder-volumes(可选)
这一步可以无需配置,而采用RDO自动设置的分区,但是本环境中控制节点上有一块专用的硬盘/dev/sdb1用来做Cinder存储,所以预先配置
- pvcreate /dev/sdb1
- vgcreate cinder-volumes /dev/sdb1
6、安装Packstack
SSH到controller节点上
- yum install -y http://rdo.fedorapeople.org/openstack/openstack-havana/rdo-release-havana.rpm
- yum install -y openstack-packstack
- yum -y update
7、创建并修改应答文件
- 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
8、执行安装
- packstack --answer-file=venu_answers.txt
9、创建br-ex
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
- vi /etc/sysconfig/network-scripts/ifcfg-eth0
- DEVICE=eth0
- ONBOOT=yes
- HWADDR=D4:AE:52:C4:FF:35
- 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"
10、登陆dashboard
WEB控制台的地址:http://10.68.19.61/dashboard
账号:admin
密码:XXXX(部署成功后会生成一个keystonerc_admin文件,密码在其中)
创建网络、租户、启动第一个实例等,参考:http://www.ustack.com/blog/neutron_intro/
11、TroubleShooting
11.1、VM不能获取IP的问题
这个问题是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
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 #重启服务
没有评论:
发表评论