Ask Your Question
3

Errors using Docker with Openstack

asked 2013-11-04 18:52:14 -0500

Chris White gravatar image

updated 2013-11-04 20:11:16 -0500

I'm trying to follow the instructions for using Docker as a hypervisor in OpenStack. For the time being i have a Ubuntu 12:04 vm running and have installed Docker (+verified it works).

Now i've checked out the latest devstack from https://github.com/openstack-dev/devstack (613fd5591c8, Nov 1st), completed the instructions from tools/docker/README.md and run the tools/docker/install_docker.sh script.

Next step is to run stack.sh, but here i get an error relating to the following script command in lib/nova_plugins/hypervisor-docker

sudo cp -p ${DOCKER_DIR}/nova-driver/docker.filters $NOVA_CONF_DIR/rootwrap.d

The error mesage relates to the fact that the file being copied cannot be found. It appears that prior to this step, the docker.filters file is already copied so i uncomment this line from the script and perform a clean re-install (it's a VM so i restore the snapshot prior to running stack.sh, fix up this script file and run stack.sh again. Now i get an error much later in the install script:

+ docker run -d -p 5042:5000 -e SETTINGS_FLAVOR=openstack -e OS_USERNAME=admin -e OS_PASSWORD=66360be5db2fe5d579c1 -e OS_TENANT_NAME=admin -e OS_GLANCE_URL=http://192.168.1.124:9292 -e OS_AUTH_URL=http://192.168.1.124:35357/v2.0 docker-registry ./docker-registry/run.sh
2013/11/04 19:01:29 dial unix /var/run/docker.sock: permission denied
+ echo 'Waiting for docker registry to start...'
Waiting for docker registry to start...
+ DOCKER_REGISTRY=192.168.1.124:5042
+ timeout 60 sh -c 'while ! curl -s 192.168.1.124:5042; do sleep 1; done'
+ die 107 'docker-registry did not start'
+ local exitcode=0
+ set +o xtrace
[Call Trace]
./stack.sh:1115:start_nova
/home/openstack/devstack/lib/nova:637:start_nova_hypervisor
/home/openstack/devstack/lib/nova_plugins/hypervisor-docker:107:die
[ERROR] /home/openstack/devstack/lib/nova_plugins/hypervisor-docker:107 docker-registry did not start

This i'm assuming is because docker is running using a unix socket, and the script isn't run as the root user.

So my question, has anyone had any success getting Docker to run as the openstack (devstack) hypervisor, if so can you check your git log to see what the commit hash was when it was working and i can try and checkout this specific commit point and try again.

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
2

answered 2013-11-23 06:05:10 -0500

mig.hg gravatar image

The issue with docker registry not starting is due to socket ownership reverting to root. The install_docker.sh script changes the docker socket to be writable by your primary group, but I noticed this reverts back to root whenever docker daemon is restarted.

A quick workaround is to run: sudo chgrp $(groups |cut -d' ' -f1) /var/run/docker.sock before running stack.sh.

edit flag offensive delete link more
1

answered 2013-11-11 23:21:32 -0500

DennyZhang gravatar image

I haven't tried Docker before. But for further investigation, I would suggest you to manually run related commands in hypervisor-docker, which would be like: docker run -d -p ...

Then see what it complains.

edit flag offensive delete link more

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

1 follower

Stats

Asked: 2013-11-04 18:52:14 -0500

Seen: 743 times

Last updated: Nov 23 '13