部署openstack (devstack)
devstack是openstack的一个发行版本
创建虚拟机
按照物理资源需求创建 devstack-controller 和 devstak-compute 虚拟机
安装操作系统
安装 Ubuntu 14.04,并配置 eth0 的 IP
devstack-controller 192.168.104.10
devstak-compute 192.168.104.11
接下来的步骤在两个节点都要操作
下载代码
下载 devstack 代码,并切换到 stable/newton分支
apt-get install git -y git clone https://git.openstack.org/openstack-dev/devstack -b stable/newton
配置 stack 用户
创建 stack 用户
devstack/tools/create-stack-user.sh
为方便起见,将devstack目录放到/opt/stack下,并设置权限
mv devstack /opt/stack
chown -R stack:stack /opt/stack/devstack
切换到 stack 用户
su – stack
cd devstack
pwd
安装的python依赖项:
sudo apt-get install python-pip sudo pip install --upgrade pip sudo pip install -U os-testr
已安装的brctl依赖项
sudo apt-get install bridge-utils
pip,我们使用 国内镜像,详细可以看我的上篇博文 pip 国内原
在root,stack 用户的~/下分别创建.pip文件夹并在里面创建pip.conf
编辑pip.conf
[global] index-url = http://pypi.douban.com/simple [install] trusted-host=pypi.douban.com ~ ~
l在两个节点的 /opt/stack/devstack 目录下,创建 local.conf。
devstack-controller
[[local|localrc]]
MULTI_HOST=true
# management & api network
HOST_IP=192.168.104.10
LOGFILE=/opt/stack/logs/stack.sh.log
# Credentials
ADMIN_PASSWORD=admin
MYSQL_PASSWORD=secret
RABBIT_PASSWORD=secret
SERVICE_PASSWORD=secret
SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz
# enable neutron-ml2-vlan
disable_service n-net
enable_service q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron,q-lbaas,q-fwaas
Q_AGENT=linuxbridge
ENABLE_TENANT_VLANS=True
TENANT_VLAN_RANGE=3001:4000
PHYSICAL_NETWORK=default
LOG_COLOR=False
LOGDIR=$DEST/logs
SCREEN_LOGDIR=$LOGDIR/screen
# use TryStack git mirror
GIT_BASE=http://git.trystack.cn
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git
devstack-compute
[[local|localrc]] MULTI_HOST=true HOST_IP=192.168.104.11 # management & api network # Credentials ADMIN_PASSWORD=admin MYSQL_PASSWORD=secret RABBIT_PASSWORD=secret SERVICE_PASSWORD=secret SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz # Service information SERVICE_HOST=192.168.104.10 MYSQL_HOST=$SERVICE_HOST RABBIT_HOST=$SERVICE_HOST GLANCE_HOSTPORT=$SERVICE_HOST:9292 Q_HOST=$SERVICE_HOST KEYSTONE_AUTH_HOST=$SERVICE_HOST KEYSTONE_SERVICE_HOST=$SERVICE_HOST CEILOMETER_BACKEND=mongodb DATABASE_TYPE=mysql ENABLED_SERVICES=n-cpu,q-agt,neutron Q_AGENT=linuxbridge ENABLE_TENANT_VLANS=True TENANT_VLAN_RANGE=3001:4000 PHYSICAL_NETWORK=default # vnc config NOVA_VNC_ENABLED=True NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html" VNCSERVER_LISTEN=$HOST_IP VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN LOG_COLOR=False LOGDIR=$DEST/logs SCREEN_LOGDIR=$LOGDIR/screen #另外,为了加快安装速度,还可以加上下面的配置使用国内的 devstack 镜像站点 # use TryStack git mirror GIT_BASE=http://git.trystack.cn NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git