ubuntu15.10 devstack搭建openstack环境

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/skeeee/article/details/52733085

1、安装git等

sudo apt-get install python-netaddr git openssh-server

2、下载devstack代码

git clone git://github.com/openstack-dev/devstack.git

3、创建非root用户,如果已经有非root用户,可以跳过

sh devstack/tools/create-stack-user.sh

4、新建本地配置文件local.conf,主要是修改密码,在安装的过程中就不用每次都手动输入密码。

当然也可以设置其他配置。

cp devstack/samples/local.conf devstack/

修改local.conf中的密码

ADMIN_PASSWORD=xx
DATABASE_PASSWORD=xx
RABBIT_PASSWORD=xx
SERVICE_PASSWORD=xx

5、由于git.openstack.org下载速度比较慢,修改地址为github。

修改devstack/stackrc中GIT_BASE变量

#GIT_BASE=${GIT_BASE:-git://git.openstack.org}
GIT_BASE=${GIT_BASE:-https://github.com}

6、执行./devstack/stack.sh部署openstack

大概20-30分钟,即可部署成功


7、按照ip和密码 登录horizon


8、导入环境变量,执行cli命令

source devstack/openrc


9、devstack重启和关闭

由于重启之后devstack不会自动把openstack拉起来,所以需要手动去拉,之前提供了./rejoin-stack.sh可以直接执行,但是在2016年3月10被删除。

以下是删除的详细信息:

https://review.openstack.org/#/c/291453/1/rejoin-stack.sh

commit 9ba49cd82631ada84b8458b370ac535985d57725
Author: Dean Troyer <[email protected]>
Date:   Thu Mar 10 15:45:40 2016 -0600


    Remove rejoin-stack.sh
    
    This command has never completely worked to restart DevStack.
    It periodically prompts attempts to work around this brokenness
    in ways that harm other functions.  Let's finally remove it.
    
    Requiring a complete re-run of DevStack after a reboot has always
    been intentional.
    
    TODO: follow-up cleaning all of the screen hackage if this merges.
    
    Change-Id: I2f61bb69cc110468a91dcaa4ee7653ede7048467

目前没有其他办法重启,所以我又把rejoin-stack.sh加了回来。


重启之后会报cinder-volume无法启动,参考http://blog.csdn.net/chinagissoft/article/details/50624958解决


关闭的openstack,目前只能关闭screen

screen -ls查看screen的进程

kill -9 pid

screen -wipe


参考:

http://docs.openstack.org/developer/devstack/

http://forum.ubuntu.org.cn/viewtopic.php?f=176&t=445474

http://blog.csdn.net/chinagissoft/article/details/50624958

猜你喜欢

转载自blog.csdn.net/skeeee/article/details/52733085