一、实验准备

VM ware Workstation 15/15.5/16

镜像:CentOS-7-x86_64-DVD-2009

实验环境:CentOS 7

open stack版本:train

时间:一天(大概)

二、实验配置

1.创建虚拟机

1
2
3
4
5
内存:8G  //最少这个数
磁盘:100G
时区:中国
安装:最小化
分区:自动

2.关闭防火墙

1
2
systemctl stop firewalld   #防止后续网络测试被防火墙拦截
systemctl disable firewalld

3.关闭seLinux

1
2
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config #与open stack冲突
grep -n 'SELINUX=' /etc/selinux/config

4.关闭网络管理器

1
2
systemctl stop NetworkManager #理由同上
systemctl disable NetworkManager

5.网卡备份和重命名

1
2
3
cd /etc/sysconfig/network-scriprs
cp ifcfg-ens32 ifcfg-ens32.back #备份网卡
mv ifcfg-eno32 ifcfg-eth0 #重命名

6.修改网卡

1
2
3
4
5
6
7
8
9
TYPE=Ethernet	#只要这些,纯手打
BOOTPROTO=static
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=10.0.0.6
NETMASK=255.255.255.0
GATEWAY=10.0.0.2
DNS1=114.114.114.114

7.修改引导

1
2
3
4
5
6
7
vi /etc/default/grub

在GRUB_CMDLINE_LINUX中添加“net.ifnames=0 biosdevname=0”
测试,ping百度能不能ping通,不能就是DNS出错

grub2-mkconfig -o /boot/grub2/grub.cfg #重新引导网络配置文件
#重启使用ip -a命令查看网卡

image-20220811160715137

8.以上操作事项完成后给虚拟机打上快照,并链接克隆一台虚拟机重命名为controller

9.重命名系统及修改hosts文件

1
2
3
4
5
6
7
8
9
10
11
12
13
hostnamectl set hostname controller

vi /etc/hosts

# controller
10.0.0.11 controller #单节点只需要写这一条

# compute
10.0.0.12 compute

修改为ping一下主机名能不能ping通

此处应有一份快照

10.更换阿里源

1
2
3
4
5
cd /etc/yum.repos.d
rm -fr * #删除yum源
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo #载入阿里镜像源
yum clean all #清除
yum makecache #更新

11.下载软件包

1
yum install -y vim net-tools wget bash-completion	#安装vim,net-tools,wget,tab补全

12.安装源

1
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

13.安装RDO

1
yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-train/rdo-release-train-1.noarch.rpm

14.修改RDO源

1
2
3
4
5
6
7
8
9
10
vim /etc/yum.repos.d/rdo-release.repo

#以下为配置文件
[openstack-train]
name=OpenStack Train Repository
baseurl=https://mirrors.aliyun.com/centos/7/cloud/$basearch/openstack-train/
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=cloud-openstack-train
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud

15.安装open stack软件包

1
yum install -y openstack-packstack

16.生成配置文件

1
packstack --gen-answer-file=openstack.ini 

17.修改open stack配置文件

1
2
vim /root/openstack.ini
如下图配置

image-20220811091824355

image-20220811091908343

image-20220811091921441

末尾添加

image-20220811091950158

18.安装open stack

1
packstack --answer-file=/root/openstack.ini

三、遇到的报错及解决方案

leatherman错误

1
yum downgrade leatherman #看需求的安装包版本

python错误

1
yum install python2-qpid-proton-0.26.0-2.el7.x86_64 #安装就行了

四、实验结果

image-20220811161018181