步骤1:修改主机名并更新域名解析文件
Last login: Wed Nov 11 13:46:10 2020 [root@localhost ~]# hostnamectl set-hostname "openstack.example.com" [root@localhost ~]# exec bash [root@openstack ~]# hostnamectl Static hostname: openstack.example.com Icon name: computer-vm Chassis: vm Machine ID: bf6e29e6a6de4e1b905b39e6ce142867 Boot ID: 0e5bce586aad4838a23b2d2d5a977702 Virtualization: vmware Operating System: CentOS Linux 8 (Core) CPE OS Name: cpe:/o:centos:centos:8 Kernel: Linux 4.18.0-193.el8.x86_64 Architecture: x86-64 [root@openstack ~]#
在/etc/hosts配置文件中添加主机映射关系
[root@openstack ~]# echo -e "192.168.1.126\topenstack.example.com" >> /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.1.126 openstack.example.com [root@openstack ~]#
步骤2:禁用NetworkManager并使用network-scripts配置网络
[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-scripts
[root@openstack ~]# dnf install -y network-scripts Last metadata expiration check: 0:02:13 ago on Wed 11 Nov 2020 01:56:08 PM CST. Dependencies resolved. ============================================================================================================================== Package Architecture Version Repository Size ==============================================================================================================================Installing: network-scripts x86_64 10.00.6-1.el8_2.2 BaseOS 195 k Upgrading: initscripts x86_64 10.00.6-1.el8_2.2 BaseOS 338 k Installing weak dependencies: network-scripts-team x86_64 1.29-1.el8_2.2 BaseOS 27 k Transaction Summary ==============================================================================================================================Install 2 Packages Upgrade 1 Package Total download size: 560 k Downloading Packages: (1/3): network-scripts-10.00.6-1.el8_2.2.x86_64.rpm 1.6 MB/s | 195 kB 00:00 (2/3): network-scripts-team-1.29-1.el8_2.2.x86_64.rpm 215 kB/s | 27 kB 00:00 (3/3): initscripts-10.00.6-1.el8_2.2.x86_64.rpm 2.1 MB/s | 338 kB 00:00 ------------------------------------------------------------------------------------------------------------------------------Total 749 kB/s | 560 kB 00:00 warning: /var/cache/dnf/BaseOS-929b586ef1f72f69/packages/network-scripts-10.00.6-1.el8_2.2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY CentOS-8 - Base 1.6 MB/s | 1.6 kB 00:00 Importing GPG key 0x8483C65D: Userid : "CentOS (CentOS Official Signing Key) <security@centos.org>" Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D From : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: initscripts-10.00.6-1.el8_2.2.x86_64 1/1 Upgrading : initscripts-10.00.6-1.el8_2.2.x86_64 1/4 Running scriptlet: initscripts-10.00.6-1.el8_2.2.x86_64 1/4 Installing : network-scripts-10.00.6-1.el8_2.2.x86_64 2/4 Running scriptlet: network-scripts-10.00.6-1.el8_2.2.x86_64 2/4 Installing : network-scripts-team-1.29-1.el8_2.2.x86_64 3/4 Running scriptlet: initscripts-10.00.6-1.el8.x86_64 4/4 Cleanup : initscripts-10.00.6-1.el8.x86_64 4/4 Running scriptlet: initscripts-10.00.6-1.el8.x86_64 4/4 Verifying : network-scripts-10.00.6-1.el8_2.2.x86_64 1/4 Verifying : network-scripts-team-1.29-1.el8_2.2.x86_64 2/4 Verifying : initscripts-10.00.6-1.el8_2.2.x86_64 3/4 Verifying : initscripts-10.00.6-1.el8.x86_64 4/4 Upgraded: initscripts-10.00.6-1.el8_2.2.x86_64 Installed: network-scripts-10.00.6-1.el8_2.2.x86_64 network-scripts-team-1.29-1.el8_2.2.x86_64 Complete! [root@openstack ~]#
[root@openstack ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens32 [root@openstack ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static DEFROUTE=yes NAME=ens32 DEVICE=ens32 ONBOOT=yes IPADDR=192.168.1.100 PREFIX=24 GATEWAY=192.168.1.1 DNS=192.168.1.1 [root@openstack ~]# [root@openstack ~]# systemctl restart network [root@openstack ~]# systemctl enable network network.service is not a native service, redirecting to systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install enable network [root@openstack ~]# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:0c:29:d4:a5:69 brd ff:ff:ff:ff:ff:ff inet 192.168.1.100/24 brd 192.168.1.255 scope global ens32 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fed4:a569/64 scope link valid_lft forever preferred_lft forever [root@openstack ~]# ip a s ens32 2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:0c:29:d4:a5:69 brd ff:ff:ff:ff:ff:ff inet 192.168.1.100/24 brd 192.168.1.255 scope global ens32 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fed4:a569/64 scope link valid_lft forever preferred_lft forever
步骤3:启用OpenStack repositories并安装packstack工具
[root@openstack ~]# dnf config-manager --enable PowerTools [root@openstack ~]# dnf install -y centos-release-openstack-ussuri Last metadata expiration check: 0:08:40 ago on Wed 11 Nov 2020 02:07:30 PM CST. No match for argument: centos-release-openstack-victoria Error: Unable to find a match: centos-release-openstack-victoria [root@openstack ~]# dnf install -y centos-release-openstack-ussuri Last metadata expiration check: 0:11:10 ago on Wed 11 Nov 2020 02:07:30 PM CST. Dependencies resolved. ============================================================================================================================== Package Architecture Version Repository Size ==============================================================================================================================Installing: centos-release-openstack-ussuri noarch 1-3.el8 extras 11 k Installing dependencies: centos-release-ceph-nautilus noarch 1.2-2.el8 extras 8.8 k centos-release-messaging noarch 1-2.el8 extras 9.4 k centos-release-rabbitmq-38 noarch 1-2.el8 extras 8.3 k centos-release-storage-common noarch 2-2.el8 extras 9.4 k Transaction Summary ==============================================================================================================================Install 5 Packages Total download size: 47 k Installed size: 12 k Downloading Packages: (1/5): centos-release-openstack-ussuri-1-3.el8.noarch.rpm 313 kB/s | 11 kB 00:00 (2/5): centos-release-messaging-1-2.el8.noarch.rpm 195 kB/s | 9.4 kB 00:00 (3/5): centos-release-ceph-nautilus-1.2-2.el8.noarch.rpm 177 kB/s | 8.8 kB 00:00 (4/5): centos-release-rabbitmq-38-1-2.el8.noarch.rpm 592 kB/s | 8.3 kB 00:00 (5/5): centos-release-storage-common-2-2.el8.noarch.rpm 2.1 MB/s | 9.4 kB 00:00 ------------------------------------------------------------------------------------------------------------------------------Total 93 kB/s | 47 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : centos-release-storage-common-2-2.el8.noarch 1/5 Installing : centos-release-ceph-nautilus-1.2-2.el8.noarch 2/5 Running scriptlet: centos-release-ceph-nautilus-1.2-2.el8.noarch 2/5 Installing : centos-release-messaging-1-2.el8.noarch 3/5 Installing : centos-release-rabbitmq-38-1-2.el8.noarch 4/5 Installing : centos-release-openstack-ussuri-1-3.el8.noarch 5/5 Verifying : centos-release-ceph-nautilus-1.2-2.el8.noarch 1/5 Verifying : centos-release-messaging-1-2.el8.noarch 2/5 Verifying : centos-release-openstack-ussuri-1-3.el8.noarch 3/5 Verifying : centos-release-rabbitmq-38-1-2.el8.noarch 4/5 Verifying : centos-release-storage-common-2-2.el8.noarch 5/5 Installed: centos-release-ceph-nautilus-1.2-2.el8.noarch centos-release-messaging-1-2.el8.noarch centos-release-openstack-ussuri-1-3.el8.noarch centos-release-rabbitmq-38-1-2.el8.noarch centos-release-storage-common-2-2.el8.noarch Complete! [root@openstack ~]#
[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. [root@openstack ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config [root@openstack ~]# [root@openstack ~]# [root@openstack ~]# setenforce 0 [root@openstack ~]# getenforce Permissive [root@openstack ~]#
[root@openstack ~]# dnf update -y [root@openstack ~]# reboot
[root@openstack ~]# dnf install -y openstack-packstack ...... Installed: augeas-libs-1.12.0-5.el8.x86_64 boost-atomic-1.66.0-7.el8.x86_64 boost-chrono-1.66.0-7.el8.x86_64 boost-date-time-1.66.0-7.el8.x86_64 boost-filesystem-1.66.0-7.el8.x86_64 boost-locale-1.66.0-7.el8.x86_64 boost-log-1.66.0-7.el8.x86_64 boost-program-options-1.66.0-7.el8.x86_64 boost-regex-1.66.0-7.el8.x86_64 boost-system-1.66.0-7.el8.x86_64 boost-thread-1.66.0-7.el8.x86_64 cpp-hocon-0.2.1-1.el8.x86_64 facter-1:3.14.2-2.el8.x86_64 git-core-2.18.4-2.el8_2.x86_64 hiera-3.6.0-1.el8.noarch leatherman-1.6.1-2.el8.x86_64 libicu-60.3-2.el8_1.x86_64 libselinux-ruby-2.9-3.el8.x86_64 lsof-4.91-2.el8.x86_64 openstack-packstack-1:16.0.2-1.el8.noarch openstack-packstack-puppet-1:16.0.2-1.el8.noarch puppet-6.14.0-2.el8.noarch puppet-aodh-16.3.0-1.el8.noarch puppet-apache-5.4.0-1.420605fgit.el8.noarch puppet-archive-4.4.0-1.474ea01git.el8.noarch puppet-ceilometer-16.3.0-1.el8.noarch puppet-certmonger-2.4.0-1.a198870git.el8.noarch puppet-cinder-16.3.0-1.el8.noarch puppet-concat-6.2.0-1.596d8ccgit.el8.noarch puppet-corosync-6.0.2-0.1.0rc0.2a27f93git.el8.noarch puppet-firewall-2.3.0-1.233f841git.el8.noarch puppet-glance-16.3.0-1.el8.noarch puppet-gnocchi-16.3.0-1.el8.noarch puppet-headless-6.14.0-2.el8.noarch puppet-heat-16.3.0-1.el8.noarch puppet-horizon-16.3.0-1.el8.noarch puppet-inifile-4.2.0-1.el8.noarch puppet-ironic-16.3.0-2.el8.noarch puppet-keystone-16.3.0-1.el8.noarch puppet-magnum-16.3.0-1.el8.noarch puppet-manila-16.3.0-1.el8.noarch puppet-memcached-3.4.0-2.1f307b8git.el8.noarch puppet-mysql-10.4.0-1.fff2c82git.el8.noarch puppet-neutron-16.3.0-1.el8.noarch puppet-nova-16.4.0-0.1.0d7f13fgit.el8.noarch puppet-nssdb-1.0.1-1.2ed2a2dgit.el8.noarch puppet-openstack_extras-16.3.0-1.el8.noarch puppet-openstacklib-16.3.0-1.el8.noarch puppet-oslo-16.3.0-1.el8.noarch puppet-ovn-16.3.0-1.el8.noarch puppet-panko-16.3.0-1.el8.noarch puppet-placement-3.3.0-1.el8.noarch puppet-rabbitmq-10.0.2-0.1.0rc0.eafe833git.el8.noarch puppet-redis-5.0.1-0.1.0rc0.8e48eeegit.el8.noarch puppet-remote-10.0.0-1.7420908git.el8.noarch puppet-rsync-1.1.1-2.db5f8b5git.el8.noarch puppet-sahara-16.3.0-1.el8.noarch puppet-ssh-6.1.0-1.29a9ae7git.el8.noarch puppet-staging-1.0.4-1.b466d93git.el8.noarch puppet-stdlib-6.3.0-1.93eee77git.el8.noarch puppet-swift-16.3.0-1.el8.noarch puppet-sysctl-0.0.12-2.a3d160dgit.el8.noarch puppet-systemd-2.9.0-1.1e15600git.el8.noarch puppet-tempest-16.3.0-1.el8.noarch puppet-trove-16.3.0-1.el8.noarch puppet-vcsrepo-3.1.0-1.d285592git.el8.noarch puppet-vswitch-12.3.0-1.el8.noarch puppet-xinetd-3.3.0-2.8d460c4git.el8.noarch python3-docutils-0.14-12.module_el8.1.0+245+c39af44f.noarch python3-netaddr-0.7.19-8.el8.noarch python3-pbr-5.4.3-2.el8.noarch python3-pip-9.0.3-16.el8.noarch python3-pyyaml-5.3-2.el8.x86_64 python36-3.6.8-2.module_el8.1.0+245+c39af44f.x86_64 ruby-2.5.5-105.module_el8.1.0+214+9be47fd7.x86_64 ruby-augeas-0.5.0-23.el8.x86_64 ruby-facter-1:3.14.2-2.el8.x86_64 ruby-irb-2.5.5-105.module_el8.1.0+214+9be47fd7.noarch ruby-libs-2.5.5-105.module_el8.1.0+214+9be47fd7.x86_64 rubygem-bigdecimal-1.3.4-105.module_el8.1.0+214+9be47fd7.x86_64 rubygem-cane-3.0.0-1.el8.noarch rubygem-concurrent-ruby-1.1.5-2.el8.noarch rubygem-deep_merge-1.2.1-4.el8.noarch rubygem-did_you_mean-1.2.0-105.module_el8.1.0+214+9be47fd7.noarch rubygem-diff-lcs-1.3-4.el8.noarch rubygem-docile-1.1.5-10.el8.noarch rubygem-fast_gettext-1.2.0-9.el8.noarch rubygem-hocon-1.3.0-1.el8.noarch rubygem-io-console-0.4.6-105.module_el8.1.0+214+9be47fd7.x86_64 rubygem-json-2.1.0-105.module_el8.1.0+214+9be47fd7.x86_64 rubygem-multi_json-1.13.1-4.el8.noarch rubygem-openssl-2.1.2-105.module_el8.1.0+214+9be47fd7.x86_64 rubygem-parallel-1.12.1-5.el8.noarch rubygem-pathspec-0.2.1-5.el8.noarch rubygem-psych-3.0.2-105.module_el8.1.0+214+9be47fd7.x86_64 rubygem-puppet-resource_api-1.8.12-1.el8.noarch rubygem-rake-12.3.0-105.module_el8.1.0+214+9be47fd7.noarch rubygem-rdoc-6.0.1-105.module_el8.1.0+214+9be47fd7.noarch rubygem-redcarpet-3.3.2-16.1.el8.x86_64 rubygem-rgen-0.8.4-2.el8.noarch rubygem-rspec-3.7.0-2.el8.noarch rubygem-rspec-core-3.7.1-5.el8.noarch rubygem-rspec-expectations-3.7.0-4.el8.noarch rubygem-rspec-fire-1.3.0-1.el8.noarch rubygem-rspec-mocks-3.7.0-4.el8.noarch rubygem-rspec-support-3.7.1-2.el8.noarch rubygem-ruby-shadow-2.5.0-12.el8.x86_64 rubygem-semantic_puppet-1.0.2-1.el8.noarch rubygem-simplecov-0.13.0-7.el8.1.noarch rubygem-simplecov-html-0.10.0-8.el8.noarch rubygem-yard-0.9.12-8.el8.noarch rubygems-2.7.6.2-105.module_el8.1.0+214+9be47fd7.noarch yaml-cpp-0.6.3-1.el8.x86_64 Complete! [root@openstack ~]#
步骤4:生成答案文件并使用packstack安装openstack
[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 or FWaaS services. Geneve will be used as the encapsulation method for tenant networks [root@openstack ~]# ll total 56 -rw-------. 1 root root 1471 Nov 11 11:11 anaconda-ks.cfg -rw------- 1 root root 51567 Nov 11 14:29 openstack-answer.txt [root@openstack ~]# vi openstack-answer.txt
[root@openstack ~]# vi /root/openstack-answer.txt .............. CONFIG_HEAT_INSTALL=y CONFIG_PROVISION_DEMO=n CONFIG_KEYSTONE_ADMIN_PW=P@ssw0rd CONFIG_NEUTRON_OVN_BRIDGE_IFACES=br-ex:enp0s3 .............
[root@openstack ~]# packstack --answer-file /root/openstack-answer.txt
[root@openstack ~]# ip a s ens32 2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master ovs-system state UP group default qlen 1000 link/ether 00:0c:29:d4:a5:69 brd ff:ff:ff:ff:ff:ff inet6 fe80::20c:29ff:fed4:a569/64 scope link valid_lft forever preferred_lft forever [root@openstack ~]# ip a s br-ex 6: br-ex: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000 link/ether 00:0c:29:d4:a5:69 brd ff:ff:ff:ff:ff:ff inet 192.168.1.100/24 brd 192.168.1.255 scope global br-ex valid_lft forever preferred_lft forever inet6 fe80::85c:abff:fe6a:584e/64 scope link valid_lft forever preferred_lft forever [root@openstack ~]# ovs-vsctl show b5fa808b-f92d-461f-b319-3285e134096b Manager "ptcp:6640:127.0.0.1" is_connected: true Bridge br-int fail_mode: secure Port br-int Interface br-int type: internal Bridge br-ex fail_mode: standalone Port br-ex Interface br-ex type: internal Port "ens32" Interface "ens32" ovs_version: "2.12.0" [root@openstack ~]#