kolla项目是为了容器化openstack,目标是做到100个节点的开箱即用,所有的组件的HA都具备。kolla是一个革命性的项目,我们以前积累的安装部署经验,全部都报废。使用kolla可以快速部署可扩展,可靠的生产就绪的openstack环境。本文介绍如何使用kolla安装部署OpenStack云平台。

基本环境

操作系统:CentOS Linux release 7.2.1511 (Core) 内核版本:3.10.0-327.el7.x86_64 docker版本:Docker version 1.10.3, build cb079f6-unsupported

安装docker

参照:https://www.xiexianbin.cn/docker/2015/07/25/Docker-install-script

部署kolla

  • 安装依赖
yum install epel-release -y
yum install python-devel libffi-devel openssl-devel gcc python-pip -y
pip install -U pip
  • 修改docker启动文件
# Create the drop-in unit directory for docker.service
mkdir -p /etc/systemd/system/docker.service.d

# Create the drop-in unit file
tee /etc/systemd/system/docker.service.d/kolla.conf <<-'EOF'
[Service]
MountFlags=shared
EOF

重启docker

systemctl daemon-reload
systemctl restart docker
  • 安装docker的python库
yum install python-docker-py -y
or
pip install -U docker-py
  • 配置时间同步
ntpdate asia.pool.ntp.org
  • 禁用libvirt
systemctl stop libvirtd.service
systemctl disable libvirtd.service
  • 安装ansible

这里需要注意的是如果安装stable版的kolla需要Ansible < 2.0(1.9.4),master版需要Ansible > 2.0。默认yum安装ansible版本>2.0,因为我要安装stable/newton版,所有不指定安装版本。

pip install -U ansible
or
pip install -i http://pypi.douban.com/simple/ ansible --trusted-host pypi.douban.com
  • 安装stable版kolla

下载源码

yum install git -y
git clone https://github.com/openstack/kolla -b stable/newton

安装依赖

pip install -r kolla/requirements.txt -r kolla/test-requirements.txt
or
pip install -i http://pypi.douban.com/simple/ -r kolla/requirements.txt -r kolla/test-requirements.txt --trusted-host pypi.douban.com

源码安装

pip install kolla/
or
pip install -i http://pypi.douban.com/simple/ kolla/ --trusted-host pypi.douban.com

安装完成后,更新docker镜像中的pip源和yum源:

/usr/share/kolla/docker/base/Dockerfile.j2:81

# Set up aliyun mirrors
RUN yum install wget vim -y \
    && wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo \
    && yum clean all

# Set up pip and use douban source
COPY get-pip.py /tmp
RUN mkdir ~/.pip \
    && > ~/.pip/pip.conf \
    && echo "[global]" > ~/.pip/pip.conf \
    && echo "index-url = http://pypi.douban.com/simple" >> ~/.pip/pip.conf \
    && echo "trusted-host = pypi.douban.com" >> ~/.pip/pip.conf \ 
    && python /tmp/get-pip.py \
    && rm -f /tmp/get-pip.py \
    && yum install python-devel mysql-devel gcc openssl libssl-dev libffi-devel python-devel openssl-devel -y \
    && pip --no-cache-dir install pytz
在{ { macros.install_packages(base_centos_yum_repo_packages customizable(“yum_centos_repo_packages”)) } }后添加
RUN sed -i ' s/\#baseurl=http\:\/\/download.fedoraproject.org\/pub\/epel\/7/baseurl=http\:\/\/mirrors.aliyun.com\/epel\/7/' /etc/yum.repos.d/epel.repo \
    && sed -i '/mirrorlist/'d /etc/yum.repos.d/epel.repo \
    && sed -i '/failovermethod/'d /etc/yum.repos.d/epel.repo \
    && sed -i ' s/gpgcheck=1/gpgcheck=0/' /etc/yum.repos.d/epel.repo \
    && sed -i ' s/mirror.centos.org/mirrors.aliyun.com/' /etc/yum.repos.d/CentOS-OpenStack-newton.repo \
    && sed -i ' s/mirror.centos.org/mirrors.aliyun.com/' /etc/yum.repos.d/CentOS-Ceph-Jewel.repo \
    && sed -i ' s/mirror.centos.org/mirrors.aliyun.com/' /etc/yum.repos.d/CentOS-QEMU-EV.repo \
    && rm -rf /etc/yum.repos.d/epel-testing.repo
  • 安装tox,生成配置文件
pip install -U tox
pip install -i http://pypi.douban.com/simple/ -U tox --trusted-host pypi.douban.com
cd kolla/
tox -e genconfig
cp -rv etc/kolla /etc/
[root@xiexianbin_cn kolla]# tox -e genconfig
genconfig develop-inst-noop: /root/kolla
genconfig installed: appdirs==1.4.0,Babel==2.3.4,backports.ssl-match-hostname==3.5.0.1,bandit==1.1.0,bashate==0.5.1,beautifulsoup4==4.5.1,chardet==2.3.0,cliff==2.2.0,cmd2==0.6.9,debtcollector==1.9.0,doc8==0.7.0,docker-py==1.7.2,docutils==0.12,extras==1.0.0,fixtures==3.0.0,flake8==2.5.5,funcsigs==1.0.2,functools32==3.2.3.post2,futures==3.0.5,gitdb==0.6.4,gitdb2==2.0.0,GitPython==2.1.0,graphviz==0.5.1,hacking==0.11.0,iso8601==0.1.11,Jinja2==2.8,jsonpatch==1.14,jsonpointer==1.10,jsonschema==2.5.1,keystoneauth1==2.15.0,linecache2==1.0.0,MarkupSafe==0.23,mccabe==0.2.1,mock==2.0.0,monotonic==1.2,mox3==0.18.0,msgpack-python==0.4.8,netaddr==0.7.18,netifaces==0.10.5,openstacksdk==0.9.9,os-client-config==1.22.0,osc-lib==1.2.0,oslo.config==3.19.0,oslo.context==2.10.0,oslo.i18n==3.10.0,oslo.log==3.17.0,oslo.serialization==2.14.0,oslo.utils==3.17.0,oslosphinx==4.8.0,oslotest==2.11.0,pbr==1.10.0,pep8==1.5.7,positional==1.1.1,prettytable==0.7.2,pycrypto==2.6.1,pyflakes==0.8.1,Pygments==2.1.3,pyinotify==0.9.6,pyparsing==2.1.10,python-barbicanclient==4.1.0,python-ceilometerclient==2.7.0,python-cinderclient==1.9.0,python-dateutil==2.5.3,python-glanceclient==2.5.0,python-heatclient==1.5.0,python-keystoneclient==3.6.0,python-mimeparse==1.6.0,python-neutronclient==6.0.0,python-novaclient==6.0.0,python-openstackclient==3.3.0,python-subunit==1.2.0,python-swiftclient==3.1.0,pytz==2016.7,PyYAML==3.12,reno==1.8.0,requests==2.11.1,requestsexceptions==1.1.3,restructuredtext-lint==0.17.2,rfc3986==0.4.1,simplejson==3.10.0,six==1.10.0,smmap==0.9.0,smmap2==2.0.1,Sphinx==1.2.3,stevedore==1.18.0,testrepository==0.0.20,testscenarios==0.5.0,testtools==2.2.0,traceback2==1.4.0,unicodecsv==0.14.1,unittest2==1.1.0,warlock==1.2.0,websocket-client==0.37.0,wrapt==1.10.8
genconfig runtests: PYTHONHASHSEED='580917436'
genconfig runtests: commands[0] | oslo-config-generator --config-file etc/oslo-config-generator/kolla-build.conf
WARNING:stevedore.named:Could not load kolla
_________________________________________________________________________ summary _________________________________________________________________________
  genconfig: commands succeeded
  congratulations :)
[root@xiexianbin_cn kolla]# 

