Centos 8中使用Packstack(RDO)快速安装openstack Victoria版

OpenStack介绍

openstack详细介绍及常用命令请查看此文

通过Packstack(RDO)部署OpenStack,官方文档点击此处查看

安装环境

  • 工具:VMware Workstation 16 Pro

  • 操作系统:CentOS 8.3

  • 虚拟机配置

    • 内存 8G

    • 处理器 6C

    • 磁盘 120G

    • 虚拟化引擎

      以上配置非最低要求,可根据实际情况尝试安装

基础配置

  1. 配置环境

    编辑vim /etc/environment文件,添加以下内容

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

    安装en_US.utf-8语言包

    dnf install glibc-langpack-en -y
    
  2. 设置主机名并配置/etc/hosts文件

    修改主机名

    hostnamectl set-hostname duan
    exec bash
    

    使用echo命令,在/etc/hosts文件中添加本地解析,或者通过vim命令添加

    echo -e "192.166.66.6\tduan" >> /etc/hosts
    
  3. 关闭防火墙并禁止开机自启

    systemctl disable firewalld && systemctl stop firewalld
    
  4. 更换网络服务

    在安装部署OpenStack时,OpenStack的网络服务会与NetworkManager服务产生冲突,二者无法一起正常工作,需要使用Network

    # 安装Network服务
    dnf install network-scripts -y
    # 停用NetworkManager并禁止开机自启
    systemctl stop NetworkManager && systemctl disable NetworkManager
    # 启用 Network并设置开机自启
    systemctl start network && systemctl enable network
    

    更换网络后,远程连接工具可能会断开,建议reboot重启系统,IP可能会发生变化,请查看IP后重新连接远程工具

  5. 设置静态IP

    编辑网络配置文件

    vim /etc/sysconfig/network-scripts/ifcfg-ens33
    

    修改修改并添加以下内容

    # 设为静态
    BOOTPROTO=static
    # 设为开机自动连接
    ONBOOT=yes
    # 添加IP、子网掩码及网关
    IPADDR=192.166.66.6
    NETMASK=255.255.255.0
    GATEWAY=192.166.66.2
    

    重启Network网络服务

    # 重启网络服务
    systemctl restart network
    # 测试是否可访问外网
    ping -c 5 www.baidu.com
    

OpenStack安装

  1. 启用powertools存储库并安装Victoria版openstack

    dnf config-manager --enable powertools
    dnf install centos-release-openstack-victoria -y
    
  2. 更新当前软件包

    dnf update -y
    
  3. 安装paskstack工具

    dnf install openstack-packstack -y
    
  4. 使用packstack命令安装openstack

    packstack --allinone
    

    安装进度由当前网络环境决定,请耐心等待……,此次在出租屋里安装耗时1小时左右

    安装成功会出现“Installation completed successfully”提示,如下

    [root@duan ~]# packstack --allinone
    Welcome to the Packstack setup utility
    
    The installation log file is available at: /var/tmp/packstack/20210225-204839-3dgxy1c1/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 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.166.66.6_controller.pp
    192.166.66.6_controller.pp:                          [ DONE ]
    Applying 192.166.66.6_network.pp
    192.166.66.6_network.pp:                             [ DONE ]
    Applying 192.166.66.6_compute.pp
    192.166.66.6_compute.pp:                             [ DONE ]
    Applying Puppet manifests                            [ DONE ]
    Finalizing                                           [ DONE ]
    
     **** Installation completed successfully ******
    
    Additional information:
     * Parameter CONFIG_NEUTRON_L2_AGENT: You have chosen OVN Neutron backend. Note that this backend does not support the VPNaaS plugin. Geneve will be used as the encapsulation method for tenant networks
     * A new answerfile was created in: /root/packstack-answers-20210225-204841.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.166.66.6. To use the command line tools you need to source the file.
     * To access the OpenStack Dashboard browse to http://192.166.66.6/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/20210225-204839-3dgxy1c1/openstack-setup.log
     * The generated manifests are available at: /var/tmp/packstack/20210225-204839-3dgxy1c1/manifests
    
  5. 通过生成的链接http://192.166.66.6/dashboard访问OpenStack仪表板

    登录账号密码在keystonerc_admin文件中查看

    登录成功页面

    之后就可以使用界面自己玩耍啦,创建卷、快照、镜像、网络、安全组,又或者项目、角色、用户等尽情尝试吧!

    当然也可以使用openstack命令

    使用命令前需要加载环境变量,执行命令source keystonerc_admin. keystonerc_admin

在安装过程中有出现报错:ERROR : Error appeared during Puppet run: 192.166.66.6_controller.pp,导致安装终止,这个报错原因多半是没有/etc/hosts文件中添加本地解析导致,也可能是网络问题,若完全按照上面步骤操作依然出现此报错,建议更换网络试一下

其它方式安装可以参考这三篇文章
Centos 8使用devstack快速安装openstack最新版
Centos 8安装部署openstack Victoria版
Ubuntu 20使用devstack快速安装openstack最新版

posted @ 2021-02-27 00:04  小白典  阅读(1067)  评论(0编辑  收藏  举报