使用Packstack搭建OpenStack



使用Packstack搭建OpenStack

0.6732021.01.13 19:15:20字数 297阅读 1,778

一、简介

  • 本次实验环境搭建使用一台物理主机
  • 操作系统节点主机名IP地址网卡
    centos7.6控制节点/网络节点controller192.168.200.200ens33
  • 本次环境涉及到的密码全部为000000

二、基础环境搭建

  • 1、系统配置

image.png
预留一部分磁盘给cinder,swift服务使用
image.png
提前安装虚拟化系统工具
  • 2、更改主机名

[root@localhost ~]# hostnamectl set-hostname controller
1
  • 3、修改/etc/hosts文件

[root@controller ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain
4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain
6
192.168.200.200 controller

1
2
3
4
5
6
7
  • 4、关闭防火墙和SELINUX

[root@controller ~]# systemctl stop firewalld && systemctl disable firewalld
[root@controller ~]# setenforce 0
[root@controller ~]# vim /etc/selinux/config
SELINUX=disabled
1
2
3
4
  • 5、配置节点无密登陆

[root@controller ~]# ssh-keygen
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
[root@controller ~]# ssh-copy-id root@192.168.200.200
1
2
3
4
5
  • 6、配置网络YUN源

[root@controller ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@controller ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@controller ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
1
2
3
替换第三方源。更多源下载请访问:https://developer.aliyun.com/mirror/

三、使用packstack安装openstack

  • 1、配置openstack源

[root@controller yum.repos.d]# vim openstack.repo
[openstack]
name=openstack
baseurl=http://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-stein/
enable=1
gpgcheck=0
1
2
3
4
5
6
[root@controller yum.repos.d]# vim virt.repo
[virt]
name=virt
baseurl=http://mirrors.aliyun.com/centos/7/virt/x86_64/kvm-common/
enable=1
gpgcheck=0
1
2
3
4
5
6
如果后期安装报错,请配置virt源,用以解决qemu-kvm-rhev 版本低于2.10.0
ERROR : Error appeared during Puppet run: 192.168.200.200_compute.pp
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install openstack-nova-migration' returned 1: Error: Package: 1:openstack-nova-compute-18.3.0-1.el7.noarch (openstack)
You will find full trace in log /var/tmp/packstack/20210113-164936-YwkWij/manifests/192.168.200.200_compute.pp.log
1
2
3
  • 2、安装openstack-packstack工具

yum install kernel* -y
yum install openstack-packstack -y
yum install -y python2-qpid-proton-0.22.0-1.el7.x86_64
yum upgrade qemu-kvm-rhev
1
2
  • 3、生成应答文件

[root@controller ~]# packstack --gen-answer-file=demo --default-password=000000
[root@controller ~]# cp demo demo-all
1
2
  • 4、配置应答文件

[root@controller ~]# vim demo-all
CONFIG_NEUTRON_L3_EXT_BRIDGE=br-ex
CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan,flat,gre,vlan
CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vxlan
CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch,linuxbridge
CONFIG_NEUTRON_ML2_FLAT_NETWORKS=external
CONFIG_NEUTRON_ML2_VNI_RANGES=1:1000
CONFIG_NEUTRON_L2_AGENT=openvswitch
CONFIG_NEUTRON_ML2_SRIOV_INTERFACE_MAPPINGS=external:br-ex
CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=external:br-ex
CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:ens33
1
2
3
4
5
6
7
8
9
10
11
  • 5、开始部署

[root@controller ~]# yum -y downgrade leatherman
[root@controller ~]# packstack --answer-file=demo-all
需要等待较长时间
我们需要降级软件包 leatherman,来解决软件兼容性问题
  • 6、验证

在本机关闭防火哦,输入192.168.200.200/dashboard 进行访问登陆。
image.png
8人点赞
更多精彩内容,就在简书APP
"小礼物走一走,来简书关注我"
还没有人赞赏,支持一下
总资产1共写了5.4W字获得60个赞共57个粉丝


yg9538 2022年7月22日 22:48 662 收藏文档