Nova-Docker on OpenStack RDO Juno

  • 12/7/14 2:18 PM
  • Arash Kaffamanesh

This short blog post is about how to get Nova-Docker working on an OpenStack RDO Juno deployment on CentOS 7.
If you don't have RDO Juno installed, you can install it with a single command:

bash <(curl -Ls cloudssky.com/openstack-aio-install)

After the installation is finished, insert the following lines in a file, e.g. nova.docker and source it:

 yum install docker-io -y
yum install -y python-pip git
pip install -e git+https://github.com/stackforge/nova-docker#egg=novadocker
#git clone https://github.com/stackforge/nova-docker.git
#cd nova-docker/
cd src/novadocker/
git checkout -b pre-i18n 9045ca43b645e72751099491bf5f4f9e4bddbb91
python setup.py install
systemctl start docker
systemctl enable docker
chmod 666 /var/run/docker.sock
mkdir /etc/nova/rootwrap.d

Now you need to change the compute driver in nova.conf:

 vi /etc/nova/nova.conf 
set "compute_driver = novadocker.virt.docker.DockerDriver"

As next, create the docker.filters file:

vi /etc/nova/rootwrap.d/docker.filters

and insert the following lines into it:

# nova-rootwrap command filters for setting up network in the docker driver
# This file should be owned by (and only-writeable by) the root user
[Filters]
# nova/virt/docker/driver.py: 'ln', '-sf', '/var/run/netns/.*'
ln: CommandFilter, /bin/ln, root

and extend "docker" as container format in the glance-api.conf file:

 vi /etc/glance/glance-api.conf
 set container_formats=ami,ari,aki,bare,ovf,ova,docker

restart nova-compute:

 systemctl restart openstack-nova-compute
 systemctl status openstack-nova-compute
 systemctl restart openstack-glance-api

Now we'll pull the latest busybox from docker hub and add it to glance:

 docker pull busybox:latest
 cd
 source keystonerc_admin 
 docker save busybox | glance image-create --is-public=True --container-format=docker --disk-format=raw --name busybox
 glance image-list
 source keystonerc_demo 
nova boot --image busybox --flavor m1.tiny --key-name osxkey busybox
 docker ps -a
 docker attach <CONTAINER ID from command above>

enjoy :-)

Update 2015/01/25 from Lars Kellog-Stedman blog post about how to run nova-libvirt and nova-docker on the same host:
 
 

Join us at OpenStack-X Cologne Meetup

Twitter News