Ask Your Question
4

How to use cinder as glance default_store

asked 2013-11-20 06:33:31 -0500

kemra102 gravatar image

updated 2013-11-26 08:58:16 -0500

/etc/glance/glance-api.conf allows you to set cinder as a default_store:

default_store = cinder
known_stores = glance.store.filesystem.Store,
               glance.store.http.Store,
               glance.store.rbd.Store,
               glance.store.s3.Store,
               glance.store.swift.Store,
               glance.store.sheepdog.Store,
               glance.store.cinder.Store,

However when trying to upload an image with glance I now get the following error:

Request returned failure status.
500 Internal Server Error
Failed to upload image c25696d8-1379-4a71-80ff-ccb8666eee83
    (HTTP 500)

Changing the default_store back to files makes this work again.

/var/log/glance/api.log shows:

2013-11-20 12:18:05.235 11918 TRACE glance.api.v1.upload_utils Traceback (most recent call last):
2013-11-20 12:18:05.235 11918 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/glance/api/v1/upload_utils.py", line 101, in upload_data_to_store
2013-11-20 12:18:05.235 11918 TRACE glance.api.v1.upload_utils     store)
2013-11-20 12:18:05.235 11918 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/glance/store/__init__.py", line 333, in store_add_to_backend
2013-11-20 12:18:05.235 11918 TRACE glance.api.v1.upload_utils     (location, size, checksum, metadata) = store.add(image_id, data, size)
2013-11-20 12:18:05.235 11918 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/glance/store/base.py", line 142, in add
2013-11-20 12:18:05.235 11918 TRACE glance.api.v1.upload_utils     raise NotImplementedError
2013-11-20 12:18:05.235 11918 TRACE glance.api.v1.upload_utils NotImplementedError
2013-11-20 12:18:05.235 11918 TRACE glance.api.v1.upload_utils

Any idea what exactly is wrong? As far as I can see everything else in my config is correct and I'd like my Swift images to be backed by the same storage Cinder uses and using the cinder default_store seems ideal.

Cinder directives from /etc/glance/glance-api.conf:

# grep -i cinder /etc/glance/glance-api.conf 
default_store = cinder
               glance.store.cinder.Store,
# ============ Cinder Store Options ===============================
# Info to match when looking for cinder in the service catalog
cinder_catalog_info = volume:cinder:internalurl
# Override service catalog lookup with template for cinder endpoint
cinder_endpoint_template = http://192.168.2.16:8776/v1/%(tenant_id)s
# Location of ca certicates file to use for cinder client requests
#cinder_ca_certificates_file = <None>
# Number of cinderclient retries on failed http calls (integer value)
cinder_http_retries = 3
# Allow to perform insecure SSL requests to cinder (boolean value)
cinder_api_insecure = True
edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted
3

answered 2013-12-11 08:38:32 -0500

jtopjian gravatar image

I was playing around with this the other day and ran into the same error.

It looks like the Cinder backend does not support uploading (and downloading) at this time: http://docs.openstack.org/developer/glance/configuring.html#configuring-the-cinder-storage-backend

The NotImplementedError error in the api.log confirms this as if you look in the actual cinder backend file, there is no function of "add" defined.

Hope that helps, Joe

edit flag offensive delete link more
1

answered 2013-11-21 11:30:44 -0500

pjimenez gravatar image

I am trying to reproduce the situation ...

  • I have set this on /etc/glance/glance-api.conf
default_store = cinder
# ============ Cinder Store Options ===============================
cinder_catalog_info = volume:cinder:internalurl
cinder_endpoint_template = http://controller:8776/v1/%(tenant_id)s
os_region_name = regionOne
cinder_http_retries = 3
cinder_api_insecure = True
  • I had to install sheepdog to avoid "collie" errors.
2013-10-29 16:33:19.584 3282 WARNING glance.store.base [-] Failed to configure store correctly: Store sheepdog could not be configured correctly. Reason: Error in store configuration: Unexpected error while running command.
Command: collie
Exit code: 127
Stdout: ''
Stderr: '/bin/sh: collie: no se encontr\xc3\xb3 la orden\n' Disabling add method.
  • When i try to do a service restart i always get this error in log but the service starts
2013-11-21 18:05:41.232 4726 WARNING glance.store.base [-] Failed to configure store correctly: Store cinder could not be configured correctly. Reason: Cinder storage requires a context. Disabling add method.

2013-11-21 18:05:41.234 4726 WARNING glance.store.base [edd211d9-b4a9-4d6b-ae76-8e2eaaa34f03 None None] Failed to configure store correctly: Store cinder could not be configured correctly. Reason: Cinder storage requires a service catalog. Disabling add method.
  • Finally, when tryng to upload an image i get the 500 Error
[root@controller ~]# glance image-create --name="Cirros 0.31 x64" --disk-format=qcow2 --container-format=bare --is-public=yes < cirros-0.3.1-x86_64-disk.img
Request returned failure status.
500 Internal Server Error
Failed to upload image d1cfd289-8261-4357-a7f3-c59906db8828
    (HTTP 500)
  • Are you getting this kind of error in glance-api.log ?
edit flag offensive delete link more

Comments

That's exactly what I'm getting.

kemra102 gravatar imagekemra102 ( 2013-11-22 04:58:46 -0500 )edit

Could you post the rest of Cinder Related flags in /etc/glance/glance-api.conf ??

pjimenez gravatar imagepjimenez ( 2013-11-22 05:15:04 -0500 )edit
0

answered 2014-04-30 06:26:47 -0500

updated 2014-10-06 09:44:44 -0500

Hello, I got the same problème to create an image from using cinder storgae backend for glance. Did you have a solution for your problem? glance-api configuration is :

# Info to match when looking for cinder in the service catalog
# Format is : separated values of the form:
# <service_type>:<service_name>:<endpoint_type> (string value)
cinder_catalog_info = volume:cinder:internalurl

# Override service catalog lookup with template for cinder endpoint
# e.g. http://localhost:8776/v1/%(project_id)s (string value)
cinder_endpoint_template = http://bt1shlf7:8776/v1/%(tenant_id)s
# Region name of this node (string value)
os_region_name = RegionBie

# Location of ca certicates file to use for cinder client requests
# (string value)
#cinder_ca_certificates_file = <None>

# Number of cinderclient retries on failed http calls (integer value)
cinder_http_retries = 3

# Allow to perform insecure SSL requests to cinder (boolean value)
cinder_api_insecure = True
edit flag offensive delete link more
0

answered 2015-01-16 03:50:35 -0500

Up to now Cinder store is a partial implementation, That is to say you cannot config cinder as glance store backend.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

6 followers

Stats

Asked: 2013-11-20 06:33:31 -0500

Seen: 7,759 times

Last updated: Oct 06 '14