LXC isn't working by default in Lucid because of missing kernel options

Bug #480739 reported by Stéphane Graber
56
This bug affects 7 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Andy Whitcroft
Karmic
Fix Released
Medium
Stefan Bader
Lucid
Fix Released
Medium
Andy Whitcroft

Bug Description

SRU Justification:

Impact: LXC (Linux containers) need two other options set to work correctly.
The options should only affect the usage of cgroups.

Fix: Enable those options as they have been in Lucid now for a while and
also make them consistent over all of ports and main.

---

In order to use LXC (Linux Containers), the cgroup must be enable in the kernel.
As of Karmic, only part of what's needed for LXC is enabled, basically we can manually create a context but can't set the list of allowed devices inside it or restrict swap memory.

Here's the cgroup parameters as of current Karmic kernel:
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
# CONFIG_CGROUP_DEVICE is not set
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_MEM_RES_CTLR=y
# CONFIG_CGROUP_MEM_RES_CTLR_SWAP is not set
CONFIG_NET_CLS_CGROUP=y

In order to have LXC working correctly including its integration with libvirt, we'd need:
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y

Was there any reason not to have these two set to yes ?

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Hi Stéphane,

It's likely these were not enabled because they are experimental:

config CGROUP_DEVICE
        bool "Device controller for cgroups"
        depends on CGROUPS && EXPERIMENTAL
        help
          Provides a cgroup implementing whitelists for devices which
          a process in the cgroup can mknod or open.

config CGROUP_MEM_RES_CTLR_SWAP
        bool "Memory Resource Controller Swap Extension(EXPERIMENTAL)"
        depends on CGROUP_MEM_RES_CTLR && SWAP && EXPERIMENTAL
        help
          Add swap management feature to memory resource controller. When you
          enable this, you can limit mem+swap usage per cgroup. In other words,
          when you disable this, memory resource controller has no cares to
          usage of swap...a process can exhaust all of the swap. This extension
          is useful when you want to avoid exhaustion swap but this itself
          adds more overheads and consumes memory for remembering information.
          Especially if you use 32bit system or small memory system, please
          be careful about enabling this. When memory resource controller
          is disabled by boot option, this will be automatically disabled and
          there will be no overhead from this. Even when you set this config=y,
          if boot option "noswapaccount" is set, swap will not be accounted.
          Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page
          size is 4096bytes, 512k per 1Gbytes of swap.

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
tags: added: kconfig
Changed in linux (Ubuntu):
assignee: nobody → Tim Gardner (timg-tpi)
summary: - LXC isn't working by default in Karmic (and possibly Lucid) because of
- missing kernel options
+ LXC isn't working by default in Lucid because of missing kernel options
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Tim-

Assigning to you for now, please reassign elsewhere in the team, as necessary...

I think we'd like to know the feasibility of enabling LXC in the Lucid kernel? Looks like it's just a couple of config options. Seems to be a "very nice to have" from the feedback in the UDS session...

Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Karmic):
assignee: nobody → Stefan Bader (stefan-bader-canonical)
importance: Undecided → Medium
milestone: none → karmic-updates
status: New → In Progress
Changed in linux (Ubuntu Lucid):
assignee: Tim Gardner (timg-tpi) → Andy Whitcroft (apw)
milestone: none → lucid-alpha-1
status: Triaged → In Progress
Andy Whitcroft (apw)
Changed in linux (Ubuntu Lucid):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 2.6.32-5.6

---------------
linux (2.6.32-5.6) lucid; urgency=low

  [ Andy Whitcroft ]

  * rebase to v2.6.32-rc8
  * update configs following rebase to v2.6.32-rc8
  * update ports configs since rebase to v2.6.32-rc8
  * [Config] enable cgroup options
    - LP: #480739

  [ Upstream Kernel Changes ]

  * rebase to v2.6.32-rc8
 -- Andy Whitcroft <email address hidden> Mon, 23 Nov 2009 11:16:14 +0000

Changed in linux (Ubuntu Lucid):
status: Fix Committed → Fix Released
Andy Whitcroft (apw)
tags: added: kernel-lucid
Revision history for this message
Rodrigo Campos (rodrigocc) wrote :

