This repository contains files and instructions to get the OpenStack Docker driver working on Grizzly.
Notes:
- This is not official OpenStack code. This is simply something I was tinkering with was able to successfully get working in my environment.
- I'm using
nova-network
andVlanManager
so the networking changes are specific toward that type of configuration.
driver.py
needs to replace thenova/virt/docker/driver.py
file. A patch is included to more clearly see the changes that were made.images.py
needs to replace theglance/api/v1/images.py
file. A patch is also included.
The above-linked wiki entry does a great job at explaining how this driver works. In addition, I found the following resources helpful:
- Installing Docker
- hypervisor-docker: especially the part where it shows how to launch the Docker registry and have it communicate with Glance.
- install_docker.sh: supplemental installation info.
- docker.sh: Launching a docker container in OpenStack.
By creating a Host Aggregate, you can designate a group of compute nodes to host Docker containers while having the rest of your compute nodes use your original hypervisor. OpenStack Docs, as usual, does an excellent job at explaining Host Aggregates and how to use them. For Docker:
Configure nova-scheduler
:
$ grep scheduler_default_filters /etc/nova/nova.conf
scheduler_default_filters=AggregateInstanceExtraSpecsFilter,AvailabilityZoneFilter,RamFilter,ComputeFilter
Create a Host Aggregate:
$ nova aggregate-create docker nova
$ nova aggregate-set-metadata 1 docker=true
$ nova aggregate-add-host 1 node1.example.com
Now create a flavor and tie it to the aggregate:
$ nova flavor-create d1.tiny 500 1024 5 1
$ nova-manage instance_type set_key --name=d1.tiny --key=docker --value=true
Launching instances of type d1.tiny
will cause OpenStack to launch the instance on node1.example.com
only.