如果安装失败,可以在/root/kolla/.pip中创建pip.conf文件

[root@xiexianbin_cn kolla]# cat .pip/pip.conf 
[global]
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com
  • 安装python client
yum install http://mirror.centos.org/centos/7/cloud/x86_64/openstack-newton/centos-release-openstack-newton-1-1.el7.noarch.rpm -y
yum install python-openstackclient python-neutronclient
  • 本地docker仓库

all-in-one环境中本地仓库不是必须的这里没有配置

编译镜像

kolla-build
or
kolla-build --base centos --type source/binary [--debug]
kolla-build glance
[root@xiexianbin_cn kolla]# kolla-build --base centos --type binary
INFO:kolla.image.build:Found the docker image folder at /usr/share/kolla/docker
INFO:kolla.image.build:Added image base to queue
INFO:kolla.image.build:Attempting to run task BuildTask(base) for the first time
INFO:kolla.image.build.base:Building
INFO:kolla.image.build.base:Step 1 : FROM centos:7
INFO:kolla.image.build.base: ---> 0584b3d2cf6d
INFO:kolla.image.build.base:Step 2 : MAINTAINER Kolla Project (https://launchpad.net/kolla)
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 10abf31f2438
INFO:kolla.image.build.base:Step 3 : LABEL kolla_version "3.0.2"
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 8e994b8a3017
INFO:kolla.image.build.base:Step 4 : ENV KOLLA_BASE_DISTRO centos
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 506f30e14254
INFO:kolla.image.build.base:Step 5 : ENV KOLLA_INSTALL_TYPE binary
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> dc1dfc5b2731
INFO:kolla.image.build.base:Step 6 : ENV KOLLA_INSTALL_METATYPE mixed
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 83657cf144b4
INFO:kolla.image.build.base:Step 7 : COPY kolla_bashrc /tmp/
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 8dc2ba8cd676
INFO:kolla.image.build.base:Step 8 : RUN cat /tmp/kolla_bashrc >> /etc/skel/.bashrc     && cat /tmp/kolla_bashrc >> /root/.bashrc
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 84f0400ea68f
INFO:kolla.image.build.base:Step 9 : ENV PS1 "$(tput bold)($(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(hostname -s) $(pwd)]$ "
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 7ccde6df8142
INFO:kolla.image.build.base:Step 10 : RUN if [ $(awk '{match($0, /[0-9]+/,version)}END{print version[0]}' /etc/system-release) != "7" ]; then         echo "Only supported 7 release on centos"; false;     fi     && cat /tmp/kolla_bashrc >> /etc/bashrc
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 40057c7bfc5d
INFO:kolla.image.build.base:Step 11 : COPY elasticsearch.repo /etc/yum.repos.d/elasticsearch.repo
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 76d5c9f76079
INFO:kolla.image.build.base:Step 12 : COPY kibana.yum.repo /etc/yum.repos.d/kibana.yum.repo
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 9fb47b44bc63
INFO:kolla.image.build.base:Step 13 : COPY MariaDB.repo /etc/yum.repos.d/MariaDB.repo
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 3e4f4a5d9284
INFO:kolla.image.build.base:Step 14 : COPY influxdb.repo /etc/yum.repos.d/influxdb.repo
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 850510fffa3c
INFO:kolla.image.build.base:Step 15 : COPY grafana.repo /etc/yum.repos.d/grafana.repo
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 0ed48211f8a8
INFO:kolla.image.build.base:Step 16 : RUN yum -y install http://repo.percona.com/release/7/RPMS/x86_64/percona-release-0.1-3.noarch.rpm && yum clean all
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 6d754e6db74d
INFO:kolla.image.build.base:Step 17 : RUN true && rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Percona  && rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch && rpm --import https://repos.influxdata.com/influxdb.key && rpm --import https://packagecloud.io/gpg.key && rpm --import https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> c9ed2cbf01bb
INFO:kolla.image.build.base:Step 18 : RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 0328261e88d7
INFO:kolla.image.build.base:Step 19 : RUN yum -y install epel-release  yum-plugin-priorities centos-release-ceph-jewel centos-release-openstack-newton centos-release-qemu-ev && yum clean all
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 9bdfb6f751e9
INFO:kolla.image.build.base:Step 20 : RUN true  && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization && yum clean all
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 25ab40729557
INFO:kolla.image.build.base:Step 21 : RUN yum -y install curl sudo tar which lvm2 scsi-target-utils iproute iscsi-initiator-utils && yum clean all
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 165acaa6246b
INFO:kolla.image.build.base:Step 22 : COPY set_configs.py /usr/local/bin/kolla_set_configs
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> d65f24754d67
INFO:kolla.image.build.base:Step 23 : COPY start.sh /usr/local/bin/kolla_start
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 5de9357397ff
INFO:kolla.image.build.base:Step 24 : COPY sudoers /etc/sudoers
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 120d6d1d459b
INFO:kolla.image.build.base:Step 25 : COPY curlrc /root/.curlrc
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 73735dd23fda
INFO:kolla.image.build.base:Step 26 : RUN touch /usr/local/bin/kolla_extend_start     && chmod 755 /usr/local/bin/kolla_start /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_set_configs     && chmod 440 /etc/sudoers     && groupadd kolla     && mkdir -p /var/log/kolla     && chown :kolla /var/log/kolla     && chmod 2775 /var/log/kolla     && rm -f /tmp/kolla_bashrc     && curl -sSL https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64 -o /usr/local/bin/dumb-init     && chmod +x /usr/local/bin/dumb-init
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> 84bfc20969e7
INFO:kolla.image.build.base:Step 27 : CMD kolla_start
INFO:kolla.image.build.base: ---> Using cache
INFO:kolla.image.build.base: ---> a8c7aa050759
INFO:kolla.image.build.base:Successfully built a8c7aa050759
INFO:kolla.image.build.base:Built
INFO:kolla.image.build:Added next task BuildTask(elasticsearch) to queue
INFO:kolla.image.build:Added next task BuildTask(multipathd) to queue
INFO:kolla.image.build:Added next task BuildTask(etcd) to queue
INFO:kolla.image.build:Added next task BuildTask(ceph-base) to queue
INFO:kolla.image.build:Added next task BuildTask(kibana) to queue
INFO:kolla.image.build:Added next task BuildTask(kolla-toolbox) to queue
INFO:kolla.image.build:Added next task BuildTask(cron) to queue
INFO:kolla.image.build:Added next task BuildTask(keepalived) to queue
INFO:kolla.image.build:Added next task BuildTask(grafana) to queue
INFO:kolla.image.build:Added next task BuildTask(openstack-base) to queue
INFO:kolla.image.build:Added next task BuildTask(memcached) to queue
INFO:kolla.image.build:Added next task BuildTask(openvswitch-base) to queue
INFO:kolla.image.build:Added next task BuildTask(mongodb) to queue
INFO:kolla.image.build:Added next task BuildTask(influxdb) to queue
INFO:kolla.image.build:Added next task BuildTask(mariadb) to queue
INFO:kolla.image.build:Added next task BuildTask(heka) to queue
INFO:kolla.image.build:Added next task BuildTask(tgtd) to queue
INFO:kolla.image.build:Added next task BuildTask(rabbitmq) to queue
INFO:kolla.image.build:Added next task BuildTask(iscsid) to queue
INFO:kolla.image.build:Added next task BuildTask(telegraf) to queue
INFO:kolla.image.build:Added next task BuildTask(haproxy) to queue
INFO:kolla.image.build:Attempting to run task BuildTask(elasticsearch) for the first time
INFO:kolla.image.build.elasticsearch:Building
INFO:kolla.image.build:Attempting to run task BuildTask(multipathd) for the first time
INFO:kolla.image.build.multipathd:Building
INFO:kolla.image.build:Attempting to run task BuildTask(etcd) for the first time
INFO:kolla.image.build.etcd:Building
INFO:kolla.image.build:Attempting to run task BuildTask(ceph-base) for the first time
INFO:kolla.image.build.ceph-base:Building
INFO:kolla.image.build:Attempting to run task BuildTask(kibana) for the first time
INFO:kolla.image.build.kibana:Building
INFO:kolla.image.build:Attempting to run task BuildTask(kolla-toolbox) for the first time
INFO:kolla.image.build.kolla-toolbox:Building
INFO:kolla.image.build:Attempting to run task BuildTask(cron) for the first time
INFO:kolla.image.build.cron:Building
INFO:kolla.image.build:Attempting to run task BuildTask(keepalived) for the first time
INFO:kolla.image.build.keepalived:Building

....

编译很费时间,简要粘贴一些日志。更多的编译选项可以参看:http://docs.openstack.org/developer/kolla/image-building.html。如果个别镜像编译失败可以重新执行以上操作,因为docker的容器缓存,重新编译会很快。编译成功后生成的镜像如下所示:

编译后的Docker镜像

[root@xiexianbin_cn ~]# docker images
REPOSITORY                                       TAG                 IMAGE ID            CREATED              SIZE
kolla/centos-binary-kolla-toolbox                3.0.2               d349475a477f        24 seconds ago       1.918 GB
kolla/centos-binary-neutron-server               3.0.2               f10522e2552c        About a minute ago   1.09 GB
<none>                                           <none>              099eec38ab93        9 minutes ago        1.09 GB
<none>                                           <none>              b1798c788a96        21 minutes ago       1.09 GB
<none>                                           <none>              48aaadce2971        33 minutes ago       1.09 GB
kolla/centos-binary-magnum-conductor             3.0.2               d5a269e72265        About an hour ago    1.147 GB
kolla/centos-binary-grafana                      3.0.2               ac191df99c1c        About an hour ago    772.6 MB
kolla/centos-binary-magnum-api                   3.0.2               32788dd86f0f        About an hour ago    1.106 GB
<none>                                           <none>              2816797ba3b6        About an hour ago    1.09 GB
<none>                                           <none>              c2acbcd6e2bb        About an hour ago    1.604 GB
<none>                                           <none>              e04b3da60b03        About an hour ago    1.106 GB
kolla/centos-binary-heka                         3.0.2               d6fdf0d36776        About an hour ago    657.4 MB
<none>                                           <none>              181265dfa079        About an hour ago    1.09 GB
kolla/centos-binary-magnum-base                  3.0.2               0d3796f3487b        2 hours ago          1.078 GB
<none>                                           <none>              29db094e43ae        2 hours ago          1.09 GB
<none>                                           <none>              3f7a2322dae3        2 hours ago          586.5 MB
<none>                                           <none>              2cf66892fcf1        2 hours ago          1.09 GB
<none>                                           <none>              f52f2b97d3ad        2 hours ago          1.09 GB
kolla/centos-binary-nova-libvirt                 3.0.2               d652a25e343a        3 hours ago          1.392 GB
kolla/centos-binary-mistral-executor             3.0.2               d16eb9712719        3 hours ago          933.8 MB
kolla/centos-binary-aodh-api                     3.0.2               59694479b1c6        3 hours ago          872.8 MB
kolla/centos-binary-mistral-engine               3.0.2               875d26be8737        3 hours ago          933.8 MB
kolla/centos-binary-aodh-evaluator               3.0.2               3cf8e885992f        3 hours ago          872.8 MB
kolla/centos-binary-ceph-mon                     3.0.2               a81b137524fc        3 hours ago          884.4 MB
kolla/centos-binary-aodh-notifier                3.0.2               6e3d78ae4251        3 hours ago          872.8 MB
kolla/centos-binary-ceph-osd                     3.0.2               6c889b7703da        3 hours ago          884.4 MB
kolla/centos-binary-ceph-rgw                     3.0.2               cb6e9c8ef329        3 hours ago          884.4 MB
kolla/centos-binary-keystone-fernet              3.0.2               f4152b8bfd18        3 hours ago          868.6 MB
kolla/centos-binary-aodh-expirer                 3.0.2               68990d81db8b        3 hours ago          872.8 MB
kolla/centos-binary-trove-taskmanager            3.0.2               7a10224ec327        3 hours ago          827.5 MB
kolla/centos-binary-sahara-api                   3.0.2               bc507ceb09fc        3 hours ago          839.1 MB
<none>                                           <none>              5efec905301f        3 hours ago          1.09 GB
kolla/centos-binary-barbican-worker              3.0.2               86571b427a83        3 hours ago          829.6 MB
kolla/centos-binary-ceilometer-api               3.0.2               7f6933c32c39        3 hours ago          877.1 MB
kolla/centos-binary-barbican-api                 3.0.2               5d4a4fe6160a        3 hours ago          830.4 MB
kolla/centos-binary-heat-engine                  3.0.2               b41ddb70f194        3 hours ago          831.9 MB
kolla/centos-binary-cinder-scheduler             3.0.2               9965981ee913        3 hours ago          1.074 GB
kolla/centos-binary-ceilometer-notification      3.0.2               25fbb2f06fa5        3 hours ago          836.8 MB
kolla/centos-binary-designate-mdns               3.0.2               0dce6aa45f35        3 hours ago          861.1 MB
kolla/centos-binary-designate-pool-manager       3.0.2               af9cf52af3f8        3 hours ago          865.3 MB
kolla/centos-binary-ceph-base                    3.0.2               479cc2abc9e9        3 hours ago          884.4 MB
kolla/centos-binary-zaqar                        3.0.2               0f9b57972fdc        3 hours ago          835.4 MB
kolla/centos-binary-gnocchi-metricd              3.0.2               1931d07551d5        3 hours ago          1.145 GB
kolla/centos-binary-designate-sink               3.0.2               68845380ac8d        3 hours ago          861.1 MB
kolla/centos-binary-openvswitch-db-server        3.0.2               351d6fbfaeb7        3 hours ago          613.3 MB
<none>                                           <none>              dae8d73e4efe        3 hours ago          613.3 MB
kolla/centos-binary-mongodb                      3.0.2               b2585915519e        3 hours ago          776.1 MB
kolla/centos-binary-openvswitch-vswitchd         3.0.2               3820c5b02197        3 hours ago          613.3 MB
<none>                                           <none>              1710596e793f        40 hours ago         770 MB
kolla/centos-binary-openvswitch-base             3.0.2               1488016bb8de        40 hours ago         613.3 MB
kolla/centos-binary-cron                         3.0.2               74c821896c16        40 hours ago         603.8 MB
kolla/centos-binary-memcached                    3.0.2               db20c83927f7        40 hours ago         604.4 MB
kolla/centos-binary-haproxy                      3.0.2               5e4d742fcd32        40 hours ago         623.4 MB
kolla/centos-binary-tgtd                         3.0.2               4fdeb67f8ce9        40 hours ago         586.5 MB
kolla/centos-binary-mistral-api                  3.0.2               2e2def779153        41 hours ago         933.8 MB
<none>                                           <none>              4706855c3777        41 hours ago         933.8 MB
<none>                                           <none>              5c56d094d4b1        41 hours ago         872.8 MB
<none>                                           <none>              c7d4e76ba9dd        41 hours ago         933.8 MB
<none>                                           <none>              28c93cba47b8        41 hours ago         872.8 MB
<none>                                           <none>              ccd975b6d97c        41 hours ago         872.8 MB
<none>                                           <none>              961f467467a5        41 hours ago         872.8 MB
kolla/centos-binary-aodh-listener                3.0.2               ae05ab12540c        41 hours ago         872.8 MB
kolla/centos-binary-manila-share                 3.0.2               1b781f319f19        41 hours ago         871.7 MB
kolla/centos-binary-manila-api                   3.0.2               ec45fb9d2c03        41 hours ago         823.4 MB
kolla/centos-binary-nova-compute                 3.0.2               179c973d5051        41 hours ago         1.398 GB
<none>                                           <none>              9711d7adf5e2        41 hours ago         1.392 GB
kolla/centos-binary-neutron-vpnaas-agent         3.0.2               b885faf258c7        41 hours ago         1.097 GB
kolla/centos-binary-neutron-lbaas-agent          3.0.2               5c7293474e7a        41 hours ago         1.092 GB
<none>                                           <none>              f83292368034        41 hours ago         1.09 GB
kolla/centos-binary-manila-scheduler             3.0.2               ac02e56f53c3        41 hours ago         823.4 MB
kolla/centos-binary-neutron-metadata-agent       3.0.2               9dd38c4bd86a        41 hours ago         1.059 GB
kolla/centos-binary-nova-compute-ironic          3.0.2               d769c643ce44        41 hours ago         1.308 GB
kolla/centos-binary-neutron-linuxbridge-agent    3.0.2               8abdcecd7040        41 hours ago         1.09 GB
kolla/centos-binary-neutron-metering-agent       3.0.2               860e594422a4        41 hours ago         1.09 GB
kolla/centos-binary-neutron-openvswitch-agent    3.0.2               19e30107aa7c        41 hours ago         1.09 GB
kolla/centos-binary-nova-ssh                     3.0.2               db976568e1a4        41 hours ago         878.5 MB
kolla/centos-binary-neutron-dhcp-agent           3.0.2               3fabb84d762b        41 hours ago         1.059 GB
kolla/centos-binary-neutron-l3-agent             3.0.2               3fabb84d762b        41 hours ago         1.059 GB
kolla/centos-binary-nova-novncproxy              3.0.2               22fe8dfca712        41 hours ago         878.1 MB
<none>                                           <none>              61c073ebe4b0        41 hours ago         1.059 GB
kolla/centos-binary-nova-serialproxy             3.0.2               6762279e714b        41 hours ago         877.6 MB
kolla/centos-binary-nova-consoleauth             3.0.2               3ba024378504        41 hours ago         877.6 MB
kolla/centos-binary-nova-api                     3.0.2               acaef6288f70        41 hours ago         877.5 MB
kolla/centos-binary-nova-network                 3.0.2               8c365ac81d82        41 hours ago         851 MB
kolla/centos-binary-nova-conductor               3.0.2               22da0e709721        41 hours ago         877.5 MB
kolla/centos-binary-nova-spicehtml5proxy         3.0.2               da86ec79f00c        41 hours ago         878 MB
kolla/centos-binary-nova-scheduler               3.0.2               e2d005f26476        41 hours ago         877.5 MB
kolla/centos-binary-trove-api                    3.0.2               dbf533f80920        41 hours ago         827.5 MB
kolla/centos-binary-trove-guestagent             3.0.2               b1f772b5953e        41 hours ago         827.8 MB
kolla/centos-binary-trove-conductor              3.0.2               7bc4748089a4        41 hours ago         827.5 MB
<none>                                           <none>              82d2698e65fd        41 hours ago         827.5 MB
kolla/centos-binary-swift-rsyncd                 3.0.2               e59685a05758        41 hours ago         802.9 MB
kolla/centos-binary-swift-account                3.0.2               92c793db719c        41 hours ago         826.1 MB
kolla/centos-binary-swift-object                 3.0.2               9dba2794066f        41 hours ago         826.2 MB
kolla/centos-binary-swift-object-expirer         3.0.2               a8a6a443b0bf        41 hours ago         826.1 MB
kolla/centos-binary-swift-proxy-server           3.0.2               a8a6a443b0bf        41 hours ago         826.1 MB
kolla/centos-binary-cinder-volume                3.0.2               1f4d7bf4449f        41 hours ago         1.076 GB
kolla/centos-binary-swift-container              3.0.2               2931ca348902        41 hours ago         826.1 MB
kolla/centos-binary-cinder-api                   3.0.2               675b7708b5d8        41 hours ago         1.117 GB
kolla/centos-binary-cinder-rpcbind               3.0.2               cb9ca1234a7e        41 hours ago         1.107 GB
kolla/centos-binary-cinder-backup                3.0.2               954f0ac73778        41 hours ago         1.107 GB
<none>                                           <none>              110a64f51305        41 hours ago         826.1 MB
<none>                                           <none>              a9883b9e5af3        41 hours ago         839.1 MB
kolla/centos-binary-sahara-engine                3.0.2               7253bc6c5778        41 hours ago         839.1 MB
<none>                                           <none>              fe9d57db5a57        41 hours ago         868.6 MB
<none>                                           <none>              97fe4e62c609        41 hours ago         1.074 GB
kolla/centos-binary-elasticsearch                3.0.2               2555308e5305        41 hours ago         832.7 MB
kolla/centos-binary-keystone-ssh                 3.0.2               21460edbacff        41 hours ago         869.3 MB
<none>                                           <none>              964f6f8a49d9        41 hours ago         830.4 MB
kolla/centos-binary-keystone                     3.0.2               948d821b93fe        41 hours ago         842.8 MB
kolla/centos-binary-barbican-keystone-listener   3.0.2               839729895d2b        41 hours ago         829.6 MB
<none>                                           <none>              f263035bc58d        41 hours ago         829.6 MB
kolla/centos-binary-heat-api                     3.0.2               13a62f468d3c        41 hours ago         831.9 MB
kolla/centos-binary-heat-api-cfn                 3.0.2               ee6403a9e5c8        41 hours ago         831.9 MB
kolla/centos-binary-glance-api                   3.0.2               b10043d3234a        41 hours ago         935.9 MB
kolla/centos-binary-gnocchi-api                  3.0.2               8abcbb102ad3        42 hours ago         1.145 GB
kolla/centos-binary-glance-registry              3.0.2               472a96cf1d71        42 hours ago         935.9 MB
<none>                                           <none>              cf977ef3727c        42 hours ago         831.9 MB
kolla/centos-binary-gnocchi-statsd               3.0.2               14306243f0d9        42 hours ago         1.145 GB
kolla/centos-binary-murano-api                   3.0.2               bf12533dc723        42 hours ago         822.5 MB
<none>                                           <none>              e27139bbe009        42 hours ago         1.145 GB
kolla/centos-binary-ironic-conductor             3.0.2               632f4c21f63e        42 hours ago         952.6 MB
kolla/centos-binary-ironic-pxe                   3.0.2               228b4a93074e        42 hours ago         840 MB
kolla/centos-binary-ironic-api                   3.0.2               7da08b126272        42 hours ago         836.5 MB
kolla/centos-binary-ironic-inspector             3.0.2               560e307b9025        42 hours ago         842.2 MB
kolla/centos-binary-murano-engine                3.0.2               467de28d8da8        42 hours ago         822.4 MB
kolla/centos-binary-designate-central            3.0.2               781d57c480ca        42 hours ago         861.1 MB
<none>                                           <none>              781e53919c04        42 hours ago         865.3 MB
kolla/centos-binary-designate-backend-bind9      3.0.2               b06a1989ec29        42 hours ago         865.3 MB
<none>                                           <none>              6505fa869600        42 hours ago         861.1 MB
<none>                                           <none>              813af8b30bfd        42 hours ago         861.1 MB
kolla/centos-binary-designate-api                3.0.2               04591aa56a7b        42 hours ago         861.1 MB
<none>                                           <none>              e74ea643bdc4        42 hours ago         877.1 MB
kolla/centos-binary-ceilometer-compute           3.0.2               b20ab481f6e7        42 hours ago         876.7 MB
kolla/centos-binary-ceilometer-central           3.0.2               2c6eb50940c8        42 hours ago         876.7 MB
kolla/centos-binary-ceilometer-collector         3.0.2               cc58a6de1816        42 hours ago         838.2 MB
kolla/centos-binary-mistral-base                 3.0.2               b9394d15d670        42 hours ago         906.8 MB
<none>                                           <none>              13794dc92680        42 hours ago         836.8 MB
kolla/centos-binary-aodh-base                    3.0.2               212e5b792451        42 hours ago         846.9 MB
kolla/centos-binary-manila-base                  3.0.2               ae0678191068        42 hours ago         823.4 MB
kolla/centos-binary-collectd                     3.0.2               5a4e440d2aeb        42 hours ago         796.7 MB
kolla/centos-binary-neutron-base                 3.0.2               947b30bd0eff        42 hours ago         1.059 GB
kolla/centos-binary-tempest                      3.0.2               7d8aed306c53        42 hours ago         873 MB
kolla/centos-binary-nova-base                    3.0.2               d3adf561f36e        42 hours ago         851 MB
kolla/centos-binary-trove-base                   3.0.2               f3e7468ee1f0        42 hours ago         802.5 MB
kolla/centos-binary-swift-base                   3.0.2               6e7498b4b269        42 hours ago         801.2 MB
kolla/centos-binary-horizon                      3.0.2               77dace122edc        42 hours ago         1.003 GB
kolla/centos-binary-rally                        3.0.2               c5668db21d17        42 hours ago         843.5 MB
kolla/centos-binary-cinder-base                  3.0.2               e8f85accdf39        42 hours ago         1.074 GB
kolla/centos-binary-sahara-base                  3.0.2               19eee9052efd        42 hours ago         813.7 MB
kolla/centos-binary-keystone-base                3.0.2               abdde611ed85        42 hours ago         842.8 MB
kolla/centos-binary-barbican-base                3.0.2               94565c026928        42 hours ago         804.5 MB
kolla/centos-binary-glance-base                  3.0.2               5c274f156f9d        42 hours ago         935.9 MB
kolla/centos-binary-kibana                       3.0.2               ec0ac3bdf236        42 hours ago         732.7 MB
kolla/centos-binary-heat-base                    3.0.2               3b7908bcd7df        42 hours ago         806.8 MB
kolla/centos-binary-gnocchi-base                 3.0.2               282d0fe797cf        42 hours ago         1.115 GB
kolla/centos-binary-mariadb                      3.0.2               8510bd2e2dbe        42 hours ago         958.8 MB
kolla/centos-binary-murano-base                  3.0.2               6b587445f4b4        42 hours ago         797.4 MB
kolla/centos-binary-ironic-base                  3.0.2               16e006926092        42 hours ago         811 MB
kolla/centos-binary-designate-base               3.0.2               560219dd4737        42 hours ago         835.5 MB
kolla/centos-binary-ceilometer-base              3.0.2               3a2ce7e2d2c4        42 hours ago         811.2 MB
kolla/centos-binary-dind                         3.0.2               30f2f68a071e        42 hours ago         770 MB
<none>                                           <none>              d4b9d15f11fa        42 hours ago         835.4 MB
<none>                                           <none>              ec8025290a6f        42 hours ago         770 MB
kolla/centos-binary-openstack-base               3.0.2               8878bf97ac8a        42 hours ago         770 MB
kolla/centos-binary-influxdb                     3.0.2               e67f9e81166c        42 hours ago         653 MB
<none>                                           <none>              740d0f9f3d63        42 hours ago         884.4 MB
<none>                                           <none>              8ed7595f2188        42 hours ago         884.4 MB
<none>                                           <none>              e69b5894d42e        42 hours ago         613.3 MB
<none>                                           <none>              aba368b43d42        42 hours ago         613.3 MB
kolla/centos-binary-rabbitmq                     3.0.2               b0ab44ee7852        42 hours ago         645.4 MB
kolla/centos-binary-multipathd                   3.0.2               fa3e747b9d8a        42 hours ago         606.1 MB
kolla/centos-binary-telegraf                     3.0.2               3a14aec32e55        42 hours ago         636 MB
<none>                                           <none>              da12824fa3a6        42 hours ago         776.1 MB
kolla/centos-binary-iscsid                       3.0.2               6ca4d79abf20        42 hours ago         608.2 MB
kolla/centos-binary-etcd                         3.0.2               fe58959d307a        42 hours ago         636 MB
kolla/centos-binary-keepalived                   3.0.2               a4e1d883dc3c        42 hours ago         609.4 MB
<none>                                           <none>              be71a81d439a        42 hours ago         623.4 MB
<none>                                           <none>              4da725eb39c2        42 hours ago         603.8 MB
<none>                                           <none>              036c71724def        42 hours ago         604.4 MB
<none>                                           <none>              51d52e69f3b8        42 hours ago         586.5 MB
kolla/centos-binary-base                         3.0.2               ce9122ed6a7c        42 hours ago         584.8 MB
docker.io/centos                                 7                   0584b3d2cf6d        4 weeks ago          196.5 MB
[root@xiexianbin_cn ~]# 

_注释:以开头的为编译失败的镜像。_

部署容器

  • 生成密码

openstack环境的密码等变量可以在 /etc/kolla/passwords.yml 中指定,为了方便可以使用kolla-genpwd工具自动生成复杂密码。

kolla-genpwd

为了方便,我们修改其中的管理员登陆密码

vim /etc/kolla/passwords.yml
keystone_admin_password: admin
  • 修改部署配置文件

修改/etc/kolla/globals.yml 文件,指定部署的一些信息:

vim /etc/kolla/globals.yml
kolla_base_distro: "centos"
kolla_install_type: "binary"
openstack_release: "3.0.2"
# This should be a VIP, an unused IP on your network that will float between
# the hosts running keepalived for high-availability. When running an All-In-One
# without haproxy and keepalived, this should be the first IP on your
# 'network_interface' as set in the Networking section below.
kolla_internal_vip_address: "192.168.8.120
network_interface: "eno16777736"
neutron_external_interface: "eno33554894"
neutron_plugin_agent: "openvswitch"
openstack_logging_debug: "True"
  • 检查配置
kolla-ansible prechecks

[root@xiexianbin_cn kolla]# kolla-ansible prechecks
Pre-deployment checking : ansible-playbook -i /usr/share/kolla/ansible/inventory/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  /usr/share/kolla/ansible/prechecks.yml 
statically included: /usr/share/kolla/ansible/roles/prechecks/tasks/port_checks.yml
statically included: /usr/share/kolla/ansible/roles/prechecks/tasks/service_checks.yml
statically included: /usr/share/kolla/ansible/roles/prechecks/tasks/package_checks.yml

PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [prechecks : Checking free port for Aodh API] *****************************
ok: [localhost]

TASK [prechecks : Checking free port for Aodh API HAProxy] *********************
ok: [localhost]

TASK [prechecks : Checking free port for Barbican API] *************************
ok: [localhost]

TASK [prechecks : Checking free port for Barbican API HAProxy] *****************
ok: [localhost]

TASK [prechecks : Checking free port for Cinder API] ***************************
ok: [localhost]

TASK [prechecks : Checking free port for Cinder API HAProxy] *******************
ok: [localhost]

TASK [prechecks : Checking free port for Cloudkitty API] ***********************
ok: [localhost]

TASK [prechecks : Checking free port for Cloudkitty API HAProxy] ***************
ok: [localhost]

TASK [prechecks : Checking free port for Glance API] ***************************
ok: [localhost]

TASK [prechecks : Checking free port for Glance API HAProxy] *******************
ok: [localhost]

TASK [prechecks : Checking free port for Glance Registry] **********************
ok: [localhost]

TASK [prechecks : Checking free port for Gnocchi API] **************************
ok: [localhost]

TASK [prechecks : Checking free port for Gnocchi API HAProxy] ******************
ok: [localhost]

TASK [prechecks : Checking free port for Glance Registry HAProxy] **************
ok: [localhost]

TASK [prechecks : Checking free port for Sahara API] ***************************
ok: [localhost]

TASK [prechecks : Checking free port for Sahara API HAProxy] *******************
ok: [localhost]

TASK [prechecks : Checking free port for HAProxy stats] ************************
ok: [localhost]

TASK [prechecks : Checking free port for Heat API] *****************************
ok: [localhost]

TASK [prechecks : Checking free port for Heat API HAProxy] *********************
ok: [localhost]

TASK [prechecks : Checking free port for Heat API CFN] *************************
ok: [localhost]

TASK [prechecks : Checking free port for Heat API CFN HAProxy] *****************
ok: [localhost]

TASK [prechecks : Checking free port for Horizon] ******************************
ok: [localhost]

TASK [prechecks : Checking free port for Horizon HAProxy] **********************
ok: [localhost]

TASK [prechecks : Checking free port for Ironic] *******************************
ok: [localhost]

TASK [prechecks : Checking free port for Ironic HAProxy] ***********************
ok: [localhost]

TASK [prechecks : Checking free port for Keystone Admin] ***********************
ok: [localhost]

TASK [prechecks : Checking free port for Keystone Admin HAProxy] ***************
ok: [localhost]

TASK [prechecks : Checking free port for Keystone Public] **********************
ok: [localhost]

TASK [prechecks : Checking free port for Keystone Public HAProxy] **************
ok: [localhost]

TASK [prechecks : Checking free port for iscsi] ********************************
ok: [localhost]

TASK [prechecks : Checking free port for MariaDB] ******************************
ok: [localhost]

TASK [prechecks : Checking free port for MariaDB HAProxy] **********************
ok: [localhost]

TASK [prechecks : Checking free port for MariaDB WSREP] ************************
ok: [localhost]

TASK [prechecks : Checking free port for MariaDB IST] **************************
ok: [localhost]

TASK [prechecks : Checking free port for MariaDB SST] **************************
ok: [localhost]

TASK [prechecks : Checking free port for Manila API] ***************************
ok: [localhost]

TASK [prechecks : Checking free port for Manila API HAProxy] *******************
ok: [localhost]

TASK [prechecks : Checking free port for Memcached] ****************************
ok: [localhost]

TASK [prechecks : Checking free port for Murano API] ***************************
ok: [localhost]

TASK [prechecks : Checking free port for Murano API HAProxy] *******************
ok: [localhost]

TASK [prechecks : Checking free port for Neutron Server] ***********************
ok: [localhost]

TASK [prechecks : Checking free port for Neutron Server HAProxy] ***************
ok: [localhost]

TASK [prechecks : Checking free port for Nova API] *****************************
ok: [localhost]

TASK [prechecks : Checking free port for Nova API HAProxy] *********************
ok: [localhost]

TASK [prechecks : Checking free port for Nova Metadata] ************************
ok: [localhost]

TASK [prechecks : Checking free port for Nova Metadata HAProxy] ****************
ok: [localhost]

TASK [prechecks : Checking free port for Nova NoVNC Proxy] *********************
ok: [localhost]

TASK [prechecks : Checking free port for Nova NoVNC HAProxy] *******************
ok: [localhost]

TASK [prechecks : Checking free port for Nova Spice HTML5 Proxy] ***************
ok: [localhost]

TASK [prechecks : Checking free port for Nova Spice HTML5 HAProxy] *************
ok: [localhost]

TASK [prechecks : Checking free port for RabbitMQ] *****************************
ok: [localhost]

TASK [prechecks : Checking free port for RabbitMQ Management] ******************
ok: [localhost]

TASK [prechecks : Checking free port for RabbitMQ Management HAProxy] **********
ok: [localhost]

TASK [prechecks : Checking free port for RabbitMQ Cluster] *********************
ok: [localhost]

TASK [prechecks : Checking free port for RabbitMQ EPMD] ************************
ok: [localhost]

TASK [prechecks : Check if all rabbit hostnames are resolvable] ****************
ok: [localhost] => (item=localhost)

TASK [prechecks : fail] ********************************************************
skipping: [localhost] => (item={'_ansible_parsed': True, u'changed': False, u'stdout': u'127.0.0.1       STREAM xiexianbin_cn\n127.0.0.1       DGRAM  \n127.0.0.1       RAW    \n192.168.8.150   STREAM \n192.168.8.150   DGRAM  \n192.168.8.150   RAW    ', '_ansible_no_log': False, 'stdout_lines': [u'127.0.0.1       STREAM xiexianbin_cn', u'127.0.0.1       DGRAM  ', u'127.0.0.1       RAW    ', u'192.168.8.150   STREAM ', u'192.168.8.150   DGRAM  ', u'192.168.8.150   RAW    '], u'warnings': [], '_ansible_item_result': True, u'start': u'2016-12-04 14:21:49.729443', u'delta': u'0:00:00.003364', u'cmd': [u'getent', u'ahostsv4', u'xiexianbin_cn'], 'item': u'localhost', u'rc': 0, 'invocation': {'module_name': u'command', u'module_args': {u'creates': None, u'executable': None, u'_uses_shell': False, u'_raw_params': u'getent ahostsv4 xiexianbin_cn', u'removes': None, u'warn': True, u'chdir': None}}, u'end': u'2016-12-04 14:21:49.732807', u'stderr': u''}) 

TASK [prechecks : Checking free port for Mongodb] ******************************
ok: [localhost]

TASK [prechecks : Checking free port for Mongodb Web] **************************
ok: [localhost]

TASK [prechecks : Checking free port for Mongodb HAProxy] **********************
ok: [localhost]

TASK [prechecks : Checking free port for Rsync] ********************************
ok: [localhost]

TASK [prechecks : Checking free port for Swift Object Server] ******************
ok: [localhost]

TASK [prechecks : Checking free port for Swift Account Server] *****************
ok: [localhost]

TASK [prechecks : Checking free port for Swift Container Server] ***************
ok: [localhost]

TASK [prechecks : Checking free port for Swift Proxy Server] *******************
ok: [localhost]

TASK [prechecks : Checking free port for Swift Proxy Server HAProxy] ***********
ok: [localhost]

TASK [prechecks : Checking free port for RadosGW] ******************************
ok: [localhost]

TASK [prechecks : Checking free port for RadosGW HAProxy] **********************
ok: [localhost]

TASK [prechecks : Checking free port for Senlin API] ***************************
ok: [localhost]

TASK [prechecks : Checking free port for Senlin API HAProxy] *******************
ok: [localhost]

TASK [prechecks : Checking free port for Mistral API] **************************
ok: [localhost]

TASK [prechecks : Checking free port for Mistral API HAProxy] ******************
ok: [localhost]

TASK [prechecks : Checking if kolla_internal_vip_address and kolla_external_vip_address are not pingable from any node] ***
ok: [localhost] => (item=192.168.8.120)
ok: [localhost] => (item=192.168.8.120)

TASK [prechecks : Checking if kolla_internal_vip_address is in the same network as network_interface on all nodes] ***
ok: [localhost]

TASK [prechecks : Checking the network_interface is present] *******************
skipping: [localhost]

TASK [prechecks : Checking the network_interface is active] ********************
skipping: [localhost]

TASK [prechecks : Checking the network_interface configuration] ****************
skipping: [localhost]

TASK [prechecks : Checking the network_interface ip address configuration] *****
skipping: [localhost]

TASK [prechecks : Checking that libvirt is not running] ************************
ok: [localhost]

TASK [prechecks : Checking Docker version] *************************************
ok: [localhost]

TASK [prechecks : Checking if 'MountFlags' for docker service is set to 'shared'] ***
ok: [localhost]

TASK [prechecks : Checking if '/run' mount flag is set to 'shared'] ************
skipping: [localhost]

TASK [prechecks : Checking empty passwords in passwords.yml. Run kolla-genpwd if this task fails] ***
ok: [localhost -> localhost]

TASK [prechecks : Checking fernet_token_expiry in globals.yml. Update fernet_token_expiry to allowed value if this task fails] ***
ok: [localhost -> localhost]

TASK [prechecks : Checking number of network agents] ***************************
skipping: [localhost]

TASK [prechecks : Checking mongodb backend for ceilometer] *********************
skipping: [localhost]

TASK [prechecks : Checking LVM volume group exists for Cinder] *****************
skipping: [localhost]

TASK [prechecks : Checking docker-py version] **********************************
ok: [localhost]

TASK [prechecks : Checking Ansible version] ************************************
skipping: [localhost]

PLAY RECAP *********************************************************************
localhost                  : ok=80   changed=0    unreachable=0    failed=0   

[root@xiexianbin_cn kolla]# 
  • 开始部署
kolla-ansible deploy

[root@xiexianbin_cn ~]# kolla-ansible deploy
Deploying Playbooks : ansible-playbook -i /usr/share/kolla/ansible/inventory/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  -e action=deploy /usr/share/kolla/ansible/site.yml 

PLAY [Gather facts for all hosts] **********************************************

TASK [setup] *******************************************************************
ok: [localhost]

PLAY [ceph-mon,ceph-osd,ceph-rgw] **********************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [common : include] ********************************************************
skipping: [localhost]

TASK [common : Registering common role has run] ********************************
skipping: [localhost]

TASK [ceph : include] **********************************************************
skipping: [localhost]

PLAY [collectd] ****************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [common : include] ********************************************************
skipping: [localhost]

TASK [common : Registering common role has run] ********************************
skipping: [localhost]

TASK [collectd : include] ******************************************************
skipping: [localhost]

PLAY [elasticsearch] ***********************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [common : include] ********************************************************
skipping: [localhost]

TASK [common : Registering common role has run] ********************************
skipping: [localhost]

TASK [elasticsearch : include] *************************************************
skipping: [localhost]

PLAY [influxdb] ****************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [common : include] ********************************************************
skipping: [localhost]

TASK [common : Registering common role has run] ********************************
skipping: [localhost]

TASK [influxdb : include] ******************************************************
skipping: [localhost]

PLAY [telegraf] ****************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [common : include] ********************************************************
skipping: [localhost]

TASK [common : Registering common role has run] ********************************
skipping: [localhost]

TASK [telegraf : include] ******************************************************
skipping: [localhost]

PLAY [haproxy] *****************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [common : include] ********************************************************
included: /usr/share/kolla/ansible/roles/common/tasks/deploy.yml for localhost

TASK [common : include] ********************************************************
included: /usr/share/kolla/ansible/roles/common/tasks/config.yml for localhost

TASK [common : Ensuring config directories exist] ******************************
ok: [localhost] => (item=heka)
ok: [localhost] => (item=kolla-toolbox)
ok: [localhost] => (item=cron)
ok: [localhost] => (item=cron/logrotate)

TASK [common : Copying over config.json files for services] ********************
ok: [localhost] => (item=heka)
ok: [localhost] => (item=kolla-toolbox)
ok: [localhost] => (item=cron)

TASK [common : Copying over heka config files] *********************************
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'aodh'}) 
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'barbican'}) 
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'elasticsearch'}) 
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'global'})
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'gnocchi'}) 
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'haproxy'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'horizon'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'keepalived'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'keystone'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'mariadb'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'openstack'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'rabbitmq'})
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-account-auditor'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-account-reaper'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-account-replicator'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-account-server'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-container-auditor'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-container-replicator'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-container-server'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-container-updater'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-object-auditor'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-object-expirer'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-object-replicator'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-object-server'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-object-updater'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-proxy-server'}) 
skipping: [localhost] => (item={u'src': u'swift', u'enabled': u'no', u'name': u'swift-rsyncd'}) 

