在部署glance时禁用了v1 api,使用nova image-list出现了报错
nova image-list ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-70664768-3d60-434b-b812-e0251029a9df)
从nova-api日志上看到有下面一报错
2015-08-13 17:33:46.478 17 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/image/glance.py", line 274, in detail
打开
/usr/lib/python2.7/dist-packages/nova/image/glance.py
在这个文件的269行,
def detail(self, context, **kwargs): """Calls out to Glance for a list of detailed image information.""" params = _extract_query_params(kwargs) try: images = self._client.call(context, 1, ‘list‘, **params) except Exception: _reraise_translated_exception() _images = [] for image in images: if _is_image_available(context, image): _images.append(_translate_from_glance(image)) return _images
注意,这一行
images = self._client.call(context, 1, ‘list‘, **params)
说明,nova image-list使用的是glance api v1。如果,手动改为2,重启nova-api后,执行nova image-list,glance image-list
nova image-list +----+------+--------+--------+ | ID | Name | Status | Server | +----+------+--------+--------+ +----+------+--------+--------+ glance image-list +--------------------------------------+---------------------+ | ID | Name | +--------------------------------------+---------------------+ | d3f23850-4725-48c6-bc75-ad791afcb622 | cirros-0.3.4-x86_64 | +--------------------------------------+---------------------+
nova image-list 调用glance api时,应是使用的v1的参数。
时间: 2024-11-09 16:50:01