kolla针对Bootstrap服务的依赖安装:
ansible -i multinode all -m ping
kolla-ansible -i ./multinode bootstrap-servers
PLAY RECAP ************************************************************************compute01 : ok=38 changed=7 unreachable=0 failed=0
compute02 : ok=38 changed=7 unreachable=0 failed=0
compute03 : ok=38 changed=7 unreachable=0 failed=0
controller01 : ok=38 changed=7 unreachable=0 failed=0
controller02 : ok=39 changed=17 unreachable=0 failed=0
controller03 : ok=38 changed=7 unreachable=0 failed=0
monitor : ok=1 changed=0 unreachable=0 failed=0
安装之前还需要预检查一下主机环境以及配置文件是否正确。
# kolla-ansible -i ./multinode prechecks
过程省略;
结果如下,则运行正确(所有节点均无failed)
PLAY RECAP *********************************************************************************************************************************************************
computer1 : ok=24 changed=1 unreachable=0 failed=0 skipped=58 rescued=0 ignored=0
computer2 : ok=20 changed=1 unreachable=0 failed=0 skipped=48 rescued=0 ignored=0
computer3 : ok=24 changed=1 unreachable=0 failed=0 skipped=58 rescued=0 ignored=0
controller01 : ok=21 changed=1 unreachable=0 failed=0 skipped=51 rescued=0 ignored=0
controller02 : ok=20 changed=1 unreachable=0 failed=0 skipped=46 rescued=0 ignored=0
controller03 : ok=20 changed=1 unreachable=0 failed=0 skipped=46 rescued=0 ignored=0
monitor : ok=9 changed=1 unreachable=0 failed=0 skipped=21 rescued=0 ignored=0
三、拉取镜像
相较于官方文档,在deploy部署之前增加此步骤,可以大大缩短部署openstack的时间(此步骤时间较长,预计2小时左右):
# kolla-ansible -i ./multinode pull
过程省略;
结果如下,则运行正确:
PLAY RECAP *********************************************************************************************************************************************************
computer01 : ok=12 changed=0 unreachable=0 failed=0 skipped=42 rescued=0 ignored=0
computer02 : ok=12 changed=0 unreachable=0 failed=0 skipped=42 rescued=0 ignored=0
computer03 : ok=12 changed=0 unreachable=0 failed=0 skipped=42 rescued=0 ignored=0
controller01 : ok=33 changed=0 unreachable=0 failed=0 skipped=76 rescued=0 ignored=0
controller02 : ok=33 changed=0 unreachable=0 failed=0 skipped=74 rescued=0 ignored=0
controller03 : ok=33 changed=0 unreachable=0 failed=0 skipped=74 rescued=0 ignored=0
monitor : ok=7 changed=0 unreachable=0 failed=0 skipped=27 rescued=0 ignored=0
开始部署openstack(此步骤预计半小时之内):
# kolla-ansible -i ./multinode deploy
过程省略;
结果如下,则运行正确:
PLAY RECAP *********************************************************************************************************************************************************
computer01 : ok=40 changed=4 unreachable=0 failed=0 skipped=49 rescued=0 ignored=0
computer02 : ok=40 changed=4 unreachable=0 failed=0 skipped=49 rescued=0 ignored=0
computer03 : ok=40 changed=4 unreachable=0 failed=0 skipped=49 rescued=0 ignored=0
controller01 : ok=134 changed=17 unreachable=0 failed=0 skipped=93 rescued=0 ignored=0
controller02 : ok=108 changed=13 unreachable=0 failed=0 skipped=86 rescued=0 ignored=0
controller03 : ok=108 changed=13 unreachable=0 failed=0 skipped=86 rescued=0 ignored=0
monitor : ok=24 changed=0 unreachable=0 failed=0 skipped=23 rescued=0 ignored=0
五、部署之后
部署完成之后,还需要这步操作,生成环境变量和脚本:
# kolla-ansible -i ./multinode post-deploy
# cat /etc/kolla/admin-openrc.sh
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_AUTH_URL=http://192.168.136.210:35357/v3
export OS_INTERFACE=internal
export OS_IDENTITY_API_VERSION=3
export OS_REGION_NAME=RegionOne
至此multinodes部署完成,浏览器输入外网访问地址(kolla_internal_vip_address:):http://172.29.55.239,即可访问Openstack的登陆页面,用户名和密码都是password文件设置的admin
七、安装OpenStack CLI客户端:
pip install -U python-openstackclient python-glanceclient python-neutronclient
八、 使admin环境生效
source /etc/kolla/admin-openrc.sh #使admin环境生效
九、查看计算服务
openstack compute service list
十、销毁openstack
假如不需要这个openstack环境了,可以执行如下命令进行销毁该环境:
# kolla-ansible destroy -i ./multinode --yes-i-really-really-mean-it
该销毁指令,会停止并删除各台机器上运行的docker容器,但是对yum和python安装的文件以及pull的docker的images镜像文件不做变更。