RETIRED, Docker driver for OpenStack Nova
Go to file
zhangguoqing 034a4842fc add active_migrations attribute to DockerDriver
1. For passing the nova unit tests about the active_migrations attribute.
2. Fix test_get_dns_entries DNS IPs that changed from nova.
3. Add conf path to netconf that changed from nova.

Closes-Bug: #1584741
Closes-Bug: #1582615

Change-Id: Iaab7e695055f042b9060f07e31681c66197b8c79
2016-05-24 02:17:46 +00:00
contrib/devstack Convert old code in extras.d into devstack plugin 2016-01-28 17:47:04 -05:00
devstack Better debug install_docker.sh failures 2016-02-26 10:53:33 -08:00
doc/source tidy the documentation 2015-08-18 03:20:52 +00:00
etc/nova/rootwrap.d Import nova driver, rootwrap config, and tests from nova 2014-03-12 06:32:21 -04:00
novadocker add active_migrations attribute to DockerDriver 2016-05-24 02:17:46 +00:00
tools Port run_tests.sh from Nova 2014-10-31 07:22:20 -04:00
.coveragerc Change ignore-errors to ignore_errors 2015-09-21 15:01:30 +00:00
.gitignore Port run_tests.sh from Nova 2014-10-31 07:22:20 -04:00
.gitreview Update .gitreview for new namespace 2015-10-17 22:33:10 +00:00
.mailmap Initialize nova-docker repo 2014-03-12 06:28:28 -04:00
.testr.conf Initialize nova-docker repo 2014-03-12 06:28:28 -04:00
CONTRIBUTING.rst tidy the documentation 2015-08-18 03:20:52 +00:00
HACKING.rst Initialize nova-docker repo 2014-03-12 06:28:28 -04:00
LICENSE Initialize nova-docker repo 2014-03-12 06:28:28 -04:00
README.rst Remove redundant pipe in command line 2015-11-24 08:27:35 +08:00
babel.cfg Initialize nova-docker repo 2014-03-12 06:28:28 -04:00
requirements.txt Updated from global requirements 2016-04-15 14:07:56 +00:00
run_tests.sh Port run_tests.sh from Nova 2014-10-31 07:22:20 -04:00
setup.cfg remove python 2.6 trove classifier 2015-12-23 01:31:13 +00:00
setup.py Updated from global requirements 2015-09-17 12:18:16 +00:00
test-requirements.txt Updated from global requirements 2016-04-08 06:36:42 -04:00
tox.ini Add docs to tox 2016-02-22 23:41:52 +08:00

README.rst

nova-docker

Docker driver for OpenStack Nova.

Free software: Apache license

Installation & Configuration

1. Install the python modules.

For example:

$ python setup.py install

Note: There are better and cleaner ways of managing Python modules, such as using distribution packages or 'pip'. The setup.py file and Debian's stdeb, for instance, may be used to create Debian/Ubuntu packages.

2. Enable the driver in Nova's configuration

In nova.conf:

compute_driver=novadocker.virt.docker.DockerDriver

3. Optionally tune site-specific settings.

In nova.conf:

[docker]
# Commented out. Uncomment these if you'd like to customize:
## vif_driver=novadocker.virt.docker.vifs.DockerGenericVIFDriver
## snapshots_directory=/var/tmp/my-snapshot-tempdir

Uploading Images to Glance

1. Enable the driver in Glance's configuration

In glance-api.conf:

container_formats=ami,ari,aki,bare,ovf,ova,docker

2. Save docker images to Glance

Images may now be saved directly to Glance:

$ docker pull busybox
$ docker save busybox | openstack image create busybox --public --container-format docker --disk-format raw

Note: At present, only administrators should be allowed to manage images. With devstack you can make yourself administrator by sourcing openrc as:

source openrc admin

Once done you can go back to a user:

source openrc demo

The name of the image in Glance should be explicitly set to the same name as the image as it is known to Docker. In the example above, an image has been tagged in Docker as 'busybox'. Matching this is the '--name busybox' argument to glance image-create. If these names do not align, the image will not be bootable.

Note: There should be a long lived process running in the docker image, otherwise the instance will not be able to spawn successfully. This can be done by using CMD or ENTRYPOINT in DockerFile:

https://docs.docker.com/reference/builder/

or specifing the command through glance image property 'os_command_line' for test:

glance image-update --property os_command_line='/usr/sbin/sshd -D' $IMAGE_ID

3. Generate a keypair

You can optionally create a keypair to use in your docker images:

nova keypair-add mykey > mykey.pem

4. Start a container

Start a new container. This uses the key created above:

nova boot --flavor m1.small --image busybox --key-name mykey test1

5. ssh into container

You can check the IP address of the container by using:

nova list

And then ssh into it:

ssh -i ../devstack/mykey.pem cirros@<IP ADDRESS>

Notes

  • Earlier releases of this driver required the deployment of a private docker registry. This is no longer required. Images are now saved and loaded from Glance.
  • Images loaded from Glance may do bad things. Only allow administrators to add images. Users may create snapshots of their containers, generating images in Glance -- these images are managed and thus safe.

Contact Us

Join us in #nova-docker on Freenode IRC

Features

  • TODO