发起问题

ChristianWienke 的档案 - activity

2020-05-25 02:59:54 -0500 获得奖牌  著名问题 (source)
2020-04-29 05:52:08 -0500 评论问题 Error when deleting Image in glance with rbd backend

I fixed the issue by myself after debugging for a little while. Quick solution was to set the following values for the glance staging store.

[os_glance_staging_store]
filesystem_store_datadir = /tmp/glance

I assume that glance/api/v2/images.py needs a staging store and ceph didn't work.

2020-04-29 05:29:35 -0500 评论问题 Error when deleting Image in glance with rbd backend

Hi, that didn't work either. I guess the problem is that glance is not able to detect the capabilities of the store correctly. Does anyone know when the capability check happens and how it does happen?

2020-04-28 09:19:33 -0500 评论问题 Error when deleting Image in glance with rbd backend

Hi, the delete fails for all images. There is nothing written down in the policy.json in regards to restriction.

2020-04-27 07:26:35 -0500 评论问题 Error when deleting Image in glance with rbd backend

Hi, there is only one regular snapshot. Creating and deleting images works flawlessly

    toa5@openstack10:~$ rbd --id glance -k /etc/ceph/ceph.client.glance.keyring -p images remove --image test
Removing image: 100% complete...done.
2020-04-27 00:22:26 -0500 获得奖牌  热门的问题 (source)
2020-04-25 06:35:03 -0500 获得奖牌  受欢迎的问题 (source)
2020-04-24 05:35:43 -0500 评论问题 Error when deleting Image in glance with rbd backend

Hi, I posted the logs in a new answer as the comment section is limited in characters.

2020-04-24 05:35:43 -0500 回答问题 Error when deleting Image in glance with rbd backend

Debug logs:

stack@openstack10:~$ openstack image delete 5aafce2a-5a32-4764-9820-11cb2ee8aaef --debug

START with options: image delete 5aafce2a-5a32-4764-9820-11cb2ee8aaef --debug

options: Namespace(access_key='', access_secret='***', access_token='***', access_token_endpoint='', access_token_type='', application_credential_id='', application_credential_name='', application_credential_secret='***', auth_methods='', auth_type='password', auth_url='http://10.10.10.110/identity', cacert=None, cert='', client_id='', client_secret='***', cloud='', code='', consumer_key='', consumer_secret='***', debug=True, default_domain='default', default_domain_id='', default_domain_name='', deferred_help=False, discovery_endpoint='', domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, interface='public', key='', log_file=None, openid_scope='', os_baremetal_api_version='1.61', os_beta_command=False, os_compute_api_version='', os_dns_api_version='2', os_identity_api_version='3', os_image_api_version='', os_key_manager_api_version='1', os_network_api_version='', os_object_api_version='', os_placement_api_version='1.0', os_project_id=None, os_project_name=None, os_volume_api_version='3', passcode='', password='***', profile='', project_domain_id='default', project_domain_name='', project_id='', project_name='demo', protocol='', redirect_uri='', region_name='RegionOne', remote_project_domain_id='', remote_project_domain_name='', remote_project_id='', remote_project_name='', service_provider='', service_provider_endpoint='', service_provider_entity_id='', system_scope='', timing=False, token='***', trust_id='', user_domain_id='default', user_domain_name='', user_id='', username='admin', verbose_level=3, verify=None)

Auth plugin password selected

