机器要求:2台镜像为centos7的虚拟机,1个openstack镜像包,机器名称分为controller和compute。

1、改名和挂载

hostnamectl set-hostname controller

hostnamectl set-hostname compute

mount -o loop <centos镜像> /mnt

cp -r /mnt/* /opt/centos/

umount /mnt/

mount -o loop <openstack镜像> /mnt

cp -r /mnt/* /opt/iaas/

umount /mnt/

2、ssh免密登录和compute分区

//两台机器都要

ssh-keygen
ssh-copy-id <主机名或者IP>

假定一个80G硬盘

fdisk /dev/<硬盘名称>

将其分成三块,因为chinaskills_cloud镜像需要三个

3、yum配置

controller配置

cd /etc/yum.repos.d/
rm -rf *
vi localyum.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=file:///opt/iaas/iaas-repo
gpgcheck=0
enabled=1

compute配置

cd /etc/yum.repos.d/
rm -rf *
vi ftp.repo
[centos]
name=centos
baseurl=ftp://opt/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=ftp://opt/iaas/iaas-repo
gpgcheck=0
enabled=1

完成后,测试

yum clean all
yum makecache

4、编辑ftp

在controller安装vsftpd

yum -y install vsftpd
echo "anon_root=/opt" >> /etc/vsftpd/vsftpd.conf
systemctl restart vsftpd
systemctl enable vsftpd

5、安装openstack

在安装时需要注意镜像的版本,

chinaskills的一般是

yum- y install iaas-xiandian

更高版本的是

yum -y install  openstack-shell.noarch

6、编辑controller节点的openstack

vi /etc/xiandian/openrc.sh

批量删除注释符,也就是#号,在查看状态下:

:%s/^#//g

同样的可以

//将以PASS=字符的替换成PASS=000000
:%s/PASS=/PASS=000000/g
#--------------------system Config--------------------##
#Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.137.27                         #控制节点IP
 
#Controller HOST Password. example:000000 
HOST_PASS=000000                               #控制节点登录密码
 
#Controller Server hostname. example:controller
HOST_NAME=controller                           #控制节点名称
 
#Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.137.37                    #计算节点IP
 
#Compute HOST Password. example:000000 
HOST_PASS_NODE=000000                          #计算节点登录密码
 
#Compute Node hostname. example:compute
HOST_NAME_NODE=compute                         #计算节点名称
 
#--------------------Chrony Config-------------------##
#Controller network segment IP.  example:x.x.0.0/16(x.x.x.0/24)
network_segment_IP=192.168.137.0/24            #同步时间的服务器IP与掩码
 
#--------------------Rabbit Config ------------------##
#user for rabbit. example:openstack
RABBIT_USER=openstack
 
#Password for rabbit user .example:000000
RABBIT_PASS=000000
 
#--------------------MySQL Config---------------------##
#Password for MySQL root user . exmaple:000000
DB_PASS=000000
 
#--------------------Keystone Config------------------##
#Password for Keystore admin user. exmaple:000000
DOMAIN_NAME=demo                    #域
ADMIN_PASS=000000
DEMO_PASS=000000
 
#Password for Mysql keystore user. exmaple:000000
KEYSTONE_DBPASS=000000
 
#--------------------Glance Config--------------------##
#Password for Mysql glance user. exmaple:000000
GLANCE_DBPASS=000000
 
#Password for Keystore glance user. exmaple:000000
GLANCE_PASS=000000
 
#--------------------Nova Config----------------------##
#Password for Mysql nova user. exmaple:000000
NOVA_DBPASS=000000
 
#Password for Keystore nova user. exmaple:000000
NOVA_PASS=000000
 
#--------------------Neturon Config-------------------##
#Password for Mysql neutron user. exmaple:000000
NEUTRON_DBPASS=000000
 
#Password for Keystore neutron user. exmaple:000000
NEUTRON_PASS=000000
 
#metadata secret for neutron. exmaple:000000
METADATA_SECRET=000000
 
#Tunnel Network Interface. example:x.x.x.x
INTERFACE_IP=192.168.137.27            #填本机IP(计算节点就填计算的IP)
 
#External Network Interface. example:eth1
INTERFACE_NAME=ens34                   #第二张网卡名称
 
#External Network The Physical Adapter. example:provider
Physical_NAME=provider
 
#First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
minvlan=101
 
#Last Vlan ID in VLAN RANGE for VLAN Network. example:200
maxvlan=200
 
#--------------------Cinder Config--------------------##
#Password for Mysql cinder user. exmaple:000000
CINDER_DBPASS=000000
 
#Password for Keystore cinder user. exmaple:000000
CINDER_PASS=000000
 
#Cinder Block Disk. example:md126p3
BLOCK_DISK=sda3                                        #存储硬盘
 
#--------------------Swift Config---------------------##
#Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000
 
#The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=sda4                                        #存储硬盘
 
#The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=192.168.137.37                    #计算节点的IP
 
#--------------------Heat Config----------------------##
#Password for Mysql heat user. exmaple:000000
HEAT_DBPASS=000000
 
#Password for Keystore heat user. exmaple:000000
HEAT_PASS=000000
 
#--------------------Zun Config-----------------------##
#Password for Mysql Zun user. exmaple:000000
ZUN_DBPASS=000000
 
#Password for Keystore Zun user. exmaple:000000
ZUN_PASS=000000
 
#Password for Mysql Kuryr user. exmaple:000000
KURYR_DBPASS=000000
 
#Password for Keystore Kuryr user. exmaple:000000
KURYR_PASS=000000
 
#--------------------Ceilometer Config----------------##
#Password for Gnocchi ceilometer user. exmaple:000000
CEILOMETER_DBPASS=000000
 
#Password for Keystore ceilometer user. exmaple:000000
CEILOMETER_PASS=000000
 
#--------------------AODH Config----------------##
#Password for Mysql AODH user. exmaple:000000
AODH_DBPASS=000000
 
#Password for Keystore AODH user. exmaple:000000
AODH_PASS=000000
 
#--------------------Barbican Config----------------##
#Password for Mysql Barbican user. exmaple:000000
BARBICAN_DBPASS=000000
 
#Password for Keystore Barbican user. exmaple:000000
BARBICAN_PASS=000000

保存好后,将文件复制给compute的同一个位置,也就是/etc/xiandian/ 下

7、安装基础服务

注意:iaas-pre-host.sh脚本都要先安装好后,再安装其他的

controller机器下

//依次安装,等安装结束后,才可以开始下一步安装
iaas-pre-host.sh
iaas-install-mysql.sh 
iaas-install-keystone.sh
iaas-install-glance.sh
iaas-install-nova-controller.sh
iaas-install-neutron-controller.sh
iaas-install-dashboard.sh
iaas-install-cinder-controller.sh
iaas-install-swift-controller.sh

compute机器下

//依次安装,等安装结束后,才可以开始下一步安装
iaas-pre-host.sh
iaas-install-nova-compute.sh
iaas-install-neutron-compute.sh
iaas-install-cinder-compute.sh
iaas-install-swift-compute.sh

完成后,就可以在浏览器中输入http://IP/dashboard就可以访问到

用户名:admin 密码:000000