记录下kolla-build镜像时,遇到的一些问题,既为了方便自己以后问题的查找,也为了帮助别人避免踩这些坑。遇到的问题会持续更新在博客里面。

问题1:使用的kolla 版本是ocata版本,本地已经搭建好yum源,并且在以前制作镜像的时候,一直是好的,今天再次编译镜像,一直报如下的错误

INFO:kolla.image.build.base:---> Package pciutils-libs.x86_64 0:3.5.1-3.el7 will be installed
INFO:kolla.image.build.base:---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed
INFO:kolla.image.build.base:---> Package perl-parent.noarch 1:0.225-244.el7 will be installed
INFO:kolla.image.build.base:---> Package sysvinit-tools.x86_64 0:2.88-14.dsf.el7 will be installed
INFO:kolla.image.build.base:--> Finished Dependency Resolution
INFO:kolla.image.build.base:Error: Package: 7:device-mapper-event-1.02.146-4.el7.x86_64 (base)
INFO:kolla.image.build.base: Requires: device-mapper = 7:1.02.146-4.el7
INFO:kolla.image.build.base: Installed: 7:device-mapper-1.02.149-10.el7_6.2.x86_64 (@Updates)
INFO:kolla.image.build.base: device-mapper = 7:1.02.149-10.el7_6.2
INFO:kolla.image.build.base: Available: 7:device-mapper-1.02.146-4.el7.x86_64 (base)
INFO:kolla.image.build.base: device-mapper = 7:1.02.146-4.el7
INFO:kolla.image.build.base:
INFO:kolla.image.build.base: You could try using --skip-broken to work around the problem
INFO:kolla.image.build.base: You could try running: rpm -Va --nofiles --nodigest

原因分析:遇到这个问题的时候,一开始以为自己的yun源出现了问题,所以去本地yum源里面去查找是否有device-mapper-event-1.02.146-4.el7.x86_64这个rpm包,在base/update里面,检查了一遍都存在这个包。后来怀疑是centos基础镜像有问题,就使用docker run -it centos启动了一个容器,在容器里面使用rpm -qa |grep device命令查看的时候,发现系统里面安装了device-mapper-1.02.149-10.el7_6.2.x86_64。kolla build编译进行需要的是device-mapper-event-1.02.146-4.el7.x86_64这个rpm包,但是系统已经安装了149的版本,造成了这种问题。处理方式时,幸亏以前搭建的kolla build服务器还在,把对应的centos基础镜像拷贝过来,导入到该环境里,启动一个容器以后,再次检查他的devcie相关包,发现确实是146的版本,所以以前的编译没有问题。

[root@localhost base]# docker run -it 75835a67d134 /bin/bash
[root@730fd71696a2 /]# rpm -qa |grep device
device-mapper-1.02.146-4.el7.x86_64
device-mapper-libs-1.02.146-4.el7.x86_64
[root@730fd71696a2 /]#

导入基础centos镜像以后,在编译镜像时,使用特定的私有仓库中的基础镜像

kolla-build -b centos --base-tag 7 --base-image 172.19.146.34:5001/centos/centos --tag ocata --type source keystone

问题的根因是kolla-build -b centos --base-tag 7 --tag ocata --type source keystone命令行执行的时候,每次都去官网拉去一遍centos基础镜像,再进行下一步的操作。而官网的centos基础镜像几乎每天都有新的rpm更新,导致与本地的yum源不匹配,造成异常

教训:在kolla-build镜像的时候,搭建自己的yum源,并且成功编译出镜像时,一定要把基础镜像保存一份,以后一直用这个基础镜像,否则一直拉取官网的最新镜像,在编译openstack镜像时,会造成各种异常的情况,并且一直更新yum源也很费事

问题2:kolla-ansible -i ./all-in-one pull 编译的镜像时,一直提示如下的错误

TASK [common : include] *******************************************************************************************************************************
included: /usr/share/kolla-ansible/ansible/roles/common/tasks/bootstrap.yml for localhost TASK [common : Creating log volume] *****************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "msg": "'Traceback (most recent call last):\\n
File \"/tmp/ansible_7mwoMR/ansible_module_kolla_docker.py\", line 802, in main\\n dw = DockerWorker(module)\\n
File \"/tmp/ansible_7mwoMR/ansible_module_kolla_docker.py\", line 221, in __init__\\n self.dc = get_docker_client()(**options)\\n
File \"/usr/lib/python2.7/site-packages/docker/client.py\", line 99, in __init__\\n self._version = self._retrieve_server_version()\\n
File \"/usr/lib/python2.7/site-packages/docker/client.py\", line 124, in _retrieve_server_version\\n
\\'Error while fetching server API version: {0}\\'.format(e)\\n
DockerException: Error while fetching server API version: Timeout value connect was Timeout(connect=60, read=60, total=None),
but it must be an int, float or None.\\n'"}
to retry, use: --limit @/usr/share/kolla-ansible/ansible/site.retry PLAY RECAP *******************************************************************************************************************************************
localhost : ok=19 changed=8 unreachable=0 failed=1

 原因分析:第一次拉取不管是官方镜像还是自己源码编译的镜像,都能成功的部署起来,但是执行命令kolla-ansible destroy --include-images --yes-i-really-really-mean-it把

