devstack部署Pike版本的OpenStack
本文记载的是个人环境的使用devstack部署的一个案例,仅供参考。
■环境
系统:Ubuntu 16.04 LTS
OpenStack 版本:Pike
■环境构成
两块IP, 一块是enp0s3,用于连接外网,使用virtualbox的NAT网络,另外一个块enp0s8 使用的hostonly网络。
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:b9:b0:d2 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.7/24 brd 10.0.2.255 scope global dynamic enp0s3
valid_lft 1011sec preferred_lft 1011sec
inet6 fe80::7ed0:edbe:8dc1:c228/64 scope link
valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP group default qlen 1000
link/ether 08:00:27:98:ae:40 brd ff:ff:ff:ff:ff:ff
inet6 fe80::a00:27ff:fe98:ae40/64 scope link
valid_lft forever preferred_lft forever
■安装
1. 编辑以下文件配置apt的源,使用国内的阿里的源。
root@lijiale-VirtualBox:~# cat /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
2. 登录root以外的用户,使用root以外的用户,进行后续的所有操作,以xxxx用户为例进行说明。
下载,devstack代码。
git clone -b stable/pike https://git.openstack.org/openstack-dev/devstack
3. 进入 devstack 目录下,编辑local.conf文件。编辑后,内容如下。
[[local|localrc]]
DATA_DIR=/opt/stack/data
DEST=/opt/stack
ACTIVE_TIMEOUT=90
BOOT_TIMEOUT=90
ASSOCIATE_TIMEOUT=60
TERMINATE_TIMEOUT=60
USE_SCREEN=True
LOGFILE=$DEST/logs/stack.sh.log
VERBOSE=True
ENABLE_DEBUG_LOG_LEVEL=True
ENABLE_VERBOSE_LOG_LEVEL=True
OS_CACERT=
STACK_USER=
xxxx <- 注意替换为Ubuntu上的root以外的用户,
TLS_IP=
HOST_IP=192.168.56.110
SERVICE_IP_VERSION=4
DATABASE_PASSWORD=a
RABBIT_PASSWORD=a
SERVICE_PASSWORD=a
ADMIN_PASSWORD=a
VIRT_DRIVER=libvirt
SWIFT_REPLICAS=1
SWIFT_START_ALL_SERVICES=False
LOG_COLOR=False
UNDO_REQUIREMENTS=False
CINDER_PERIODIC_INTERVAL=10
export OS_NO_CACHE=True
CEILOMETER_BACKEND=mysql
SFC_UPDATE_OVS=False
EBTABLES_RACE_FIX=True
DEBUG_LIBVIRT_COREDUMPS=True
CINDER_VOLUME_CLEAR=none
LIBVIRT_TYPE=qemu
FORCE_CONFIG_DRIVE=False
ROOTSLEEP=0
ERROR_ON_CLONE=True
INSTALL_TEMPEST=False
NOVNC_FROM_PACKAGE=True
GIT_BASE=http://git.trystack.cn
LIBS_FROM_GIT=python-openstackclient
LIBS_FROM_GIT+=,python-tackerclient
LIBS_FROM_GIT+=,tacker-horizon
FLOATING_RANGE="192.168.56.0/24"
FIXED_RANGE="10.0.0.0/24"
Q_FLOATING_ALLOCATION_POOL=start=192.168.56.200,end=192.168.56.230
PUBLIC_NETWORK_GATEWAY="192.168.56.1"
PUBLIC_INTERFACE=enp0s8
ENABLE_BARBICAN=True
SWIFT_HASH=a
ENABLED_SERVICES=c-api,c-bak,c-sch,c-vol
ENABLED_SERVICES+=,ceilometer-acentral,ceilometer-acompute,ceilometer-alarm-evaluator
ENABLED_SERVICES+=,ceilometer-alarm-notifier,ceilometer-anotification,ceilometer-api,ceilometer-collector
ENABLED_SERVICES+=,cinder
ENABLED_SERVICES+=,dstat
#ENABLED_SERVICES+=,etcd3
ENABLED_SERVICES+=,g-api,g-reg
ENABLED_SERVICES+=,horizon
ENABLED_SERVICES+=,key
ENABLED_SERVICES+=,mysql
ENABLED_SERVICES+=,n-api,n-api-meta,n-cauth,n-cond,n-cpu,n-novnc,n-obj,n-sch
ENABLED_SERVICES+=,peakmen_tacker
ENABLED_SERVICES+=,placement-api
ENABLED_SERVICES+=,q-agent,q-dhcp,q-l3,q-meta,q-metering,q-svc
ENABLED_SERVICES+=,rabbit
#ENABLED_SERVICES+=,tempest
ENABLED_SERVICES+=,s-account,s-container,s-object,s-proxy
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
SKIP_EXERCISES=boot_from_volume,bundle,client-env,euca
TACKER_BRANCH=stable/pike
enable_plugin heat $GIT_BASE/openstack/heat $TACKER_BRANCH
enable_plugin aodh $GIT_BASE/openstack/aodh $TACKER_BRANCH
enable_plugin ceilometer $GIT_BASE/openstack/ceilometer $TACKER_BRANCH
enable_plugin networking-sfc $GIT_BASE/openstack/networking-sfc $TACKER_BRANCH
enable_plugin mistral $GIT_BASE/openstack/mistral $TACKER_BRANCH
enable_plugin barbican $GIT_BASE/openstack/barbican $TACKER_BRANCH
enable_plugin tacker $GIT_BASE/openstack/tacker $TACKER_BRANCH
enable_plugin tacker-horizon $GIT_BASE/openstack/tacker-horizon $TACKER_BRANCH
4. 下载所有的Openstack的代码。 由于在stack.sh执行过程中代码经常无法下载而失败,所以直接手动先下载下来。
下载到 /opt/stack/目录下。
# mkdir /opt/stack/
# cd /opt/stack
# git clone http://git.trystack.cn/openstack/horizon -b stable/pike <- 下载 horizon的命令,下载其他模块代码只要替换 horizon即可。
需要下载的代码如下:
drwxr-xr-x 23 lijiale root 4096 2月 5 16:29 ./
drwxr-xr-x 3 root root 4096 2月 5 11:22 ../
drwxrwxr-x 11 lijiale lijiale 4096 2月 5 16:26 aodh/
drwxrwxr-x 13 lijiale lijiale 4096 2月 5 16:28 barbican/
drwxrwxr-x 13 lijiale lijiale 4096 2月 5 16:26 ceilometer/
drwxrwxr-x 13 lijiale lijiale 4096 2月 5 16:01 cinder/
drwxrwxr-x 12 lijiale lijiale 4096 2月 5 15:50 glance/
drwxrwxr-x 17 lijiale lijiale 4096 2月 5 16:21 heat/
drwxrwxr-x 11 lijiale lijiale 4096 2月 5 16:37 horizon/
drwxrwxr-x 16 lijiale lijiale 4096 2月 5 15:44 keystone/
drwxrwxr-x 15 lijiale lijiale 4096 2月 5 16:27 mistral/
drwxrwxr-x 7 lijiale lijiale 4096 2月 5 16:28 mistral-dashboard/
drwxrwxr-x 13 lijiale lijiale 4096 2月 5 16:27 networking-sfc/
drwxrwxr-x 14 lijiale lijiale 4096 2月 5 16:10 neutron/
drwxrwxr-x 16 lijiale lijiale 4096 2月 5 16:17 nova/
drwxrwxr-x 9 lijiale lijiale 4096 2月 5 16:29 python-barbicanclient/
drwxrwxr-x 10 lijiale lijiale 4096 2月 5 16:55 requirements/
drwxr-xr-x 3 lijiale lijiale 4096 2月 5 16:29 status/
drwxrwxr-x 12 lijiale lijiale 4096 2月 5 15:49 swift/
drwxrwxr-x 12 lijiale lijiale 4096 2月 5 16:29 tacker/
drwxrwxr-x 6 lijiale lijiale 4096 2月 5 16:55 tacker-horizon/
5. 执行 stack.sh,等着正常结束,即可。如果发生错误,可以再次投入 stack.sh命令。
xxxx@xxxx-VirtualBox:~$ cd
xxxx@xxxx-VirtualBox:~$ cd devstack/
xxxx@xxxx-VirtualBox:~/devstack$ ./stack.sh
注: 如果有些组件,你不想安装,可以在配置local.conf中增减。