I've seen the commit on the git repo (1a7aa4539bdd76ce8a25e6850e42ea95d1386adc, UBUNTU: [Config] Enable all CGROUP configuration options) and I would like to know if there is any compiled kernel with this patch to test on karmic. If I'm not wrong it's not on karmic, karmic-updates nor karmic-proposed, but perhaps there's some repo I'm missing ?

I also want to know if you can add CONFIG_USER_NS: This allows containers, i.e. vservers, to use user namespaces to provide different user info for different servers.

Thanks a lot,
Rodrigo

Revision history for this message
Stefan Bader (smb) wrote : Re: [Bug 480739] Re: LXC isn't working by default in Lucid because of missing kernel options

rata wrote:
> I've seen the commit on the git repo
> (1a7aa4539bdd76ce8a25e6850e42ea95d1386adc, UBUNTU: [Config] Enable all
> CGROUP configuration options) and I would like to know if there is any
> compiled kernel with this patch to test on karmic. If I'm not wrong it's
> not on karmic, karmic-updates nor karmic-proposed, but perhaps there's
> some repo I'm missing ?

Currently there is only a staging PPA which has that kernel packages:
https://launchpad.net/~kernel-ppa/+archive/pre-proposed

> I also want to know if you can add CONFIG_USER_NS: This allows
> containers, i.e. vservers, to use user namespaces to provide different
> user info for different servers.

I'd rather keep things as is now. Mainly because by now we are very close to
releasing Lucid (which has that option set) and need to concentrate force
there. Also for non-LTS releases it is now past the 3 month time frame we do
changes to non-critical issues.

Revision history for this message
Rodrigo Campos (rodrigocc) wrote : Re: [Bug 480739] Re: LXC isn't working by default in Lucid because of missing kernel options

On Fri, Feb 26, 2010 at 4:25 PM, Stefan Bader
<email address hidden> wrote:
> rata wrote:
>> I've seen the commit on the git repo
>> (1a7aa4539bdd76ce8a25e6850e42ea95d1386adc, UBUNTU: [Config] Enable all
>> CGROUP configuration options) and I would like to know if there is any
>> compiled kernel with this patch to test on karmic. If I'm not wrong it's
>> not on karmic, karmic-updates nor karmic-proposed, but perhaps there's
>> some repo I'm missing ?
>
> Currently there is only a staging PPA which has that kernel packages:
> https://launchpad.net/~kernel-ppa/+archive/pre-proposed

Ahh, thanks!

>
>> I also want to know if you can add CONFIG_USER_NS: This allows
>> containers, i.e. vservers, to use user namespaces to provide different
>> user info for different servers.
>
> I'd rather keep things as is now. Mainly because by now we are very close to
> releasing Lucid (which has that option set) and need to concentrate force
> there. Also for non-LTS releases it is now past the 3 month time frame we do
> changes to non-critical issues.

Makes sense. Thanks a lot anyway :)

PS: I replied yesterday from an other address, perhaps that's why my
mail was lost. Lets see now :)

Thanks a lot,
Rodrigo

Stefan Bader (smb)
description: updated
Changed in linux (Ubuntu Karmic):
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted linux into karmic-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Rodrigo Campos (rodrigocc) wrote : Re: [Bug 480739] Re: LXC isn't working by default in Lucid because of missing kernel options

On Wed, Mar 24, 2010 at 07:28:55AM -0000, Martin Pitt wrote:
> Accepted linux into karmic-proposed, the package will build now and be
> available in a few hours. Please test and give feedback here. See

I've just tried it and lxc-checkconfig still says: "User namespace: disabled".
This should be because CONFIG_USER_NS is not set. But the other options seems to
be OK (although I didn't try them yet)

Is there any chance this option (CONFIG_USER_NS) is enabled too ?

Thanks a lot,
Rodrigo

Revision history for this message
Stefan Bader (smb) wrote :

See comment #5. Sorry.

Revision history for this message
Rodrigo Campos (rodrigocc) wrote :

On Fri, Mar 26, 2010 at 07:39:58PM -0000, Stefan Bader wrote:
> See comment #5. Sorry.

I thought it would be activated since it is activated on Lucid. Sorry

And thanks a lot anyway :)

