nova docker driver cannot find cgroup in /proc/mounts on RHEL

Bug #1243101 reported by Boden R
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Daniel Kuffner

Bug Description

I'm using the nova docker driver on RHEL 3.10.11-1.el6.x86_64 (rebuilt kernel). Based on the format of /proc/mounts on RHEL, the cgroup devices path cannot be found.

On my box the line in /proc/mounts for cgroups looks like this:

none /sys/fs/cgroup cgroup rw,relatime,perf_event,blkio,net_cls,freezer,devices,memory,cpuacct,cpu,cpuset,clone_children 0 0

In the docker driver the method which searches /proc/mounts for the cgroup path looks like this:

    def _find_cgroup_devices_path(self):
        for ln in open('/proc/mounts'):
            if ln.startswith('cgroup ') and 'devices' in ln:
                return ln.split(' ')[1]

Therefore the method cannot find my cgroup path. I hacked around this with a 1 LOC change to the _find_cgroup_devices_path method which looks for 'cgroup' as the 3rd item in the line split:

if ln.split(' ')[2] == 'cgroup' and 'devices' in ln:

The update method in its entirety looks like:

169 def _find_cgroup_devices_path(self):
170 for ln in open('/proc/mounts'):
171 if ln.split(' ')[2] == 'cgroup' and 'devices' in ln:
172 return ln.split(' ')[1]

Based on the format in /proc/mounts on my ubuntu box, this change *should* work on ubuntu as well as rhel.

I did read that docker is only supported with devstack + unbuntu, so I realize this defect may get deferred or even closed. However I wanted to surface it as I believe future efforts of openstack + docker will need to consider non-ubuntu + devstack envs.

Tags: docker
Revision history for this message
Nicolas Fillot (nicolas.fillot) wrote :

I confirm this bug, this also affects Debian (Jessie)

tags: added: docker
Chuck Short (zulcss)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Changed in nova:
assignee: nobody → Daniel Kuffner (daniel-kuffner)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/62182

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/62182
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=21045a58497818f76f880fe74b3eb5ab09088cf3
Submitter: Jenkins
Branch: master

commit 21045a58497818f76f880fe74b3eb5ab09088cf3
Author: Daniel Kuffner <email address hidden>
Date: Sat Dec 14 18:31:26 2013 +0100

    nova docker driver cannot find cgroup in /proc/mounts on RHEL

    In order to support the docker hypervisor on rhel/centos or fedora
    we had to adapt the function which resolves the cgroup path.

    Change-Id: Ie24028f822d91d65d4f90a7941e7b11874a3b425
    Closes-Bug: #1243101

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.