possible docker image name collision when creating snapshots

Bug #1534119 reported by Bernhard Denner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nova-docker
New
Undecided
Unassigned

Bug Description

== Summary:

By creating different snapshots with the same name, it is possible to launch instances which are based on the wrong snapshot.
Since nova-docker creates docker images by the given snapshot name, it is possible to produce name collisions on that docker images. This is not dangerous in the first place, however the bug manifests if you try to use the two different snapshots on the same compute node.

Consider the following situation, for simplicity we consider only one nova-docker compute node:
1. Start two container instances, lets call them A and B
2. let them diverge, by installing package P1 in A and P2 in B
3. now we create a snapshot of A named 'snapshot', which gets id ID1
4. create a snapshot of B, also named 'snapshot', which gets id ID2
5. launch an instance from snapshot ID1 named C
6. nova-docker will check if docker already has an image named 'snapshot' locally available, since snapshot ID2 was also named 'snapshot', the snapshot image ID1 will NOT be fetched and loaded
7. instead, nova-docker will launch instance C with image based on instance B instead of A (as defined in 5)
8. instance C comes with pkg P2 installed instead of P1

I think the problem could be solved very easily by using the snapshot image ID for docker image names instead of the snapshot image name, since these IDs should be unique within on OpenStack cloud.

Ideally, all docker images should be named by their glance image IDs. This should also allow renaming of docker images regardless of their concrete docker image name. Maybe this could be implemented directly in glance?

Maybe this bug is related to https://blueprints.launchpad.net/nova-docker/+spec/nova-uuid-docker-image-name

== Setup:
OpenStack setup based on Kilo and Ubuntu 14.04 LTS, one Controller/Network node, 2 nova-docker compute nodes, one flat VLAN based neutron network setup.
docker-engine=1.8.3-0~trusty
nova-docker based on Kilo branch/release

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.