在CentOS7中使用RDO安装OpenStack-Stein-AIO

本文最后更新于:January 2, 2020 pm

本文主要记录了在CentOS7.7系统(物理机)下使用红帽官方的RDO工具进行OpenStack的all-in-one模式部署。关于宿主机的,在之前的文章中已经做过了详细的介绍和测试,这里不再赘述,有兴趣的同学可以点击这里查看。

1、RDO简介

我们先来看一下官网的介绍:

RDO is a community of people using and deploying OpenStack on CentOS, Fedora, and Red Hat Enterprise Linux. We have documentation to help get started, mailing lists where you can connect with other users, and community-supported packages of the most up-to-date OpenStack releases available for download.

简单来说RDO就是红帽推出的一个针对红帽系的操作系统(RHEL、CentOS、Fedora)的简化OpenStack安装的工具,定位类似于RHEL和Fedora的关系,是属于社区维护的免费版(也有类似RHEL的付费支持版),目前支持到最新的Stein版本的OpenStack的自动安装,而OpenStack的开发进度目前是处于Train版本。

RDO和devstack的区别

  • devstack是由openstack官方进行维护的,而RDO是由红帽发起的,通过开源社区进行维护
  • devstack支持ubuntu、红帽系和opensuse三大主流的Linux操作系统,而RDO只支持红帽系
  • 红帽系Linux部署OpenStack个人推荐使用RDO

2、部署安装

官网的安装说明链接: https://www.rdoproject.org/install/packstack/

2.1 硬件要求

部署仅支持64位操作系统,要求系统内存最少为16G,最少有一个网卡,最好为静态IP,且需要开启CPU虚拟化支持。

2.2 环境语言设置

如果CentOS的默认语言选择的是非英语,需要在 /etc/environment 文件中修改:

1
2
LANG=en_US.utf-8
LC_ALL=en_US.utf-8

2.3 RDO库要求

Enabling the Optional, Extras, and RH Common channels on RHEL

If using RHEL it is assumed that you have registered your system using Red Hat Subscription Management and that you have the rhel-7-server-rpms repository enabled by default. RDO also needs the Optional, Extras, and RH Common channels to be enabled:

1
2
$ sudo subscription-manager repos --enable=rhel-7-server-optional-rpms \
--enable=rhel-7-server-extras-rpms --enable=rhel-7-server-rh-common-rpms

The Optional channel does not exist in CentOS or Scientific Linux. The required packages are included in the main repositories for those distributions. Extras is enabled by default on CentOS 7.

对于CentOS7而言,只需要用到自带的主要的main和extras两个库,也就是默认的/etc/yum.repos.d/CentOS-Base.repo[base][extras]两个库,有需要的同学可以自行换成国内的镜像源如阿里、网易、清华、中科大等镜像源来提高速度。

2.4 网络设置

这里需要配置网卡为静态IP,禁用防火墙,然后把默认的网络管理工具从NetworkManager换成network

1
2
3
4
5
6
sudo systemctl disable firewalld
sudo systemctl stop firewalld
sudo systemctl disable NetworkManager
sudo systemctl stop NetworkManager
sudo systemctl enable network
sudo systemctl start network

2.5 部署安装

1
2
3
4
5
6
7
8
9
10
# 安装OpenStack需要使用的yum仓库并确保仓库已经被正常启用
# 这里使用的是RDO支持的最新的stein版本,需要旧版本的可以在这里查找: http://rdoproject.org/repos/
sudo yum install -y centos-release-openstack-stein
sudo yum-config-manager --enable openstack-stein
# 更新yum源
sudo yum update -y
# 安装packstack
sudo yum install -y openstack-packstack
# 使用packstack安装OpenStack
sudo packstack --allinone

接下来的部署安装就十分简单了,只需要保证系统和网络正常,然后耐心等待,根据电脑的性能不同,安装的时间也不尽相同,我大概是花了15分钟左右就一次部署成功。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
  [root@tiny-openstack ~]# sudo packstack --allinone
