Unable to fetch images from glance

Bug #1452105 reported by Ben Ramsey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nova-docker
Incomplete
Undecided
keerthivasan selvaraj

Bug Description

When attempting to launch a Docker instance from an image that is stored in Glance but not on the compute host (i.e. docker images on the compute host does not contain a reference to the image) the launch fails with:

APIError: 404 Client Error: Not Found ("No such image: <image_name>")

It is my understanding that when the image can not be found by docker then Glance should be contacted in order to pull the image from, this is not happening.

nova-docker branch : stable/juno, commit: b724e65134ea7eb5d324045a3a6b3c0c75787e06
OpenStack version: juno

nova version: 2.19.0
glance version: 0.14.0

There are no errors within glance logs.

Revision history for this message
Ben Ramsey (benjamin-james-ramsey) wrote :

From further investigation I have found that nova-docker does send the request to Glance, and all of the HTTP requests respond with 200 OK.

However the image being pulled from glance is not being loaded into Docker as an image. I gather from this that nova-docker once all of the steps have been completed it performs a docker run <image name>, but as the image is not loaded into Docker itself it is unable to run the image.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

If you see this again, please attach nova compute logs.

Thanks,
Dims

Changed in nova-docker:
status: New → Incomplete
Revision history for this message
zhangguoqing (474751729-o) wrote :
Download full text (3.8 KiB)

nova boot --image 4e1e5210-80d6-4cd5-b2a1-1641b36a1249 --flavor 1 cirros-001 --availability-zone nova:compute

The log is below in compute node which has not any docker images.

2015-09-14 19:12:34.023 937 ERROR nova.compute.manager [-] [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] Instance failed to spawn
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] Traceback (most recent call last):
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py"
, line 2246, in _build_resources
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] yield resources
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py"
, line 2116, in _build_and_run_instance
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] block_device_info=block_device_info)
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/d
river.py", line 388, in spawn
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] image = self.docker.inspect_image(self._encode_utf8(image_nam
e))
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/c
lient.py", line 36, in wrapper
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] out = f(*args, **kwds)
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] File "/usr/lib/python2.7/site-packages/docker/utils/decorators.
py", line 20, in wrapped
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] return f(self, resource_id, *args, **kwargs)
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] File "/usr/lib/python2.7/site-packages/docker/client.py", line
491, in inspect_image
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] True
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] File "/usr/lib/python2.7/site-packages/docker/clientbase.py", l
ine 108, in _result
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] self._raise_for_status(response)
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] File "/usr/lib/python2.7/site-packages/docker/clientbase.py", l
ine 103, in _raise_for_status
2015-09-14 19:12:34.023 937 TRACE nova.compute.manager [instance: fbd089a0-ecbc-4393-a05d-a32048def89f] raise errors.NotFound(e, response, explanation=explanation)
2015-09-14...

Read more...

Revision history for this message
zhangguoqing (474751729-o) wrote :

If I load a same name image in compute node by docker, the instance will be launched successful.

Revision history for this message
keerthivasan selvaraj (keerthiv) wrote :

Hi all

While adding the images in glance using docker save, both the downloaded docker image name and the name added in glance should be same.

Example:

docker save training/webapp | glance image-create --is-public=True --container-format=docker --disk-format=raw --name training/webapp

I think this will solve this issue.

Thanks

Changed in nova-docker:
assignee: nobody → keerthivasan selvaraj (keerthiv)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.