我有一个与已弃用的参数(stores 和 default_store)相关的问题。由于以下信息,它们将从 Stein 中删除:https://docs.openstack.org/glance/stein/configuration/glance_api.html 我们遇到了 cinder 和 Glance 之间协作中断的问题。在我们的日志(glance-api)中,我们观察到这样的警告消息:
2021-02-22 15:30:02.894 756 WARNING oslo_config.cfg [-] Deprecated: Option "stores" from group "glance_store" is deprecated for removal (
This option is deprecated against new config option
``enabled_backends`` which helps to configure multiple backend stores
of different schemes.
This option is scheduled for removal in the Stein development
cycle.
). Its value may be silently ignored in the future.
2021-02-22 15:30:02.896 756 WARNING oslo_config.cfg [-] Deprecated: Option "default_store" from group "glance_store" is deprecated for removal (
This option is deprecated against new config option
``default_backend`` which acts similar to ``default_store`` config
option.
This option is scheduled for removal in the Stein development
cycle.
). Its value may be silently ignored in the future.
我们只是想解决这个问题,通过将选项glance_store 更改为enabled_backends,将default_store 更改为default_backend:
@@ -2079,7 +2079,7 @@ pool_timeout = 60
# cycle.
#stores = file,http
-stores = glance.store.rbd.Store
+enabled_backends = glance.store.rbd.Store
# DEPRECATED:
# The default scheme to use for storing images.
@@ -2134,7 +2134,7 @@ stores = glance.store.rbd.Store
# cycle.
#default_store = file
-default_store = rbd
+default_backend = rbd
但后来我们意识到我们无法从新图像创建卷,因为我们遇到了一个问题:
2021-02-22 22:45:08.805 5910 ERROR cinder.scheduler.filter_scheduler [req-fe8e8aa2-dd8a-470b-9d70-dbdc757b48d9 54df39e1b74149bcb8cf9ad3eb957d48 afdfb965515f4724a21b6823764ec36d - default default] Error scheduling 9de37fe8-4f9e-4c29-8cfa-c1a71e8c68b7 from last vol-service: cinder-05@huawei_backend#StoragePool001 : [u'Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/executor.py", line 53, in _execute_task\n result = task.execute(**arguments)\n', u' File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/manager/create_volume.py", line 1059, in execute\n **volume_spec)\n', u' File "/usr/lib/python2.7/dist-packages/cinder/utils.py", line 818, in _wrapper\n return r.call(f, *args, **kwargs)\n', u' File "/usr/lib/python2.7/dist-packages/retrying.py", line 206, in call\n return attempt.get(self._wrap_exception)\n', u' File "/usr/lib/python2.7/dist-packages/retrying.py", line 247, in get\n six.reraise(self.value[0], self.value[1], self.value[2])\n', u' File "/usr/lib/python2.7/dist-packages/retrying.py", line 200, in call\n attempt = Attempt(fn(*args, **kwargs), attempt_number, False)\n', u' File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/manager/create_volume.py", line 959, in _create_from_image\n image_service)\n', u' File "<decorator-gen-238>", line 2, in _prepare_image_cache_entry\n', u' File "/usr/lib/python2.7/dist-packages/cinder/coordination.py", line 151, in _synchronized\n return f(*a, **k)\n', u' File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/manager/create_volume.py", line 757, in _prepare_image_cache_entry\n update_cache=True)\n', u' File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/manager/create_volume.py", line 831, in _create_from_image_cache_or_download\n backend_name) as tmp_image:\n', u' File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__\n return self.gen.next()\n', u' File "/usr/lib/python2.7/dist-packages/cinder/image/image_utils.py", line 832, in fetch\n fetch_verify_image(context, image_service, image_id, tmp)\n', u' File "/usr/lib/python2.7/dist-packages/cinder/image/image_utils.py", line 451, in fetch_verify_image\n None, None)\n', u' File "/usr/lib/python2.7/dist-packages/cinder/image/image_utils.py", line 377, in fetch\n tpool.Proxy(image_file))\n', u' File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 358, in download\n _reraise_translated_image_exception(image_id)\n', u' File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 602, in _reraise_translated_image_exception\n six.reraise(type(new_exc), new_exc, exc_trace)\n', u' File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 356, in download\n image_chunks = self._client.call(context, \'data\', image_id)\n', u' File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 225, in call\n return getattr(controller, method)(*args, **kwargs)\n', u' File "/usr/lib/python2.7/dist-packages/glanceclient/common/utils.py", line 545, in inner\n return RequestIdProxy(wrapped(*args, **kwargs))\n', u' File "/usr/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 208, in data\n resp, body = self.http_client.get(url)\n', u' File "/usr/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 328, in get\n return self.request(url, \'GET\', **kwargs)\n', u' File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 349, in request\n return self._handle_response(resp)\n', u' File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 98, in _handle_response\n raise exc.from_response(resp, resp.content)\n', u'HTTPInternalServerError: HTTPInternalServerError (HTTP 500)\n']
这在 cinder-scheduler 日志文件中可见。当我们恢复更改时,一切都开始正常运行。我只是想知道如何跳过此警告消息并使 cinder 和 Glance 正确协作,尤其是我们计划很快从 Rocky 升级到 Stein,并且计划在 Stein 版本中删除此选项。在此先感谢您的帮助。
答案1
定义启用的后端的语法略有不同 - 它必须是一组key:value
对,其中值可以是:file、http、rbd、swift、cinder 或 vmware。对于每个键,您还需要声明一个新的选项组。
来源。
源代码提供了一个使用 rbd 的示例,我想这个示例更适合您。我根据示例设置了 Glance,一切似乎都正常。
[DEFAULT]
enabled_backends = file_back:file, http_back:http
# ...
[glance_store]
default_backend = file_back
# ...
[file_back]
filesystem_store_datadir = /var/lib/glance/images/
store_description = "File storage backend"
[http_back]
store_description = "HTTP storage backend"