Docker in OpenStack 
Joint Athens OpenStack User Group 
and Docker Athens Meetup, 
24th September 2014 
Thanassis Parathyras 
aparathyras@stackmasters.eu, @parathyras
Announcements 
openstack-el@lists.openstack.org 
• Join at http://lists.openstack.org 
OpenStack Summit (http://openstackceeday.com) 
• 3-7 November, Paris 
• Contact me for a discount code
OpenStack’s mission 
“to produce the 
ubiquitous Open Source Cloud Computing platform 
that will meet the needs of public and private clouds 
regardless of size, by being simple to implement and 
massively scalable”
Docker, what is it? 
“an open platform 
for developers and sysadmins 
to build, ship, and run 
distributed applications”
VMs and Containers 
Smaller resource footprint, same level isolation
Docker support in OpenStack 
OpenStack Compute (nova) 
• Docker driver (since Havana) 
• Driver not in main source code tree 
– Faster dev cycles, future plan for merging 
• Implements OpenStack API 
OpenStack Orchestration (heat) 
• Docker plugin 
• Deploy and manage containers 
• Native Docker API
Under the hood
Case 1: Docker with Heat 
Assume an OpenStack with Heat operational environment 
1. Install the Docker plugin in Heat 
cd contrib/heat-docker 
sudo python ./setup.py install 
Check Heat property plugin_dirs includes /usr/lib/heat 
2. Restart Heat 
Only the process "heat-engine" needs to be restarted to load the 
new installed plugin 
Use this plugin enable Docker containers as resources in 
Heat templates
Case 2: Docker with Nova 
Assume an OpenStack operational environment 
1. Install Docker on your compute hosts 
2. Fix permissions 
usermod -G docker nova 
service openstack-nova-compute restart 
3. Install driver 
pip install -e 
git+https://github.com/stackforge/nova-docker# 
egg=novadocker
Case 2: Enabling Docker 
1. Configure nova 
[DEFAULT] 
compute_driver = 
novadocker.virt.docker.DockerDriver 
2. Create file /etc/nova/rootwrap.d/docker.filters 
# 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
Case 2: Using Docker 
• Configure glance 
[DEFAULT] 
container_formats = ami,ari,aki,bare,ovf,docker 
Follow the same workflow as other virt drivers: 
• Create/Add/Use Docker images with Glance 
• Create/Manage instances with Nova
Considerations and open issues 
• Containers don't aim to be a replacement for VMs 
– they are better for specific use cases 
– VMs and containers may co-exist in a cloud environment 
• Docker driver for nova 
– Lack of integration with Cinder and Neutron 
– Imports constraints with OpenStack API 
• Orchestrating containers 
– A different approach than treating them as another hypervisor type 
– Better fitted to Docker workflow 
• Further integration 
– Docker authentication through OpenStack Identity (keystone)
OpenStack is YOU 
• Documentation 
– http://docs.openstack.org 
Cloud Administrator Guide 
• Questions 
– http://ask.openstack.org 
• Participate 
– http://www.openstack.org/join/register 
– http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack 
– http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-el 
– #OSATH, http://www.meetup.com/Athens-OpenStack-User-Group 
• Contribute 
– code (develop, review), docs, translations, bug reports 
– Review system Gerrit, https://wiki.openstack.org/wiki/GerritWorkflow 
• Follow 
– @openstack
Thank you for being patient! 
Athens OpenStack User Group #OSATH 
http://www.meetup.com/Athens-OpenStack-User-Group 
Thanassis Parathyras 
aparathyras@stackmasters.eu, @parathyras

Docker in OpenStack

  • 1.
    Docker in OpenStack Joint Athens OpenStack User Group and Docker Athens Meetup, 24th September 2014 Thanassis Parathyras aparathyras@stackmasters.eu, @parathyras
  • 2.
    Announcements openstack-el@lists.openstack.org •Join at http://lists.openstack.org OpenStack Summit (http://openstackceeday.com) • 3-7 November, Paris • Contact me for a discount code
  • 3.
    OpenStack’s mission “toproduce the ubiquitous Open Source Cloud Computing platform that will meet the needs of public and private clouds regardless of size, by being simple to implement and massively scalable”
  • 4.
    Docker, what isit? “an open platform for developers and sysadmins to build, ship, and run distributed applications”
  • 5.
    VMs and Containers Smaller resource footprint, same level isolation
  • 6.
    Docker support inOpenStack OpenStack Compute (nova) • Docker driver (since Havana) • Driver not in main source code tree – Faster dev cycles, future plan for merging • Implements OpenStack API OpenStack Orchestration (heat) • Docker plugin • Deploy and manage containers • Native Docker API
  • 7.
  • 8.
    Case 1: Dockerwith Heat Assume an OpenStack with Heat operational environment 1. Install the Docker plugin in Heat cd contrib/heat-docker sudo python ./setup.py install Check Heat property plugin_dirs includes /usr/lib/heat 2. Restart Heat Only the process "heat-engine" needs to be restarted to load the new installed plugin Use this plugin enable Docker containers as resources in Heat templates
  • 9.
    Case 2: Dockerwith Nova Assume an OpenStack operational environment 1. Install Docker on your compute hosts 2. Fix permissions usermod -G docker nova service openstack-nova-compute restart 3. Install driver pip install -e git+https://github.com/stackforge/nova-docker# egg=novadocker
  • 10.
    Case 2: EnablingDocker 1. Configure nova [DEFAULT] compute_driver = novadocker.virt.docker.DockerDriver 2. Create file /etc/nova/rootwrap.d/docker.filters # 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
  • 11.
    Case 2: UsingDocker • Configure glance [DEFAULT] container_formats = ami,ari,aki,bare,ovf,docker Follow the same workflow as other virt drivers: • Create/Add/Use Docker images with Glance • Create/Manage instances with Nova
  • 12.
    Considerations and openissues • Containers don't aim to be a replacement for VMs – they are better for specific use cases – VMs and containers may co-exist in a cloud environment • Docker driver for nova – Lack of integration with Cinder and Neutron – Imports constraints with OpenStack API • Orchestrating containers – A different approach than treating them as another hypervisor type – Better fitted to Docker workflow • Further integration – Docker authentication through OpenStack Identity (keystone)
  • 13.
    OpenStack is YOU • Documentation – http://docs.openstack.org Cloud Administrator Guide • Questions – http://ask.openstack.org • Participate – http://www.openstack.org/join/register – http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack – http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-el – #OSATH, http://www.meetup.com/Athens-OpenStack-User-Group • Contribute – code (develop, review), docs, translations, bug reports – Review system Gerrit, https://wiki.openstack.org/wiki/GerritWorkflow • Follow – @openstack
  • 14.
    Thank you forbeing patient! Athens OpenStack User Group #OSATH http://www.meetup.com/Athens-OpenStack-User-Group Thanassis Parathyras aparathyras@stackmasters.eu, @parathyras