Ask Your Question
1

swift-glance backend

asked 2019-07-21 08:19:41 -0500

elia pimpinicchio gravatar image

updated 2019-07-24 03:54:45 -0500

HI,

I have several problems to change the glance backend to store the new image in a swift's container. I'm using openstack rocky and Ubuntu 18.10. There is someone that can help me? In particular, has anyone done this procedure and it works properly?

I find on the internet only guide for a different version of rocky or Ubuntu, but for me don't work. When i create a new image, i have the errno 111 (connection refused). There is the link i was following to change glance's backend: https://www.unixarena.com/2015/10/ope...

[glance_store]
default_store = swift
stores = file,http,swift
swift_store_auth_version = 2
swift_store_auth_address = http://controller:8080/v2.0/
swift_store_user = service:swift
swift_store_region = RegionOne
swift_store_key = studente
swift_store_container = glance
swift_store_create_container_on_put = True
swift_store_auth_insecure = True
swift_store_large_object_size = 2000
swift_store_large_object_chunk_size = 200
swift_enable_snet = False

Glance version: 2.9.1
Swift version: python-swiftclient 3.6.0

i do this command:

$ openstack image create "cirros" --file cirros-0.4.0-x86_64-disk.img.1 --disk-format qcow2 --container-format bare --public

I can create the image successfully, even if I don't know what folder it is in.

Output of " $openstack image list":

| ID                                   | Name            | Status |
| 1c82bd08-7633-4cfa-9cff-a2b765752e7f | cirros          | active

But if write "openstack volume list" no volume are created. Also this is what i see in glance-api.log file:

2019-07-24 06:30:02.313 5258 INFO eventlet.wsgi.server [req-0676375c-edf9-4222-928e-5bfe0553a4ef bc53d9337a9c42c5a8883a8f5d60bc30 0bf1e67c865b4dc9a909a300a5a0497c - default defaul$
2019-07-24 06:30:02.359 5258 INFO eventlet.wsgi.server [req-ff5f45ea-3476-4883-bdba-2354d06108a2 bc53d9337a9c42c5a8883a8f5d60bc30 0bf1e67c865b4dc9a909a300a5a0497c - default defaul$
2019-07-24 06:30:04.186 5258 INFO eventlet.wsgi.server [req-551a7063-2f43-4e04-8de2-28eadcbd6fc8 bc53d9337a9c42c5a8883a8f5d60bc30 0bf1e67c865b4dc9a909a300a5a0497c - default defaul$
2019-07-24 06:30:04.207 5258 INFO eventlet.wsgi.server [req-12298dd4-6f6a-4d4a-a1e1-7f9c0d61ee2f bc53d9337a9c42c5a8883a8f5d60bc30 0bf1e67c865b4dc9a909a300a5a0497c - default defaul$
2019-07-24 06:30:04.213 5258 INFO eventlet.wsgi.server [req-1074c542-4ba5-4ae1-ac15-19078a3f6e9c bc53d9337a9c42c5a8883a8f5d60bc30 0bf1e67c865b4dc9a909a300a5a0497c - default defaul$

$ openstack image show 1c82bd08-7633-4cfa-9cff-a2b765752e7f

| Field            | Value    
| checksum         | 443b7623e27ecf03dc9e01ee93f67afe                                                                                                                                                           
| container_format | bare                                                                                                                                                                                       
| created_at       | 2019-07-24T06:25:49Z                                                                                                                                                                       |
| disk_format      | qcow2                                                                                                                                                                                      |
| file             | /v2/images/1c82bd08-7633-4cfa-9cff-a2b765752e7f/file                                                                                                                                       |
| id               | 1c82bd08-7633-4cfa-9cff-a2b765752e7f                                                                                                                                                       |
| min_disk         | 0                                                                                                                                                                                          |
| min_ram          | 0                                                                                                                                                                                          |
| name             | cirros                                                                                                                                                                                     
| owner            | 0bf1e67c865b4dc9a909a300a5a0497c                                                                                                                                                           |
| properties       | os_hash_algo='sha512', os_hash_value='6513f21e44aa3da349f248188a44bc304a3653a04122d8fb4535423c8e1d14cd6a153f735bb0982e2161b5b5186106570c17a9e58b64dd39390617cd5a350f78', os_hidden='False' |

| protected        | False                                                                                                                                                                                      |
| schema           | /v2/schemas/image                                                                                                                                                                          |
| size             | 12716032                                                                                                                                                                                   |
| status           | active                                                                                                                                                                                     |
| tags             |                                                                                                                                                                                            |
| updated_at       | 2019-07-24T06:25:55Z                                                                                                                                                                       |
| virtual_size     | None 
| visibility       | public

this is the project that i have inside openstack:

$openstack project list
| ID                               | Name      |
| 0bf1e67c865b4dc9a909a300a5a0497c | admin     |
| 29cb13cd16624e658176d3b4d29cff76 | service   |
| c66697908bd24f48a94b2f5d9ffddd14 | myproject |
edit retag flag offensive close merge delete

Comments

Where exactly do you see "connection refused", and what is the refused address?

Can you share your swift store configuration?

The link is rather old. I have not checked it, but there are chances it is outdated or it doesn't fit your particular cloud configuration.

Bernd Bausch gravatar imageBernd Bausch ( 2019-07-21 08:51:02 -0500 )edit

I see this error when i try to create a new image with the command: "openstack image create "cirros1" --file cirros-0.4.0-x86_64-disk.img.1 --disk-format qcow2 --container-format bare --public". For swift store configuration do you mean the glance-api.conf otherwise the swift.conf?

elia pimpinicchio gravatar imageelia pimpinicchio ( 2019-07-22 00:39:28 -0500 )edit

now with a new configuration of glance-api.conf i resolved the error 111, but if i try to create the image, glance don't create the container, but add, if also path dir is commented out, inside controller. if i run the command "sudo glance-api --debug", it show ERROR: Could not bind to 0.0.0.0:9292

elia pimpinicchio gravatar imageelia pimpinicchio ( 2019-07-22 01:38:58 -0500 )edit

I meant the swift store configuration in glance-api.conf.

I don't understand what you mean by "add, if also path dir is commented out, inside controller".

Please show the error in context, i.e. which API shows this error. Also check for errors in the glance API log file.

Bernd Bausch gravatar imageBernd Bausch ( 2019-07-22 06:37:09 -0500 )edit

I partially solved the previous problem, but now from the log file it gives me this error: ClientException: Authorization Failure. Authorization Failed: Bad Request (HTTP 400)

elia pimpinicchio gravatar imageelia pimpinicchio ( 2019-07-22 07:01:38 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-07-22 22:20:30 -0500

updated 2019-07-22 22:57:14 -0500

swift_store_auth_address is the address of the authentication service used by Swift, which is Keystone in most cases. I agree that the documentation could be a bit clearer.

By the way, you should put your Swift configuration in a separate file and link to it from glance-api.conf. I have just deployed a Stein Devstack cloud and find the following in glance-api.conf:

[glance_store]
stores = file, http, swift
default_swift_reference = ref1
swift_store_config_file = /etc/glance/glance-swift-store.conf
swift_store_create_container_on_put = True
default_store = swift

default_swift_reference refers to the section in the glance-swift-store.conf file:

[ref1]
user_domain_id = default
project_domain_id = default
auth_version = 3
auth_address = http://192.168.1.201/identity/v3
key = PASSWORD
user = service:glance-swift

auth_address is the Keystone endpoint. user is the project (service) and the user (glance-swift) of the Swift account used by Glance. key is the password of that user.

edit flag offensive delete link more

Comments

should the glance-swift user be created? if yes, how? directly applying your advice I get the following error: BackendException: Cannot find swift service endpoint : The request you have made requires authentication. (HTTP 401)

elia pimpinicchio gravatar imageelia pimpinicchio ( 2019-07-23 01:28:56 -0500 )edit

The glance-swift-store file contains domain IDs, not domain names. Lower case "default" is probably correct, but you can double-check listing the domains.

If the glance-swift user doesn't exist, it has to be created (openstack user create) and needs a role in the service project.

Bernd Bausch gravatar imageBernd Bausch ( 2019-07-23 03:02:33 -0500 )edit

The absence of the glance-swift user explains why authentication fails.

Bernd Bausch gravatar imageBernd Bausch ( 2019-07-23 03:05:21 -0500 )edit

after create user glance-swift i solved all error, but the procedure don't create the container in swift. i use the command: "openstack image create "cirros1" --file cirros-0.4.0-x86_64-disk.img.1 --disk-format qcow2 --container-format bare --public" for create image. what can be the problem?

elia pimpinicchio gravatar imageelia pimpinicchio ( 2019-07-23 04:34:59 -0500 )edit

in fact if I look on the dashboard the image has been inserted in the volume section and how it has error status. Are there any other things I need to change? for example in proxy-swift.conf

elia pimpinicchio gravatar imageelia pimpinicchio ( 2019-07-23 04:39:48 -0500 )edit

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

Stats

Asked: 2019-07-21 08:19:41 -0500

Seen: 91 times

Last updated: Jul 24