auth_config_hook(): {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'baremetal_status_code_retries': '5', 'baremetal_introspection_status_code_retries': '5', 'image_status_code_retries': '5', 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active', 'auth': {'user_domain_id': 'default', 'project_domain_id': 'default', 'project_name': 'demo'}, 'verbose_level': 3, 'deferred_help': False, 'debug': True, 'region_name': 'RegionOne', 'default_domain': 'default', 'timing': False, 'auth_url': 'http://10.10.10.110/identity', 'username': 'admin', 'password': '***', 'beta_command': False, 'identity_api_version': '3', 'volume_api_version': '3', 'baremetal_api_version': '1.61', 'dns_api_version': '2', 'key_manager_api_version': '1', 'placement_api_version': '1.0', 'auth_type': 'password', 'networks': []}

defaults: {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'auth_type': 'password', 'baremetal_status_code_retries': 5, 'baremetal_introspection_status_code_retries': 5, 'image_status_code_retries': 5, 'disable_vendor_agent': {}, 'interface': None, 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active'}

cloud cfg: {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'baremetal_status_code_retries': '5', 'baremetal_introspection_status_code_retries': '5', 'image_status_code_retries': '5', 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active', 'auth': {'user_domain_id': 'default', 'project_domain_id': 'default', 'project_name': 'demo'}, 'verbose_level': 3, 'deferred_help': False, 'debug': True, 'region_name': 'RegionOne', 'default_domain': 'default', 'timing': False, 'auth_url': 'http://10.10.10.110/identity', 'username': 'admin', 'password': '***', 'beta_command': False, 'identity_api_version': '3', 'volume_api_version': '3', 'baremetal_api_version': '1.61', 'dns_api_version': '2', 'key_manager_api_version': '1', 'placement_api_version': '1.0', 'auth_type': 'password', 'networks': []}

compute API version 2.1, cmd group openstack.compute.v2

identity API version 3, cmd group openstack.identity.v3

image API version 2, cmd group openstack.image.v2

network API version 2, cmd group openstack.network.v2

object_store API version 1, cmd group openstack.object_store.v1

volume API version 3, cmd group openstack.volume.v3

neutronclient API version 2, cmd group openstack.neutronclient.v2

baremetal API version 1.61, cmd group openstack.baremetal.v1

dns API version 2, cmd group openstack.dns.v2

key_manager API version 1, cmd group openstack.key_manager.v1

placement API version 1.0, cmd group openstack.placement.v1

command: image delete -> openstackclient.image.v2.image.DeleteImage (auth=True)

Auth plugin password selected

auth_config_hook(): {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'baremetal_status_code_retries': '5', 'baremetal_introspection_status_code_retries': '5', 'image_status_code_retries': '5', 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active', 'auth': {'user_domain_id': 'default', 'project_domain_id': 'default', 'project_name': 'demo'}, 'additional_user_agent': [('osc-lib', '2.0.0')], 'verbose_level': 3, 'deferred_help ...
(more)
2020-04-24 04:16:50 -0500 问了问题 Error when deleting Image in glance with rbd backend

Hi,

i'm trying to delete images from glance but this failes with an error, that the backend does not have the capabilities to delete images.

I'm using the same configuration for creating images within rbd backend and this works. Cinder does also has the capabilities to create and delete volumes on the backend.

This is the config I use for the rbd backend.

Ceph auth on ceph mon host:

# ceph auth list

client.glance
       key: AQDvyE9eU2+FFhAAaQRc4IAif/DJkqWnx6FmEQ==
       caps: [mon] allow r
       caps: [osd] allow class-read object_prefix rbd_children, allow rwx pool=images,allow rx pool=volumes

Now the ceph.conf on the glance host:

# cat  /etc/ceph/ceph.conf

[client]
    rbd cache = true
    rbd cache writethrough until flush = true
    admin socket = /var/run/ceph/guests/$cluster-$type.$id.$pid.$cctid.asok
    log file = /var/log/qemu/qemu-guest-$pid.log
    rbd concurrent management ops = 20

 [client.cinder]
        keyring = /etc/ceph/ceph.client.cinder.keyring

[client.glance]
        keyring = /etc/ceph/ceph.client.glance.keyring

[client.nova]
        keyring = /etc/ceph/ceph.client.nova.keyring

This is the glance-api.conf

[DEFAULT]
logging_exception_prefix = ERROR %(name)s ^[[01;35m%(instance)s^[[00m
logging_default_format_string = %(color)s%(levelname)s %(name)s [^[[00;36m-%(color)s] ^[[01;35m%(instance)s%(color)s%(message)s^[[00m
logging_context_format_string = %(color)s%(levelname)s %(name)s [^[[01;36m%(global_request_id)s %(request_id)s ^[[00;36m%(project_name)s %(user_name)s%(color)s] ^[[01;35m%(instance)s%(color)s%(message)s^[[00m
logging_debug_format_suffix = ^[[00;33m{{(pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d}}^[[00m
public_endpoint = http://10.10.10.110/image
registry_host = 10.10.10.110
enable_v1_api = False
transport_url = rabbit://stackrabbit:password@10.10.10.110:5672/
image_cache_dir = /opt/stack/data/glance/cache/
use_syslog = False
debug = True
show_image_direct_url = True
enabled_backends = fast:rbd

[database]
connection = mysql+pymysql://root:password@127.0.0.1/glance?charset=utf8

[oslo_concurrency]
lock_path = /opt/stack/data/glance/locks

[paste_deploy]
flavor = keystone

[keystone_authtoken]
memcached_servers = localhost:11211
cafile = /opt/stack/data/ca-bundle.pem
project_domain_name = Default
project_name = service
user_domain_name = Default
password = password
username = glance
auth_url = http://10.10.10.110/identity
auth_type = password

[oslo_messaging_notifications]
driver = messagingv2

[glance_store]
default_backend = fast

[fast]
store_description = "Fast rbd backend"
rbd_store_pool = images
rbd_store_user = glance
rbd_store_ceph_conf = /etc/ceph/ceph.conf
rbd_store_chunk_size = 8
rados_connect_timeout = 0

[cors]
allowed_origin = http://10.10.10.110

What I tried:

#stack@openstack10:~$ openstack image delete 5aafce2a-5a32-4764-9820-11cb2ee8aaef
Failed to delete image with name or ID '5aafce2a-5a32-4764-9820-11cb2ee8aaef': HTTP 500 Internal Server Error: The server has either erred or is incapable of performing the requested operation.
Failed to delete 1 of 1 images.

Glance logs:

Apr 24 07:47:19 openstack10 devstack@g-api.service[18885]: #033[01;31mERROR glance.common.wsgi [#033[01;36mNone req-124f431a-1189-4728-a079-fca4a34c93e1 #033[00;36mdemo admin#033[01;31m] #033[01;35m#033[01;31mCaught error: Deleting images from this store is not supported.#033[00m: glance_store.exceptions.StoreDeleteNotSupported: Deleting images from this store is not supported.
Apr 24 07:47:19 openstack10 devstack@g-api.service[18885]: ERROR glance.common.wsgi #033[01;35m#033[00mTraceback (most recent call last):
Apr 24 07:47:19 ...
(more)