Revision history for this message
P3P (p3p) wrote :

I've installed
linux-headers-2.6.31-21 linux-headers-2.6.31-21-generic linux-image-2.6.31-21-generic
from karmic-proposed

and I've lost my lvm partitions

I had only one PV, one VG and one LV in reiserfs format.

pvcreate, vgcreate and lvcreate were needed to restore my previous configuration (data loss!)

About lxc changes, the same that has been already posted:
"Cgroup device: enabled"
but
"User namespace: disabled"

Revision history for this message
Stefan Bader (smb) wrote : Re: [Bug 480739] Re: LXC isn't working by default in Lucid because of missing kernel options

P3P wrote:
> I've installed
> linux-headers-2.6.31-21 linux-headers-2.6.31-21-generic linux-image-2.6.31-21-generic
> from karmic-proposed
>
> and I've lost my lvm partitions
>
> I had only one PV, one VG and one LV in reiserfs format.
>
> pvcreate, vgcreate and lvcreate were needed to restore my previous
> configuration (data loss!)

For that you would need to provide more information. Between the previous kernel
and this one there was no change to neither device-mapper nor reiserfs.
Also I am running and have upgraded from previous kernels an md + lvm setup and
have not seen any problems.
Do you still have logs in /var/log/apt that show the installation/upgrade? Do
you have any logs from the failing boot?

Revision history for this message
P3P (p3p) wrote :

It was a little disconcerting. Perhaps it was not kernel-upgrade related. I preferred to report it as precautionary measure.

Checking the dpkg logs I have found a couple of previous upgrades. Could the package "devicekit-disks" break my lvm partition?

Preparing to replace devicekit-disks 007-2ubuntu5 (using .../devicekit-disks_007-2ubuntu6_amd64.deb) ...
Unpacking replacement devicekit-disks ...
Processing triggers for man-db ...
Setting up devicekit-disks (007-2ubuntu6) ...
Log ended: 2010-04-01 22:43:44

The installation logs of kernel package:

