centos7 Packstack allinone安装openstack

centos7 Packstack allinone安装openstack
Packstack是一种用于自动化部署OpenStack环境的工具,它可以快速安装和配置OpenStack的各个组件,同时提供了一些默认设置以方便快速上手。
All-in-One模式是Packstack的一种安装模式,它在一台物理或虚拟机上部署了所有OpenStack的核心组件,包括计算节点、网络节点和存储节点,适用于小规模的测试和开发环境。
1.环境准备
修改主机名
[root@centos7 ~]# hostnamectl set-hostname openstack


[root@openstack ~]# echo "192.168.162.128 openstack" >>/etc/hosts
[root@openstack ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.162.128 openstack

配置固定IP
[root@centos7 ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
IPADDR=192.168.162.128
NETMASK=255.255.255.0
GATEWY=192.168.162.2

重启网络服务
[root@centos7 ~]# systemctl restart network


停止关闭防火墙
systemctl stop firewalld && systemctl disable firewalld

关闭selinux
vim /etc/selinux/config
SELINUX=disabled

NetworkManager与OpenStack组件Neutron有冲突,用传统的网络服务network来管理网络。执行命令停用NetworkManager服务。
systemctl stop NetworkManager && systemctl disable NetworkManager
2.安装软件
更新软件
[root@openstack ~]# yum -y update

查看版本
[root@openstack ~]# yum search centos-release-openstack
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
============================================= N/S matched: centos-release-openstack =============================================
centos-release-openstack-queens.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-rocky.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-stein.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-train.noarch : OpenStack from the CentOS Cloud SIG repo configs

  Name and summary matches only, use "search all" for everything.
  
安装
[root@openstack ~]# yum -y install centos-release-openstack-train

3.安装Packstack
更新软件
[root@openstack ~]# yum -y update
安装packstack
[root@openstack ~]# yum -y install openstack-packstack
安装openstack
[root@openstack ~]# packstack --allinone
Welcome to the Packstack setup utility

The installation log file is available at: /var/tmp/packstack/20240324-161654-Aj_Jrt/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.168.162.128_controller.pp
192.168.162.128_controller.pp:                       [ DONE ]
Applying 192.168.162.128_network.pp
192.168.162.128_network.pp:                          [ DONE ]
Applying 192.168.162.128_compute.pp
192.168.162.128_compute.pp:                          [ DONE ]
Applying Puppet manifests                            [ DONE ]
Finalizing                                           [ DONE ]

 **** Installation completed successfully ******



报错1:
ERROR:scss.ast:Function not found: function-exists:1")
解决步骤:
https://www.codenong.com/js34fba2365a76/

报错2:
ERROR : Error appeared during Puppet run: 192.168.162.128_controller.pp
Error: Could not unmask neutron-server:
You will find full trace in log /var/tmp/packstack/20240324-150136-xyHCho/manifests/192.168.162.128_controller.pp.log
Please check log file /var/tmp/packstack/20240324-150136-xyHCho/openstack-setup.log for more information
Additional information:
 * Parameter CONFIG_NEUTRON_L2_AGENT: You have chosen OVN Neutron backend. Note that this backend does not support the VPNaaS orFWaaS services. Geneve will be used as the encapsulation method for tenant networks
解决步骤:
https://www.cnblogs.com/jason-huawen/p/17041681.html
4.登录openstack页面
访问页面
http://192.168.162.128/dashboard

账号密码见本地keystonerc_admin文件中;
[root@openstack ~]# cat keystonerc_admin
unset OS_SERVICE_TOKEN
    export OS_USERNAME=admin
    export OS_PASSWORD='c8e13b4d128b47f6'
    export OS_REGION_NAME=RegionOne
    export OS_AUTH_URL=http://192.168.162.128:5000/v3
    export PS1='[\u@\h \W(keystone_admin)]\$ '

export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_IDENTITY_API_VERSION=3

执行openstack命令需先加载加载环境变量
[root@openstack ~]# ls
anaconda-ks.cfg  Documents  initial-setup-ks.cfg  keystonerc_demo  packstack-answers-20240324-161655.txt  Public     Videos
Desktop          Downloads  keystonerc_admin      Music            Pictures                               Templates
加载环境变量
[root@openstack ~]# source keystonerc_admin
查看卷
[root@openstack ~(keystone_admin)]# cinder list
+----+--------+------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+----+--------+------+------+-------------+----------+-------------+
+----+--------+------+------+-------------+----------+-------------+
查看计算信息
[root@openstack ~(keystone_admin)]# nova list
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
查看镜像
[root@openstack ~(keystone_admin)]# glance image-list
+--------------------------------------+--------+
| ID                                   | Name   |
+--------------------------------------+--------+
| 456b3be8-a8ad-428a-bf91-bd875504f48c | cirros |
+--------------------------------------+--------+




关注小张的知识杂货铺,让我们一起学习一起进步

posted @ 2024-03-24 17:11  小张1995  阅读(1086)  评论(0)    收藏  举报