cinder 基于镜像创建volume, 竟然下载镜像,问题排查
2017-08-16 15:23
561 查看
批量创建50台主机,发现特别慢,查看cinder-volume日志,发现有大量的 下载镜像的过程。这就很奇怪了,为什么会下载镜像
于是查看代码,看代码一切正常,除非image_location为空,才有可能会下载镜像。
于是继续debug,发现果然没有image_location了, 为什么会出现这种情况? 使用glance 命令在次查看,是有 location的啊。
于是在继续debug,发现一个 def get_location的方法
于是马上查看 /etc/cinder/cinder.conf 配置文件,搜索 glance_api_version 发现,是等于 2 的啊,于是查看代码,发现10.0.4版本的代码glance_api_version默认是1,这就坑了。
但是我配置文件里设置了等于2了啊,这就郁闷了,难道是/usr/share/cinder 起作用?
于是到处搜索 glance_api_version ,终于在代码里找到了,10.0.4 版本glance_api_version 是1,可是我配置文件里写了2啊,于是写在ceph的块里了,在[default]下面也要写。
于是在[default] 下加上 glance_api_version = 2, 完全解决。还顺便看了下整个cinder创建的流程, taskflow, ceph删除快照和查看快照等。 解决问题就是一个很好的学习过程吧。
于是查看代码,看代码一切正常,除非image_location为空,才有可能会下载镜像。
于是继续debug,发现果然没有image_location了, 为什么会出现这种情况? 使用glance 命令在次查看,是有 location的啊。
于是在继续debug,发现一个 def get_location的方法
def get_location(self, context, image_id): """Get backend storage location url. Returns a tuple containing the direct url and locations representing the backend storage location, or (None, None) if these attributes are not shown by Glance. """ if CONF.glance_api_version == 1: 在glance_api_version == 1的时候才会直接返回 None # image location not available in v1 return (None, None) try: # direct_url is returned by v2 api client = GlanceClientWrapper(version=2) image_meta = client.call(context, 'get', image_id) except Exception: _reraise_translated_image_exception(image_id) if not self._is_image_available(context, image_meta): raise exception.ImageNotFound(image_id=image_id) # some glance stores like nfs only meta data # is stored and returned as locations. # so composite of two needs to be returned. return (getattr(image_meta, 'direct_url', None), getattr(image_meta, 'locations', None))
于是马上查看 /etc/cinder/cinder.conf 配置文件,搜索 glance_api_version 发现,是等于 2 的啊,于是查看代码,发现10.0.4版本的代码glance_api_version默认是1,这就坑了。
但是我配置文件里设置了等于2了啊,这就郁闷了,难道是/usr/share/cinder 起作用?
于是到处搜索 glance_api_version ,终于在代码里找到了,10.0.4 版本glance_api_version 是1,可是我配置文件里写了2啊,于是写在ceph的块里了,在[default]下面也要写。
于是在[default] 下加上 glance_api_version = 2, 完全解决。还顺便看了下整个cinder创建的流程, taskflow, ceph删除快照和查看快照等。 解决问题就是一个很好的学习过程吧。
相关文章推荐
- [问题篇]VMWare搭建Openstack——Cinder创建扩展Volume的状态Error的问题
- 【cinder】从snapshot中创建volume都在同一节点的问题
- 解决pod创建成功但未正常启动的问题:pod-infrastructure镜像下载失败
- Docker实战:基于centos7镜像创建ssh容器
- 注册谷歌帐号以及用其他镜像解决android sdk的下载问题(已解决)
- Win10 TH2正式版微软官方中文简体ISO镜像下载 附介质创建工具下载
- openfiler物理机web界面无法创建物理卷(Physical volume)问题
- Delphi调用基于CXF创建的Web Service问题
- ubuntu Genymotion 解决虚拟镜像下载速度特别慢的问题
- 基于centos7镜像创建可以ssh链接的Docker容器
- 基于jquery的关于动态创建DOM元素的问题
- Genymotion 解决虚拟镜像下载速度特别慢的问题
- docker基于宿主机系统版本创建镜像
- 1.5-docker基于本地模板创建镜像
- 基于tomcat的应用镜像遇到的问题
- 解决docker镜像无法下载的问题
- Cacti源码分析:创建图像自动生成title截断问题的排查处理
- rexray在CentOS上不能创建ceph rbd的docker volume问题定位
- 第一行代码 3.4.2 创建自定义控件 章节中初上手出项的下载完成后闪退问题和自定义控件无反应问题
- 注册谷歌帐号以及用其他镜像解决android sdk的下载问题(已解决)