Log started: 2010-04-01 22:47:22
Selecting previously deselected package linux-image-2.6.31-21-generic.
Unpacking linux-image-2.6.31-21-generic (from .../linux-image-2.6.31-21-generic_2.6.31-21.59_amd64.deb) ...
Done.
Selecting previously deselected package linux-headers-2.6.31-21.
Unpacking linux-headers-2.6.31-21 (from .../linux-headers-2.6.31-21_2.6.31-21.59_all.deb) ...
Selecting previously deselected package linux-headers-2.6.31-21-generic.
Unpacking linux-headers-2.6.31-21-generic (from .../linux-headers-2.6.31-21-generic_2.6.31-21.59_amd64.deb) ...
Setting up linux-image-2.6.31-21-generic (2.6.31-21.59) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.31-21-generic
Running postinst hook script /sbin/update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.31-21-generic
Found kernel: /boot/vmlinuz-2.6.31-20-generic
Found kernel: /boot/vmlinuz-2.6.31-19-generic
Found kernel: /boot/vmlinuz-2.6.31-17-generic
Found kernel: /boot/vmlinuz-2.6.28-17-generic
Found kernel: /boot/memtest86+.bin
Replacing config file /var/run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
 * Running DKMS auto installation service for kernel 2.6.31-21-generic ESC[158G
 * nvidia (185.18.36)... ESC[158G nvidia (185.18.36): Installing module.
............
......
^MESC[152G[ OK ]
run-parts: executing /etc/kernel/postinst.d/nvidia-common

Setting up linux-headers-2.6.31-21 (2.6.31-21.59) ...
Setting up linux-headers-2.6.31-21-generic (2.6.31-21.59) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms
 * Running DKMS auto installation service for kernel 2.6.31-21-generic ESC[158G
 * nvidia (185.18.36)... ESC[158G nvidia (185.18.36): Already installed on this kernel.
^MESC[152G[ OK ]
run-parts: executing /etc/kernel/header_postinst.d/nvidia-common

Log ended: 2010-04-01 22:48:36

There wasn't a failed boot, just a failed mount point. The /dev/mapper/vg0-lv0 simply didn't exist. Disconcerting.

Thanks.

Revision history for this message
Stefan Bader (smb) wrote :

It might have been just something failed the detection. The log itself looks ok.
Unfortunately its hard to tell after the vg has been re-created.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.1 KiB)

This bug was fixed in the package linux - 2.6.31-21.59

---------------
linux (2.6.31-21.59) karmic-proposed; urgency=low

  [ Andy Whitcroft ]

  * [Config] generic-pae switch to M586TSC
    - LP: #519448

  [ Chris Wilson ]

  * (pre-stable) drm/i915: Increase fb alignment to 64k
    - LP: #404064

  [ Colin Ian King ]

  * Input: i8042 - bypass AUX IRQ delivery test on laptops
    - LP: #534448

  [ Jerone Young ]

  * SAUCE: Fix volume hotkeys for Dell Studio 1557
    - LP: #465250

  [ Mirsal Ennaime ]

  * SAUCE: aufs: Fix header files inclusion in debug.h
    - LP: #517151

  [ Stefan Bader ]

  * [Config] Enable all CGROUP configuration options
    - LP: #480739

  [ Surbhi Palande ]

  * Revert "[Upstream] acerhdf: Limit modalias matching to supported
    boards"
    - LP: #509730
  * [Config] ext3 defaults to ordered mode
    - LP: #510067

  [ Tim Gardner ]

  * [Config] Fix sub-flavours package conflicts
    - LP: #454827

  [ Upstream Kernel Changes ]

  * PCI/cardbus: Add a fixup hook and fix powerpc
    - LP: #455723
  * fnctl: f_modown should call write_lock_irqsave/restore
    - LP: #519436
  * ACPI: enable C2 and Turbo-mode on Nehalem notebooks on A/C
    - LP: #516325
  * tg3: Add 57788, remove 57720
    - LP: #515390
  * HID: ignore all recent SoundGraph iMON devices
    - LP: #488443
  * Input: ALPS - add interleaved protocol support (Dell E6x00 series)
    - LP: #296610
  * acerhdf: limit modalias matching to supported
    - LP: #509730
  * ASoC: Do not write to invalid registers on the wm9712.
    - LP: #509730
  * cifs: NULL out tcon, pSesInfo, and srvTcp pointers when chasing DFS
    referrals
    - LP: #509730
  * clockevents: Prevent clockevent_devices list corruption on cpu hotplug
    - LP: #509730
  * dma: at_hdmac: correct incompatible type for argument 1 of
    'spin_lock_bh'
    - LP: #509730
  * drivers/net/usb: Correct code taking the size of a pointer
    - LP: #509730
  * Libertas: fix buffer overflow in lbs_get_essid()
    - LP: #509730
  * md: Fix unfortunate interaction with evms
    - LP: #509730
  * pata_cmd64x: fix overclocking of UDMA0-2 modes
    - LP: #509730
  * pata_hpt3x2n: fix clock turnaround
    - LP: #509730
  * SCSI: fc class: fix fc_transport_init error handling
    - LP: #509730
  * sound: sgio2audio/pdaudiocf/usb-audio: initialize PCM buffer
    - LP: #509730
  * USB: emi62: fix crash when trying to load EMI 6|2 firmware
    - LP: #509730
  * USB: Fix a bug on appledisplay.c regarding signedness
    - LP: #509730
  * USB: musb: gadget_ep0: avoid SetupEnd interrupt
    - LP: #509730
  * USB: option: support hi speed for modem Haier CE100
    - LP: #490068, #509730
  * x86, cpuid: Add "volatile" to asm in native_cpuid()
    - LP: #509730
  * e100: Use pci pool to work around GFP_ATOMIC order 5 memory allocation
    failure
    - LP: #509730
  * e100: Fix broken cbs accounting due to missing memset.
    - LP: #509730
  * hostap: Revert a toxic part of the conversion to net_device_ops
    - LP: #509730
  * hwmon: (fschmd) Fix check on unsigned in watchdog_write()
    - LP: #509730
  * hwmon: (sht15) Off-by-one error in array index + incorrect constants
    - LP: #509730
  * i2c/tsl2550: Fix...

Read more...

Changed in linux (Ubuntu Karmic):
status: Fix Committed → Fix Released
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