TASK [common : Heka custom config file exists] *********************************
ok: [localhost]

TASK [common : Copying over heka custom config file] ***************************
skipping: [localhost]

TASK [common : Copying over cron logrotate config files] ***********************
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'ansible'})
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'aodh'}) 
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'barbican'}) 
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'cinder'}) 
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'cloudkitty'}) 
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'glance'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'global'})
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'gnocchi'}) 
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'haproxy'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'heat'})
skipping: [localhost] => (item={u'enabled': False, u'name': u'iscsid'}) 
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'keepalived'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'keystone'})
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'magnum'}) 
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'manila'}) 
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'mariadb'})
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'mistral'}) 
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'murano'}) 
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'neutron'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'nova'})
ok: [localhost] => (item={u'enabled': u'yes', u'name': u'rabbitmq'})
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'sahara'}) 
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'senlin'}) 
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'swift'}) 
skipping: [localhost] => (item={u'enabled': u'no', u'name': u'watcher'}) 

TASK [common : include] ********************************************************
included: /usr/share/kolla/ansible/roles/common/tasks/bootstrap.yml for localhost

TASK [common : Creating log volume] ********************************************
ok: [localhost]

TASK [common : include] ********************************************************
included: /usr/share/kolla/ansible/roles/common/tasks/start.yml for localhost

