Ask Your Question
1

How to configure glance to store images created by "glance image-create" in a remote machine which have nfs server? [closed]

asked 2015-12-22 06:48:31 -0500

fnawaz gravatar image

updated 2015-12-22 08:17:09 -0500

I have configured openstack controller in 192.168.1.10

I have NFS server configured in 192.168.1.20 and in the same machine /images I want to store all the images which will be created by "glance image-create" command .. I have put cirros-0.3.3-x86_64-disk.img file in /images folder in 192.168.1.20 and /images folder is mountable...

Currently the default path of the "glance image-create" is /var/lib/glance/images (which is openstack's default) in 192.168.1.10 where I have configured the controller

The NFS server at 192.168.1.20 will be dedicated for images..

In controller that is 192.168.1.10 I have mounted 192.168.1.20's/images folder in /images.

So to configure as above I changed the glance-api.conf file as " .... [glance_store] ..... filesystem_store_datadir = /images ..... " So now cirros-0.3.3-x86_64-disk.img is available in /images in 192.168.1.10 Now when I am doing glance image-create --name "cirros-0.3.3-x86_64_nfs" --file /images/cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress at the terminal of controller

It is giving error

<html> <head> <title>410 Gone</title> </head> <body>

410 Gone

Error in store configuration. Adding images to store is disabled.

</body> </html> (HTTP N/A)

So how to configure the glance for my above situation ??

Here is my glance-api.conf

[DEFAULT] notification_driver = noop verbose = True

[database] connection = mysql://glance:myglance@controller/glance

[keystone_authtoken] auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = glance admin_password = glance96

[paste_deploy] flavor = keystone

[store_type_location_strategy]

[profiler] [task] [glance_store] default_store = file filesystem_store_datadir = /images/

Is that configuration Okay??

Here is the log file /var/log/glance/api.log

2015-12-22 08:35:18.644 27277 ERROR glance.api.v1.upload_utils [aad9aa3e-273e-406d-b708-610194d445fb 721760a70dd64d00b3c4bb341d004a15 408336c84c1347eea93b826eca46c82f - - -] Error in store configuration. Adding images to store is disabled. 2015-12-22 08:35:18.644 27277 TRACE glance.api.v1.upload_utils Traceback (most recent call last): 2015-12-22 08:35:18.644 27277 TRACE glance.api.v1.upload_utils File "/usr/lib/python2.7/site-packages/glance/api/v1/upload_utils.py", line 113, in upload_data_to_store 2015-12-22 08:35:18.644 27277 TRACE glance.api.v1.upload_utils context=req.context) 2015-12-22 08:35:18.644 27277 TRACE glance.api.v1.upload_utils File "/usr/lib/python2.7/site-packages/glance_store/backend.py", line 331, in store_add_to_backend 2015-12-22 08:35:18.644 27277 TRACE glance.api.v1.upload_utils context=context) 2015-12-22 08:35:18.644 27277 TRACE glance.api.v1.upload_utils File "/usr/lib/python2.7/site-packages/glance_store/driver.py", line 128, in add_disabled 2015-12-22 08:35:18.644 27277 TRACE glance.api.v1.upload_utils raise exceptions.StoreAddDisabled 2015-12-22 08:35:18.644 27277 TRACE glance.api.v1.upload_utils StoreAddDisabled: None 2015-12-22 08:35:18.644 27277 TRACE glance.api.v1.upload_utils 2015-12-22 08:35:18.869 27277 INFO glance.wsgi.server [aad9aa3e-273e-406d-b708-610194d445fb 721760a70dd64d00b3c4bb341d004a15 408336c84c1347eea93b826eca46c82f - - -] 135.249.35.68 - - [22/Dec/2015 08:35:18] "POST /v1/images HTTP/1.1" 410 386 0.929409

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Bipin
close date 2015-12-23 22:28:22.422520

Comments

is the glance service running ? can't you see anything in the glance logs ?

mariusleu gravatar imagemariusleu ( 2015-12-22 06:59:14 -0500 )edit

yes it is running ... I restarted glance api and regitry services both.. after modifying the glance-api.conf file

fnawaz gravatar imagefnawaz ( 2015-12-22 07:01:24 -0500 )edit

The log from /var/log/glance/api.log .. but donno what is the solution for the above :-(

fnawaz gravatar imagefnawaz ( 2015-12-22 07:07:59 -0500 )edit

Did you try to write something to /images as a normal user ? Maybe glance doesn't have permissions to /images.

mariusleu gravatar imagemariusleu ( 2015-12-22 07:38:43 -0500 )edit

This is the URL which I tried https://ask.openstack.org/en/question/81632/glance-error-in-store-configuration-adding-images-to-store-is-disabled/ (https://ask.openstack.org/en/question...). I created a user in 192.168.1.20 glance and changed the owner ship of /images folder from root to glance . still same error while image create command

fnawaz gravatar imagefnawaz ( 2015-12-22 07:39:02 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-12-22 09:40:38 -0500

zekken gravatar image

updated 2015-12-22 09:41:24 -0500

You don't even have to configure NFS to store images in a remote machine. Lets say your controller node is 192.168.1.10, and the node where the image is stored in 192.168.1.20 in the directory /var/lib/libvirt/images (lets suppose). Change to this directory in 192.168.1.20. Now run python -m SimpleHTTPServer. Now, in the controller node, (where glance-api is running), run the glance image command for your cirros image similar to this: glance image-create --name "cirros-0.3.3-x86_64_nfs" --location http://192.168.1.20:8000/cirros-0.3.3... --disk-format qcow2 --container-format bare --is-public True -- Make sure you allow port 8000 for incoming traffic in the 192.168.1.20 node as python server runs on port 8000 by default.

edit flag offensive delete link more

Comments

Worked like a charm .. but where the created image is getting stored .. I checked /var/lib/glance/images in controller.. the created image was not there.. do you have any idea where it might be?? although from the dashboard the generated image is accessible .. :-)

fnawaz gravatar imagefnawaz ( 2015-12-22 23:48:36 -0500 )edit

That is what even I don't know as of now. I found that there is a "--location" command that can be specified with glance image-create command, so I tried to do that by using a python server. Since the image is accessible, I did not research more about it. If you find anything, please let me know.

zekken gravatar imagezekken ( 2015-12-23 04:00:06 -0500 )edit

Hey I found where the created images are being stored .. the path which you give in filesystem_store_datadir in glance-api.conf the created images will be stored in that folder only.. I knew before but it was not storing in /images becauses it was unmounted .. I mounted /images and now all fine

fnawaz gravatar imagefnawaz ( 2015-12-24 00:37:38 -0500 )edit

now I am able to store created images in remote machine also .. we need to give the mounted directory path to filesystem_store_data_datadir .. in controller

mount 192.168.1.20:/tmp/images /images

then in glance api-conf filesystem_store_datadir=/images thats it..

fnawaz gravatar imagefnawaz ( 2015-12-24 00:41:22 -0500 )edit

Great! I am not very concerned about the images other the using it for the VMs, so I am not very concerned where it is stored, as long as its usable. Thank you anyways.

zekken gravatar imagezekken ( 2015-12-25 09:55:04 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-12-22 06:48:31 -0500

Seen: 1,155 times

Last updated: Dec 22 '15