cinder 基于镜像创建volume, 竟然下载镜像,问题排查
发布日期:2021-09-16 04:36:55
浏览次数:6
分类:技术文章
本文共 1706 字,大约阅读时间需要 5 分钟。
批量创建50台主机,发现特别慢,查看cinder-volume日志,发现有大量的 下载镜像的过程。这就很奇怪了,为什么会下载镜像
于是查看代码,看代码一切正常,除非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删除快照和查看快照等。 解决问题就是一个很好的学习过程吧。
转载地址:https://blog.csdn.net/wllabs/article/details/77248358 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
能坚持,总会有不一样的收获!
[***.219.124.196]2024年04月16日 20时12分20秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
L2-021 点赞狂魔 (25 分)【优化后的】
2019-04-26
L2-032 彩虹瓶 (25 分)
2019-04-26
L2-004 这是二叉搜索树吗? (25 分)
2019-04-26
L2-011 玩转二叉树 (25 分)
2019-04-26
L2-006 树的遍历 (25 分)
2019-04-26
L3-010 是否完全二叉搜索树 (30 分)
2019-04-26
6-10 阶乘计算升级版 (20 分)
2019-04-26
7-78 阅览室 (20 分)
2019-04-26
7-21 查验身份证 (15 分)
2019-04-26
实验4-1-5 韩信点兵 (10 分)
2019-04-26
1016 部分A+B (15 分)
2019-04-26
1023 组个最小数 (20 分)
2019-04-26
1036 跟奥巴马一起编程 (15 分)
2019-04-26
1002 写出这个数 (20 分)
2019-04-26
1010 一元多项式求导 (25 分)
2019-04-26
使用Python通过win32 COM接口实现Excel单元格写入
2019-04-27
树莓派的硬件信息了解与思考
2019-04-27
树莓派上创建个人用户
2019-04-27
wiringpi安装编译问题解决
2019-04-27