基础环境准备
1.禁用selinux
2.卸载firewalld
3.卸载 NetworkManager
4.配置主机IP地址
5.配置主机yum客户端
6.创建cinder-volumes的卷组
7.导入公钥
8.安装依赖软件包

配置卷组
[root@node1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 200G 0 disk
└─vda1 253:1 0 16G 0 part /
vdb 253:16 0 20G 0 disk
安装卷组管理软件
[root@node1 ~]# yum -y install lvm2
创建卷组
[root@node1 ~]# pvcreate /dev/vdb
Physical volume "/dev/vdb" successfully created.
创建卷组名为clinder-volumes
[root@node1 ~]# vgcreate clinder-volumes /dev/vdb
Volume group "clinder-volumes" successfully created
查询卷组信息
[root@node1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
clinder-volumes 1 0 0 wz--n- <20.00g <20.00g
导入公钥
[root@nova ~]# rpm --import RPM-GPG-KEY-CentOS-7
两台虚拟机安装额外软件包
[root@nova ~]# yum install -y qemu-kvm libvirt-client libvirt-daemon
libvirt-daemon-driver-qemu python-setuptools
配置packstack
• 安装packstack
[root@vh02 ~]# yum install -y openstack-packstack
修改yum源签名验证
[root@node1 ~]#vim /etc/yum.repos.d/base.repo
[base]
name=centos
baseurl=ftp://192.168.1.254/centos 物理机ftp yum源
gpgcheck=1
enabled=1
创建应答文件
[root@node1 ~]# packstack --gen-answer-file answer.ini
修改应答文件
[root@node1 ~]# vim answer.ini
11行 CONFIG_DEFAULT_PASSWORD=Taren1
42 CONFIG_SWIFT_INSTALL=n
75 CONFIG_NTP_SERVERS=192.168.1.254
98 CONFIG_COMPUTE_HOSTS=192.168.1.20,192.168.1.30 两台虚拟机IP
102 CONFIG_NETWORK_HOSTS=192.168.1.20,192.168.1.30
554 CONFIG_CINDER_VOLUMES_CREATE=n
840 CONFIG_NEUTRON_ML2_TYPE_DRIVERS=flat,vxlan
876 CONFIG_NEUTRON_ML2_VXLAN_GROUP=239.1.1.5
910 CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex
921 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth0
936 CONFIG_NEUTRON_OVS_TUNNEL_IF=eth1
1179 CONFIG_PROVISION_DEMO=n
一键部署Openstack
[root@node1 ~]# packstack --answer-file answer.ini
ERROR : The cinder server should contain a cinder-volumes volume group
报错提示,没有卷组,卷组名错误,正确的应该为: cinder-volumes
[root@node1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
clinder-volumes 1 0 0 wz--n- <20.00g <20.00g
修改卷组名称
[root@node1 ~]# vgrename clinder-volumes cinder-volumes
Volume group "clinder-volumes" successfully renamed to "cinder-volumes"
修改完成后查询
[root@node1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
cinder-volumes 1 0 0 wz--n- <20.00g <20.00g
重新部署Openstack
[root@node1 ~]# packstack --answer-file answer.ini
Welcome to the Packstack setup utility

The installation log file is available at: /var/tmp/packstack/20180630-163406-78uc5o/openstack-setup.log

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 ]
Installing time synchronization via NTP [ 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 LBaaS Agent 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 Gnocchi entries [ DONE ]
Preparing MongoDB 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.1.20_controller.pp
192.168.1.20_controller.pp: [ DONE ]
Applying 192.168.1.30_network.pp
Applying 192.168.1.20_network.pp
192.168.1.20_network.pp: [ DONE ]
192.168.1.30_network.pp: [ DONE ]
Applying 192.168.1.30_compute.pp
Applying 192.168.1.20_compute.pp
192.168.1.20_compute.pp: [ DONE ]
192.168.1.30_compute.pp: [ DONE ]
Applying Puppet manifests [ DONE ]
Finalizing [ DONE ]

Installation completed successfully **

Additional information:

  • File /root/keystonerc_admin has been created on OpenStack client host 192.168.1.20. To use the command line tools you need to source the file.
  • To access the OpenStack Dashboard browse to http://192.168.1.20/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/20180630-163406-78uc5o/openstack-setup.log
  • The generated manifests are available at: /var/tmp/packstack/20180630-163406-78uc5o/manifests

配置br-ex为外部OVS网桥
[root@node1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-br-ex
ONBOOT=yes
IPADDR=192.168.1.20
PROFIX=24
GATEWAY=192.168.1.254
DEVICE=br-ex
NAME=br-ex
DEVICETYPE=ovs
OVSBOOTPROTO="static"
TYPE=OVSBridge

配置外部OVS网桥端口
[root@node1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
NAME=eth0
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ex
ONBOOT=yes
BOOTPROTO=none
验证OVS配置
[root@node1 ~]# ovs-vsctl show
fabfec4c-7acf-4f34-9083-64e2557417a7
Manager "ptcp:6640:127.0.0.1"
is_connected: true
Bridge br-ex
Controller "tcp:127.0.0.1:6633"
is_connected: true
fail_mode: secure
Port phy-br-ex
Interface phy-br-ex
type: patch
options: {peer=int-br-ex}
Port "eth0"
Interface "eth0"
...............
2.[root@node1 ~]# ip -o addr show
...............
8: br-ex inet 192.168.1.20/24 brd 192.168.1.255 scope global br-ex\ valid_lft forever preferred_lft forever
配置Horizon
安装虽然没有报错,但默认无法打开Horizon,这是一个软件的配置BUG
我们修改配置文件
[root@node1 ~]# vim /etc/httpd/conf.d/15-horizon_vhost.conf
WSGIApplicationGroup %{GLOBAL} #在文件内添加这一行
重新载入配置文件
[root@node1 ~]# apachectl graceful
使用浏览器打开页面192.168.1.20
http://192.168.1.20/dashboard/auth/login/?next=/dashboard/
打开后就可以看到登录页面了
初始化环境变量
[root@node1 ~]# source ~/keystonerc_admin
[root@node1 ~(keystone_admin)]# env |grep OS
HOSTNAME=node1
OS_REGION_NAME=RegionOne
OS_PASSWORD=50e519fda73a40eb #默认密码在这
OS_AUTH_URL=http://192.168.1.20:5000/v2.0
OS_USERNAME=admin #默认管理员账户名
OS_TENANT_NAME=admin
可以使用openstack help查询命令信息
[root@node1 ~(keystone_admin)]# openstack help