Welcome to the Packstack setup utility

The installation log file is available at: /var/tmp/packstack/20200102-115042-h_xYXR/openstack-setup.log
Packstack changed given value to required value /root/.ssh/id_rsa.pub

Installing:
Clean Up [ DONE ]
Discovering ip protocol version [ DONE ]
Setting up ssh keys [ DONE ]
Preparing servers [ DONE ]
Pre installing Puppet and discovering hosts' details [ DONE ]
Preparing pre-install entries [ DONE ]
Setting up CACERT [ DONE ]
Preparing AMQP entries [ DONE ]
Preparing MariaDB entries [ DONE ]
Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
Preparing Keystone entries [ DONE ]
Preparing Glance entries [ DONE ]
Checking if the Cinder server has a cinder-volumes vg[ DONE ]
Preparing Cinder entries [ DONE ]
Preparing Nova API entries [ DONE ]
Creating ssh keys for Nova migration [ DONE ]
Gathering ssh host keys for Nova migration [ DONE ]
Preparing Nova Compute entries [ DONE ]
Preparing Nova Scheduler entries [ DONE ]
Preparing Nova VNC Proxy entries [ DONE ]
Preparing OpenStack Network-related Nova entries [ DONE ]
Preparing Nova Common entries [ DONE ]
Preparing Neutron LBaaS Agent entries [ DONE ]
Preparing Neutron API entries [ DONE ]
Preparing Neutron L3 entries [ DONE ]
Preparing Neutron L2 Agent entries [ DONE ]
Preparing Neutron DHCP Agent entries [ DONE ]
Preparing Neutron Metering Agent entries [ DONE ]
Checking if NetworkManager is enabled and running [ DONE ]
Preparing OpenStack Client entries [ DONE ]
Preparing Horizon entries [ DONE ]
Preparing Swift builder entries [ DONE ]
Preparing Swift proxy entries [ DONE ]
Preparing Swift storage entries [ DONE ]
Preparing Gnocchi entries [ DONE ]
Preparing Redis entries [ DONE ]
Preparing Ceilometer entries [ DONE ]
Preparing Aodh entries [ DONE ]
Preparing Puppet manifests [ DONE ]
Copying Puppet modules and manifests [ DONE ]
Applying 192.168.100.90_controller.pp
Testing if puppet apply is finished: 192.168.100.90_controller.pp [ - ]
192.168.100.90_controller.pp: [ DONE ]
Applying 192.168.100.90_network.pp
192.168.100.90_network.pp: [ DONE ]
Applying 192.168.100.90_compute.pp
192.168.100.90_compute.pp: [ DONE ]
Applying Puppet manifests [ DONE ]
Finalizing [ DONE ]

​ Installation completed successfully **

Additional information:

* Parameter CONFIG_NEUTRON_L2_AGENT: You have choosen OVN neutron backend. Note that this backend does not support LBaaS, VPNaaS or FWaaS services. Geneve will be used as encapsulation method for tenant networks
* A new answerfile was created in: /root/packstack-answers-20200102-115042.txt
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
* File /root/keystonerc_admin has been created on OpenStack client host 192.168.100.90. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.100.90/dashboard .

Please, find your login credentials stored in the keystonerc_admin in your home directory.
* The installation log file is available at: /var/tmp/packstack/20200102-115042-h_xYXR/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20200102-115042-h_xYXR/manifests

2.6 登录运行

留意上面的安装完成提示,我们可以获得几个重要信息:

  • dashboard的登录链接一般就是http://你用来部署OpenStack的网卡IP/dashboard
  • 登录的账号密码文件在home目录下的keystonerc_admin文件,一般使用root账户部署,所以应该是在/root/
  • 部署的配置文件是/root/packstack-answers-20200102-115042.txt,根据部署的时间不同,后面的数字会不一样,这个answer-file可以用于下次继续部署,只要在部署的时候使用 --answer-file 选项即可