Zun

Fail to run a container with glance image with image uuid

Bug #1691673 reported by Eli Qiao
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zun
Fix Committed
High
cooldharma06

Bug Description

With docker driver and glance iamge driver

zun --debug run -n local_image3 --image-driver glance 2a094a7a-badb-472a-b28c-d52245be75fc "sleep 1000"

| status_reason | Docker internal error: 404 Client Error: Not Found ("No such image: 2a094a7a-badb-472a-b28c-d52245be75fc:latest"). |
| name | local_image3

Eli Qiao (taget-9)
Changed in zun:
assignee: nobody → Eli Qiao (taget-9)
hongbin (hongbin034)
Changed in zun:
status: New → Triaged
importance: Undecided → High
Revision history for this message
cooldharma06 (cooldharma06) wrote :

Hi team,

Following logs or points also need to be consider:

i tried to run the zun containers from glance image, zun is downloading the glance image but docker is not using that downloaded image to create containers.

Docker is trying to access the image from docker host repository.

Kindly refer the following logs and related outputs.

Revision history for this message
Eli Qiao (taget-9) wrote :

Interesting...

The process is this:

1. docker pull cirros to locally
2. upload cirros from local docker to openstack glance (with a name as cir or something else)
3. zun run -n c12 --iamge-driver glance cir

Error not found cir.

The reason is, when zun try to load glance image cir from glance, it works, but when using docker driver, we do a "docker image load `cir.tar`", so it will load cir.tar to docker images but it's name's the origin one "cirros", the images is loaded but we run it as a wrong name.

So there are some limitation while using glance as image-driver:

1. We can not use glance uuid
2. The glance image name should be same with the origin docker image name.

Or that will fail.

I can not find how to resolve this.

@hongbin thought?

Revision history for this message
cooldharma06 (cooldharma06) wrote :

Hi all,

i have some suggestion regarding this.

Following code changes have to be done in zun:

In this process images are getting downloaded into the /opt/stack/data/zun/images/xxxxxxxxxxxxx.tar file (devstack)

we have to load those images(xxxxx.tar) into the docker repository using following command:

docker load < xxxxxxxxxxxxxxxxxx.tar

but there is a problem the image will be loaded with default name. i.e., if i upload cirros image as cir_updated into glance. After downloading tar file from glance and doing - docker load < xxxxxxxxxxxxxxxx.tar. docker images will show only cirros:latest as the tag name. It wont show cir_updated:latest.

So for this i have two suggestions:
1. We have to edit the manifest.json file which is residing inside the xxxxxxx.tar

[{"Config":"f8ce316a37a79a89cb6f9ef65f23b38893fe291b519a8b18cf08af65872f02a9.json","RepoTags":["cirros:latest"],"Layers":["533e131ca4c4c44518e65b0e4e97fa4e8f694e8508f82763b8bcd3c376335f42/layer.tar","5cdf968d25c374ae189e9454d824bcf7df858f4fb108fa911dbc728f4a4c0802/layer.tar","64fd92eec6d14d474cc7d3321be52c8b7d922ab42c6848de9beb5117914868b0/layer.tar","78fbfd1ba6e559553c5d6d45d4e27a07a1ddcf54d91c14290c012111555d6f54/layer.tar","8d9719d7eab848cd65b3f2db04121dcc849779509c49dcb8dae909e3859d5800/layer.tar"]}]

We can find cirros:latest which we have to change as glance_image-name:latest.

Or

2. After loading the image, add new tag to that loaded image using tag command.
     docker tag docker_image_id glance_imagename:latest
     then remove the old cirros:latest image using docker rmi cirros. So that it will untag the cirros:latest.

Also if we pass image_id as the parameter means we have to get the corresponding image name from glance. and we have to pass image_name instead of image_id.

Please consider if its worth.

thanks & regards,
Dharmalingam S

Revision history for this message
cooldharma06 (cooldharma06) wrote :
Eli Qiao (taget-9)
Changed in zun:
status: Triaged → Fix Committed
assignee: Eli Qiao (taget-9) → nobody
assignee: nobody → cooldharma06 (cooldharma06)
Revision history for this message
cooldharma06 (cooldharma06) wrote :

thank you @eli qiao

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.