部署的容器和缓存的镜像去掉,重新部署的时候,一直报以前的错误。后来谷歌了一下,是requests版本太高的问题。方法是把requests的版本降到requests==2.17.3就可以了

过程如下:

[root@controller ~]# pip list |grep requests
requests 2.19.1
requestsexceptions 1.4.0
[root@controller ~]#
[root@controller ~]# pip uninstall requests
Uninstalling requests-2.19.1:
Would remove:
/usr/lib/python2.7/site-packages/requests-2.19.1.dist-info/*
/usr/lib/python2.7/site-packages/requests/*
Would not remove (might be manually added):
/usr/lib/python2.7/site-packages/requests/packages/__init__.py
/usr/lib/python2.7/site-packages/requests/packages/__init__.pyo
Proceed (y/n)? y
Successfully uninstalled requests-2.19.1
[root@controller ~]#
[root@controller ~]# pip install requests==2.17.3

 备注:requests 2.18.xx 系列也有这个问题,为了保险起见,最好直接使用requests==2.17.3或者使用2.20.1

[root@localhost ~]# pip list |grep requests
requests 2.20.1
requestsexceptions 1.4.0
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# python
Python 2.7.5 (default, Jul 13 2018, 13:06:57)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
>>> c = docker.Client(base_url='unix://var/run/docker.sock', version='1.15', timeout=2.0)
>>> l = c.containers(all=True)
>>> quit()
[root@localhost ~]#

问题3:kolla-ansible部署完以后,执行openstack 命令报如下错误

[root@controller ~]# source /etc/kolla/admin-openrc.sh
[root@controller ~]# openstack service list
Traceback (most recent call last):
File "/usr/bin/openstack", line 7, in <module>
from openstackclient.shell import main
File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 23, in <module>
from osc_lib import shell
File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 33, in <module>
from osc_lib.cli import client_config as cloud_config
File "/usr/lib/python2.7/site-packages/osc_lib/cli/client_config.py", line 18, in <module>
from openstack.config import exceptions as sdk_exceptions
File "/usr/lib/python2.7/site-packages/openstack/__init__.py", line 17, in <module>
import openstack.connection
File "/usr/lib/python2.7/site-packages/openstack/connection.py", line 166, in <module>
from openstack import cloud as _cloud
File "/usr/lib/python2.7/site-packages/openstack/cloud/__init__.py", line 20, in <module>
from openstack.cloud.openstackcloud import OpenStackCloud
File "/usr/lib/python2.7/site-packages/openstack/cloud/openstackcloud.py", line 49, in <module>
from openstack.cloud import _utils
File "/usr/lib/python2.7/site-packages/openstack/cloud/_utils.py", line 28, in <module>
from decorator import decorator
ImportError: No module named decorator

  原因是 decorator包为3.4.0版本太低,导致,升级完以后,就没有问题了

[root@controller ~]# pip list |grep decorator
decorator 3.4.0
[root@controller ~]# pip install -U decorator
Looking in indexes: http://172.19.146.225:8081/
Collecting decorator
Downloading http://172.19.146.225:8081/packages/decorator-4.3.0-py2.py3-none-any.whl
Installing collected packages: decorator
Found existing installation: decorator 3.4.0
Uninstalling decorator-3.4.0:
Successfully uninstalled decorator-3.4.0
Successfully installed decorator-4.3.0

  问题4:kolla-ansible部署完以后,执行openstack 命令报如下错误

Traceback (most recent call last):
File "/usr/bin/openstack", line 7, in <module>
from openstackclient.shell import main
File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 22, in <module>
from osc_lib.api import auth
File "/usr/lib/python2.7/site-packages/osc_lib/api/auth.py", line 22, in <module>
from osc_lib.i18n import _
File "/usr/lib/python2.7/site-packages/osc_lib/i18n.py", line 16, in <module>
import oslo_i18n
File "/usr/lib/python2.7/site-packages/oslo_i18n/__init__.py", line 14, in <module>
from ._gettextutils import *
File "/usr/lib/python2.7/site-packages/oslo_i18n/_gettextutils.py", line 24, in <module>
from babel import localedata
ImportError: No module named babel

  原因是babel包 为2.3.4版本太低导致,升级完包以后,就可以了

[root@controller ~]# pip unintall Babel
[root@controller ~]# pip install Babel
Looking in indexes: http://172.19.146.50:8081/
Requirement already satisfied: Babel in /usr/lib/python2.7/site-packages (2.3.4)
Requirement already satisfied: pytz in /usr/lib/python2.7/site-packages (from Babel) (2016.10)
[root@controller ~]# pip install Babel==2.6.0
Looking in indexes: http://172.19.146.50:8081/
Collecting Babel==2.6.0

 问题5:有时升级包时出现如下错误

[root@controller ~]# pip install -U wrapt
Looking in indexes: http://172.19.146.225:8081/simple/
Collecting wrapt
Downloading http://172.19.146.225:8081/packages/simple/wrapt/wrapt-1.10.11.tar.gz
Installing collected packages: wrapt
Found existing installation: wrapt 1.10.8
Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to
only a partial uninstall.

 解决方法:

[root@controller ~]# pip install --ignore-installed -U wrapt
Looking in indexes: http://172.19.146.225:8081/simple/
Collecting wrapt
Downloading http://172.19.146.225:8081/packages/simple/wrapt/wrapt-1.10.11.tar.gz
Installing collected packages: wrapt
Running setup.py install for wrapt ... done
Successfully installed wrapt-1.10.11
[root@controller ~]#

  

kolla-build镜像时,问题汇总的更多相关文章

  1. 树莓派及其他硬件平台国内外Linux镜像站全汇总

    转载至segmentfault. 本文收集整理国内对于Raspberry Pi.CubieBoard.pcDuino等各种Linux开源硬件平台,所使用的Raspbian.Arch Linux ARM ...

  2. 快速解决docker生成镜像时提示Could not resolve ‘archive.ubuntu.com’问题

    今天在其中一台Linux 中使用Docker命令创建镜像时失败,报错提示: Temporary failure resolving ‘archive.ubuntu.com’ 典型的DNS解析问题,尝试 ...

  3. howto:在构建基于debian的docker基础镜像时,更换国内包源

    debian经常被用作构建应用镜像的基础镜像,如微软在构建linux下的dotnetcore基础镜像时,提供了基于debian 8(jessie)和debian 9(stretch)的镜像. 由于这些 ...

  4. Linux上通过MySQL命令访问MySQL数据库时常见问题汇总

    Linux上通过mysql命令访问MySQL数据库时常见问题汇总 1)创建登录账号 #创建用户并授权 #允许本地访问 create user 'test'@'localhost' identified ...

  5. docker 执行 docker system prune 导致Azure Devops build镜像失败

    运行docker的centos上, 只分配了16G的空间, 装了个mysql, 还有个rancher, 就只剩下2G的空间了, Azure Devops build镜像就出错了, 显示存储空间不足, ...

  6. 使用dockerfile文件创建镜像时docker build没有反应

    问题: 先 docker pull centos:7 拉取了一个官方的基础镜像,为后续创建jdk8镜像做准备,在创建如下的dockerfile文件 执行docker build -t jdk_8u19 ...

  7. Gradle Build速度加快方法汇总

    Android Studio用起来越来越顺手,但是却发现Build的速度实在不敢恭维,在google和度娘了几把(....)之后,大体就是分配更高的内存,步骤:Setting-->搜索gradl ...

  8. kolla出现问题时的定位方式

    前提,对官网问题的一个翻译 Troubleshooting Guide排障手册 1.Failures(失败) If Kolla fails, often it is caused by a CTRL- ...

  9. # 构建以及运行Springboot Docker镜像时的变量传递

    Docker可以把我们的运行环境打包,然后我们只要run就可以了.大部分hello world都是这么写的.但都缺少了实际应用环节.以springboot为例,hello world的Dockerfi ...

随机推荐

  1. walle代码发布系统配置

    walle Walle 一个web部署系统工具,配置简单.功能完善.界面流畅.开箱即用! 支持git.svn版本管理,支持各种web代码发布, PHP,Python,JAVA等代码的发布.回滚,可以通 ...

  2. c++11之三: sizeof运算符 auto的优势 __func__预定义标识符

    在C++11中,对非静态成员变量使用sizeof操作是合法的. auto推导的一个最大优势就是在拥有初始化表达式的复杂类型变量声明时简化代码.如:std:vector<std::string&g ...

  3. 用反射封装HttpHandler,实现通过action方法名调用方法

    using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Sy ...

  4. QQ控件时光轴特效总结

    1.插入HTML数据 插入html代码,一般的做法是通过document.getElementById("").innerHTML来实现. 然而在该控件中,它通过JS replac ...

  5. PostgreSQL 备份和恢复

    备份和恢复有三种不同的基本方法来备份PostgreSQL数据SQL转储文件系统级备份File system level backup连续归档 1. SQL转储 pg_dump dbname > ...

  6. 第 十六 课 Map

    Map 是一种无序的键值对的集合 var mymap map[string]string //先声明一个字典(map)名字叫做mymap,其key所对应的数据类型是string[字符串],value所 ...

  7. sql语句优化方案

    1. 为查询缓存优化你的查询 NOW() 和 RAND() 或是其它的诸如此类的SQL函数都不会开启查询缓存,因为这些函数的返回是会不定的易变的. 所以,你所需要的就是用一个变量来代替MySQL的函数 ...

  8. Solaris10 如何设置空闲ssh连接超时断开

    在ssh的配置文件中有2个参数可以控制空闲连接超时断开.这2个参数是ClientAliveCountMax和ClientAliveInterval. Solaris10上设置空闲ssh连接超时断开的方 ...

  9. Howto Reboot or halt Linux system in emergency (ZT)

    http://www.cyberciti.biz/tips/reboot-or-halt-linux-system-in-emergency.html Linux kernel includes ma ...

  10. chrome开发者工具的使用

    转自:https://blog.csdn.net/csdnligao/article/details/53925094