Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Configuring OpenStack Nova Docker with Contrail

    Overview: Nova Docker Support in Contrail​

    Introduced: Contrail Release 2.20

    OpenStack Nova Docker containers can be used instead of virtual machines for specific use cases. DockerDriver is a driver for launching Docker containers.

    Starting with Contrail Release 2.20, it is possible to configure a compute node in a Contrail cluster to support Docker containers.

    This section describes how to set up a compute node in a Contrail cluster to support Docker containers.

    For more details about OpenStack Nova Docker, refer to the OpenStack wiki at:https://wiki.openstack.org/wiki/Docker.

    Platform Support: Contrail and OpenStack Nova Docker

    The following table provides the platforms and versions supported for Contrail and OpenStack Nova Docker.

    Platform

    Version

    OpenStack SKU

    Contrail Release

    Ubuntu

    Precise

    Icehouse

    2.20 and greater

    Ubuntu

    Trusty

    Icehouse

    2.20 and greater

    Ubuntu

    Trusty

    Juno

    2.20 and greater

    Deploying a Contrail Compute Node to Work With OpenStack Nova Docker

    To deploy a compute node to work with Nova Docker in a Contrail cluster, the Nova DockerDriver is defined in place of the LibvirtDriver in the env.hypervisor dictionary in the testbed.py.

    Example:

    The following example uses a testbed.py with the following compute nodes listed in the env.roledefs dictionary.

    env.roledefs = {
    
     ‘compute’ : [host5, host6, host7],
    
    }

    Changes are made to the env.hypervisor, to deploy Nova DockerDriver in host7 and deploy the host5 and host6 with the default LibvirtDriver.

    Once the settings are changed in the testbed.py as in the following, use the steps in Installing the Contrail Packages, Part Two (CentOS or Ubuntu) — Installing on the Remaining Machines, to have the compute host7 deployed with the Nova DockerDriver.

    env.hypervisor = {
    
     host7 : ‘docker’,
    
    }

    Saving the Docker Image to Glance

    The Docker image must be pulled from the compute node that is deployed with DockerDriver (host7) and added to the Glance configuration, as in the following.

    host7$ source /etc/contrail/openstackrc

    host7$ docker pull cirros

    host7$ docker save cirros | glance image-create --is-public=True --container-format=docker --disk-format=raw --name cirros

    Note: Always use the same name for the Docker image and its configuration in Glance. Otherwise, the Docker image cannot be launched.

    Launching a Docker Container

    Contrail creates a separate Nova availability zone (nova/docker) for compute nodes deployed with DockerDriver.

    To launch a Docker container, use a Nova command that includes the –availability-zone option, as in the following.

    host7$ source /etc/contrail/openstackrc 
    
     host7$ nova boot --flavor 1 --nic net-id=<netId> --image <imageId> --availability-zone nova/docker <dockerContainerName> 

    Limitations

    The following are limitations with the deployment of Nova Docker and Contrail.

    • The Docker containers cannot be seen in the virtual network controller console because console access is not supported with Nova Docker, see https://bugs.launchpad.net/nova-docker/+bug/1321818.
    • Docker images must be saved in Glance using the same name as used in the docker images command. If the same name is not used, you will not be able to launch the Docker container.

    Modified: 2015-09-02