文章目录
一、环境需求
CentOS 7.6 系统
CPU:双核双线程/开启虚拟化功能
内存:4G
硬盘:30G+300G
网卡:NAT模式
选做:(装机界面按Tab键进入界面编辑,输入后面的内容)net.ifnames=0 biosdevname=0 (创建时可修改为eth0网卡)
二、环境配置
1、配置静态地址、主机名
vi /etc/sysconfig/network-scripts/ifcfg-eth0
......
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.200.50
NETMASK=255.255.255.0
GATEWAY=192.168.200.2
DNS1=192.168.200.2
DNS2=8.8.8.8
#在/etc/resolv.conf中添加:
vi /etc/resolv.conf
nameserver 114.114.114.114
#重启网卡
systmectl restart network
2、关闭(设置开机不启动)防火墙、核心防护、NetworkManager
systemctl stop firewalld
systemctl disable firewalld
systemctl stop NetworkManager
setenforce 0
3、安装时间同步服务、同步阿里云时钟服务器(ntp1、ntp2…)、设置周期性任务及设置开机自启
yum install -y ntpdate
ntpdate ntp.aliyun.com >>/var/log/ntpdate.log
crontab -e
....
4、配置yum源
[root@openstack ~]# cd /etc/yum.repos.d/
[root@openstack yum.repos.d]# mkdir bak
[root@openstack yum.repos.d]# mv C* bak/
[root@openstack yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@openstack yum.repos.d]# yum -y install centos-release-openstack-train
[root@openstack yum.repos.d]# yum clean all
[root@openstack yum.repos.d]# yum makecache (fast) #()部分可选择添加
5、重启、查看服务状态
reboot
6、下载OpenStack 管理工具包、在线部署OpenStack
yum -y install openstack-packstack
packstack --allinone
**** 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 or FWaaS services. Geneve will be used as the encapsulation method for tenant networks
* A new answerfile was created in: /root/packstack-answers-20201018-191715.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.168.226.150. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.226.150/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/20201018-191715-BH2Wcy/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20201018-191715-BH2Wcy/manifests
#创建br-ex网卡配置文件
cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-br-ex
sed -i "100d" ifcfg-br-ex
cat <<EOF >> ifcfg-br-ex
TYPE=Ethernet
BOOTPROTO=none
NAME=br-ex
DEVICE=br-ex
ONBOOT=yes
IPADDR=172.24.4.1
PREFIX=24
EOF
systemctl restart network
#ifconfig 查看
7、查看用户信息
cd /root && cat keystonerc_admin
8、网页登陆
块设备映射—> 孵化 —>
#上传镜像,两种方式
第一种——命令行
openstack image create "cirros" --file cirros-0.3.5-x86_64-disk.img --disk-format qcow2 --container-format bare --public
第二种——控制台
#建议使用第一种