TASK [common : Starting heka container] ****************************************
...

漫长的部署,部署成功后查看容器

docker ps
  • 添加iptables
[root@xiexianbin_cn ~]# yum install iptables-services -y
[root@xiexianbin_cn ~]# iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
[root@xiexianbin_cn ~]# iptables -I INPUT -p tcp -m tcp --dport 6080 -j ACCEPT
[root@xiexianbin_cn ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables: Full path required for exclude: net:[4026531956].
Full path required for exclude: net:[4026531956].
                                                           [  OK  ]
[root@xiexianbin_cn ~]# 
  • 修改虚拟化类型

因为是在虚拟机中安装,不支持kvm,需要修改虚拟类型为qemu

vim /etc/kolla/nova-compute/nova.conf
[libvirt]
...
virt_type=qemu
  • 配置网卡

若使用单网卡,在部署到 neutron-ovs 容器的时候会断网, 需要配置 br-ex网桥,配置内容如下:

cat /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE=OVSPort
DEVICE=eno16777736
ONBOOT=yes
DEVICETYPE=ovs
OVS_BRIDGE=br-ex

vim /etc/sysconfig/network-scripts/ifcfg-br-ex
DEVICE=br-ex
DEVICETYPE=ovs
TYPE=OVSBridge
BOOTPROTO=static
IPADDR=192.168.8.150
NETMASK=255.255.255.0
GATEWAY=192.168.8.1

重启网络服务:

systemctl restart network

我配置的是多网卡,不会遇到这个问题。

  • 启动的Docker服务
[root@xiexianbin_cn ~]# docker ps
CONTAINER ID        IMAGE                                                 COMMAND             CREATED             STATUS              PORTS               NAMES
c0f2825cf1b5        kolla/centos-binary-horizon:3.0.2                     "kolla_start"       9 minutes ago       Up 9 minutes                            horizon
d2f56206421f        kolla/centos-binary-heat-engine:3.0.2                 "kolla_start"       10 minutes ago      Up 10 minutes                           heat_engine
f86fd08b784c        kolla/centos-binary-heat-api-cfn:3.0.2                "kolla_start"       10 minutes ago      Up 10 minutes                           heat_api_cfn
50ab3a69dc29        kolla/centos-binary-heat-api:3.0.2                    "kolla_start"       10 minutes ago      Up 10 minutes                           heat_api
d2cc908ab721        kolla/centos-binary-neutron-metadata-agent:3.0.2      "kolla_start"       10 minutes ago      Up 10 minutes                           neutron_metadata_agent
47b8f1eb0652        kolla/centos-binary-neutron-l3-agent:3.0.2            "kolla_start"       10 minutes ago      Up 10 minutes                           neutron_l3_agent
97f05805fa61        kolla/centos-binary-neutron-dhcp-agent:3.0.2          "kolla_start"       11 minutes ago      Up 11 minutes                           neutron_dhcp_agent
e5b81d39ffe3        kolla/centos-binary-neutron-openvswitch-agent:3.0.2   "kolla_start"       11 minutes ago      Up 11 minutes                           neutron_openvswitch_agent
2d8df58fe156        kolla/centos-binary-neutron-server:3.0.2              "kolla_start"       11 minutes ago      Up 11 minutes                           neutron_server
af9de73fb369        kolla/centos-binary-openvswitch-vswitchd:3.0.2        "kolla_start"       11 minutes ago      Up 11 minutes                           openvswitch_vswitchd
6a4f5db7a725        kolla/centos-binary-openvswitch-db-server:3.0.2       "kolla_start"       11 minutes ago      Up 11 minutes                           openvswitch_db
df19c251179f        kolla/centos-binary-nova-ssh:3.0.2                    "kolla_start"       12 minutes ago      Up 12 minutes                           nova_ssh
5c544565017f        kolla/centos-binary-nova-compute:3.0.2                "kolla_start"       12 minutes ago      Up 12 minutes                           nova_compute
987ff3a4c1bf        kolla/centos-binary-nova-libvirt:3.0.2                "kolla_start"       12 minutes ago      Up 12 minutes                           nova_libvirt
5a56fec78543        kolla/centos-binary-nova-conductor:3.0.2              "kolla_start"       12 minutes ago      Up 12 minutes                           nova_conductor
e57dad22f626        kolla/centos-binary-nova-scheduler:3.0.2              "kolla_start"       12 minutes ago      Up 12 minutes                           nova_scheduler
d6ae96e4e8fa        kolla/centos-binary-nova-novncproxy:3.0.2             "kolla_start"       12 minutes ago      Up 12 minutes                           nova_novncproxy
4d5d493f3310        kolla/centos-binary-nova-consoleauth:3.0.2            "kolla_start"       12 minutes ago      Up 12 minutes                           nova_consoleauth
978af2be2627        kolla/centos-binary-nova-api:3.0.2                    "kolla_start"       12 minutes ago      Up 12 minutes                           nova_api
aa75fc975097        kolla/centos-binary-glance-api:3.0.2                  "kolla_start"       14 minutes ago      Up 14 minutes                           glance_api
33a0e1547df6        kolla/centos-binary-glance-registry:3.0.2             "kolla_start"       14 minutes ago      Up 14 minutes                           glance_registry
33e56c677b1a        kolla/centos-binary-keystone:3.0.2                    "kolla_start"       15 minutes ago      Up 15 minutes                           keystone
fd4757100788        kolla/centos-binary-rabbitmq:3.0.2                    "kolla_start"       15 minutes ago      Up 15 minutes                           rabbitmq
a96bacf389c9        kolla/centos-binary-mariadb:3.0.2                     "kolla_start"       16 minutes ago      Up 16 minutes                           mariadb
a67f4d0b47b0        kolla/centos-binary-memcached:3.0.2                   "kolla_start"       16 minutes ago      Up 16 minutes                           memcached
e8993732e77e        kolla/centos-binary-keepalived:3.0.2                  "kolla_start"       16 minutes ago      Up 16 minutes                           keepalived
ddd5060c476a        kolla/centos-binary-haproxy:3.0.2                     "kolla_start"       16 minutes ago      Up 16 minutes                           haproxy
dba52b3238a6        kolla/centos-binary-cron:3.0.2                        "kolla_start"       17 minutes ago      Up 17 minutes                           cron
2247007218a4        kolla/centos-binary-kolla-toolbox:3.0.2               "kolla_start"       17 minutes ago      Up 17 minutes                           kolla_toolbox
b1e164d8a425        kolla/centos-binary-heka:3.0.2                        "kolla_start"       17 minutes ago      Up 17 minutes                           heka
[root@xiexianbin_cn ~]# 

然后就可以通过 kolla_internal_vip_address 访问openstack环境

登录页面:

Kolla horizon登录页面

horizon页面:

Kolla horizon管理页面

工具介绍

部署完成后,运行以下命令可以生成一个openrc文件(运行openstack CLI所需的环境变量):

kolla-ansible post-deploy

openrc文件生成之后,使用以下命令可以帮你做一下openstack的初始化工作,包括上传一个glance镜像以及创建几个虚拟网络:

source /etc/kolla/admin-openrc.sh
kolla/tools/init-runonce

由于错误的出现,可能需要多次的部署,而有些错误重新部署是不会进行修正的,所以需要将整个环境进行清理:

tools/cleanup-containers                #可用于从系统中移除部署的容器
tools/cleanup-host                      #可用于移除由于残余网络变化引发的docker启动的neutron-agents主机
tools/cleanup-images                    #可用于从本地缓存中移除所有的docker image

日志查看,kolla通过heka容器来收集所有容器的日志:

docker exec -it heka bash

所有的容器都可以从这个目录中获取服务日志:/var/log/kolla/SERVICE_NAME。如果需要输出日志,请运行:

docker logs

大多数容器不会stdout,上面的命令将不会提供信息。

Kolla使用

OpenStack Docker Images

本地Build Image,因为远程的pull image 速度太慢 而且 Kolla 社区不是每个commit修改都把image build一遍,所以本地build image是开发最好的选择。推荐使用source方式build。

Docker images:

https://hub.docker.com/u/kollaglue/ 

image building guide:

http://docs.openstack.org/developer/kolla/image-building.html 

Docker Hub:

https://docs.docker.com/engine/userguide/containers/dockerimages/

Kolla代码目录结构

  • ansible - Contains Ansible playbooks to deploy Kolla in Docker containers.

  • demos - Contains a few demos to use with Kolla.

  • dev/heat - Contains an OpenStack-Heat based development environment.

  • dev/vagrant - Contains a vagrant VirtualBox/Libvirt based development environment.

  • doc - Contains documentation.

  • etc - Contains a reference etc directory structure which requires configuration of a small number of configuration variables to achieve a working All-in-One (AIO) deployment.

  • docker - Contains jinja2 templates for the docker build system.

  • tools - Contains tools for interacting with Kolla.

  • specs - Contains the Kolla communities key arguments about architectural shifts in the code base.

  • tests - Contains functional testing tools.

Debugging Kolla

可以通过执行的部署目标来确定容器的状态:

docker ps –a

通过日志来进行检查:

docker exec -it heka bash

所有的容器都可以从这个目录中获取服务日志:/var/log/kolla/SERVICE_NAME。Docker使用heka来展现收集到的日志信息。

如果需要输出日志,请运行:

docker logs <container-name>

请注意,大多数容器不会stdout,上面的命令将不会提供信息。

Kolla架构

Kolla项目的HA架构,如下图所示,大家应该一看就明白吧。是的,正如其他OpenStack项目一样,对于MySQL的HA方案,默认采用的均是Galera。 源码路径:specs/ha.svg

Kolla架构

Kolla节点的网络架构,如下图所示。Kolla节点有2张网卡(eth0 IP由DHCP分配,用于内网使用;eth1 IP手动配置,用于外网使用,2个网段均和Neutron Router交互)。源码路径:doc/kollanet.png

Kolla架构

PS:安装部署bug调试

启动docker镜像:

docker run -i -t -v /var/lib/kolla/config_files/config.json:/var/lib/kolla/config_files/config.json kolla/centos-binary-base:3.0.2 /bin/bash

参考

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

http://docs.openstack.org/developer/kolla/quickstart.html

https://xiexianbin.cn/python/2016/09/18/pip-cloud-not-use-pypi.python.org-bug-for-China

https://wiki.openstack.org/wiki/Kolla

完毕。