硬件环境
虚拟软件:vmware workstation16
操作系统:RockyLinux8
虚拟机硬件配置:
CPU:2
memory:8G
disk:80G
net card:1个—VMnet8
ip/netmask:192.168.9.160/24
下载并安装RockyLinux8.7
进入官网:https://rockylinux.org/
下载连接:https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.7-x86_64-minimal.iso
安装RockyLinux8.7
和常规的CentOS安装一样,只需要分区即可。
网络配置:
[root@openstack ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=eui64
NAME=ens32
UUID=3e99463a-3387-4b09-8e26-e758ee1ed7c1
DEVICE=ens32
ONBOOT=yes
IPADDR=192.168.9.160
PREFIX=24
GATEWAY=192.168.9.2
环境配置
1、设置主机名
hostnamectl set-hostname openstack
2、设置本地名称解析
[root@openstack ~]# echo "192.168.9.160 openstack" >> /etc/hosts
3、禁用SElinux、禁用的防火墙
[root@openstack ~]# setenforce 0
[root@openstack ~]# vi /etc/selinux/config
...
SELINUX=disabled #设置成这样
...
#禁用防火墙
[root@openstack ~]# systemctl stop firewalld
[root@openstack ~]# systemctl disable firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
4、设置网络,这个和CentOS不太一样了,需要注意RockyLinux8不在使用Network来管理网络了,而是更替为NetworkManager服务来管理网络了。
[root@openstack ~]# nmcli connection modify ens32 ipv4.method
auto disabled link-local manual shared #可以看到有很多网络模式去设置,有静态、动态、共享等等
#如下配置:
[root@openstack ~]# nmcli connection modify ens32 ipv4.method manual ipv4.addresses 192.168.9.160/24 ipv4.gateway 192.168.9.2 ipv4.dns 223.5.5.5 autoconnect yes
#是配置生效
[root@openstack ~]# nmcli connection up ens32
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
但是还值得需要注意的是,openstack不允许使用NetworkManager,而是需要使用Network,所以我们还需要安装Network的服务。很搞笑吧,但是没办法!
[root@openstack ~]# dnf install -y network-scripts
#然后禁用掉NetworkManager服务
[root@openstack ~]# systemctl stop NetworkManager
[root@openstack ~]# systemctl disable NetworkManager
Removed /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
Removed /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.
#开启Network服务
[root@openstack ~]# systemctl restart network
[root@openstack ~]# systemctl enable network
5、升级OS
[root@openstack ~]# dnf -y update
[root@openstack ~]# reboot
6、升级完查看系统信息:
[root@openstack ~]# cat /etc/os-release
NAME="Rocky Linux"
VERSION="8.7 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.7"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.7 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.7"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.7"
配置openstack Yoga Yum Reository
1、下载Yum库
第一种方法:
[root@openstack ~]# dnf search openstack
Last metadata expiration check: 0:11:00 ago on Mon 05 Dec 2022 06:50:19 AM EST.
================================================= Name & Summary Matched: openstack ==================================================
centos-release-openstack-train.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-ussuri.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-victoria.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-wallaby.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-xena.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-yoga.noarch : OpenStack from the CentOS Cloud SIG repo configs #搜索到了这个版本
[root@openstack ~]# dnf install -y centos-release-openstack-yoga.noarch #然后直接安装即可
第二种方法:
[root@openstack ~]# dnf -y install https://repos.fedorapeople.org/repos/openstack/openstack-yoga/rdo-release-yoga-1.el8.noarch.rpm
#查看已启动的库
[root@openstack ~]# dnf repolist
repo id repo name
appstream Rocky Linux 8 - AppStream
baseos Rocky Linux 8 - BaseOS
centos-advanced-virtualization CentOS-8 - Advanced Virtualization
centos-ceph-pacific CentOS-8 - Ceph Pacific
centos-nfv-openvswitch CentOS-8 - NFV OpenvSwitch
centos-openstack-yoga CentOS-8 - OpenStack yoga
centos-rabbitmq-38 CentOS-8 - RabbitMQ 38
extras
当然我们可以选择性的安装任意版本:
2、启用powertools库:
[root@openstack ~]# dnf config-manager --enable powertools
3、重建以下缓存
[root@openstack ~]# dnf clean all
[root@openstack ~]# dnf makecache
安装packstack软件包并生成应答文件
[root@openstack ~]# dnf install -y openstack-packstack
那么现在就可以安装openstack了:
[root@openstack ~]# packstack --allinon
但是实际上我们不会直接这样安装,我们会先生成一个应答文件然后自定义安装,这样才符合实际情况。
生成应答文件:
[root@openstack ~]# packstack --gen-answer-file /root/openstack-answer.txt
Packstack changed given value to required value /root/.ssh/id_rsa.pub
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
修改应答文件:有原文件内容修改为如下内容:
CONFIG_HEAT_INSTALL=y #安装heat模板服务
CONFIG_PROVISION_DEMO=n #我们不要提供的demo项目
CONFIG_KEYSTONE_ADMIN_PW=admin #设置登陆密码
CONFIG_NEUTRON_OVN_BRIDGE_IFACES=br-ex:ens32 #OVN端口映射,就是云主机连接外网时通过那块网卡进行数据包的转发
最后就可以安装openstack了
[root@openstack ~]# packstack --answer-file /root/openstack-answer.txt
Welcome to the Packstack setup utility
The installation log file is available at: /var/tmp/packstack/20221205-073938-j2xe350v/openstack-setup.log
#看提示,如果安装时那步出错,查看/var/tmp/packstack/20221205-073938-j2xe350v/openstack-setup.log日志文件