【问题标题】:openstack image create throws BadRequestExceptionopenstack 图像创建抛出 BadRequestException
【发布时间】:2021-02-17 13:19:28
【问题描述】:

我已经安装了openstackussuri 版本,一切似乎都很好,但乍一看有一个奇怪的问题。当我使用glance image-create 命令时,一切都很好并且可以正常工作,但是,当我使用openstack image create 命令时,如下所述:

openstack image create --public --protected --disk-format raw --file ubuntu.raw ubuntu

它抛出这个执行:

BadRequestException:400:url 的客户端错误:http://controller:9292/v2/images,提供的对象与架构“图像”不匹配:“真”不是“布尔”类型:验证“类型”失败in schema['properties']['protected']:: {'description': '如果为真,图像将不可删除。',: 400 Bad Request: 'True': 'type': 'boolean'}: On实例['受保护']:

我将CEPH 用于Glance 后端,但Openstack 已将图像存储在/var/lib/glance/images 中! 这是我的glance-api 配置文件:

[DEFAULT]
[cinder]
[cors]
[database]
connection = mysql+pymysql://glance:password@controller/glance
[file]
[glance.store.http.store]
[glance.store.rbd.store]
[glance.store.s3.store]
[glance.store.swift.store]
[glance.store.vmware_datastore.store]
[glance_store]
stores = rbd
default_store = rbd
rbd_store_pool = images
rbd_store_user = glance
rbd_store_ceph_conf = /etc/ceph/ceph.conf
rbd_store_chunk_size = 8
[image_format]
disk_formats = ami,ari,aki,vhd,vhdx,vmdk,raw,qcow2,vdi,iso,ploop.root-tar
[keystone_authtoken]
password = password 
username = glance
project_name = service
user_domain_name = Default
project_domain_name = Default
auth_type = password
memcached_servers = controller:11211
auth_url = http://controller:5000
www_authenticate_uri = http://controller:5000
[oslo_concurrency]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_middleware]
[oslo_policy]
[paste_deploy]
flavor = keystone
[profiler]
[store_type_location_strategy]
[task]
[taskflow_executor]

【问题讨论】:

  • 移除 --protected 开关后,错误变为 'NoneType' object has no attribute 'get'
  • 我认为这只是一个错误。解决方法是省略--protected,正如您已经发现的那样,并使用openstack image set ... 保护图像。但是,我也不知道新的错误消息是从哪里来的,也不知道它是否意味着任何伤害。

标签: openstack qemu ceph openstack-glance


【解决方案1】:

实际上,当我在此处粘贴错误时,它变得人类可读并且我可以阅读它。正如你在这里看到的:

提供的对象与架构“图像”不匹配:“真”不是“布尔”类型:验证架构中的“类型”失败['properties']['受保护' ]

在我从命令中删除--protected 开关后,它抛出了这个异常:

'NoneType' 对象没有属性 'get'

但它就像一个魅力!我不知道发生了什么! 希望对你有帮助:)

【讨论】:

    猜你喜欢
    • 2019-11-09
    • 2013-03-05
    • 1970-01-01
    • 2021-09-05
    • 1970-01-01
    • 2018-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多