Allow creation of container root filesystem in a user defined location

Bug #1019398 reported by Jean-Baptiste Lallement on 2012-06-29
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Low
Unassigned

Bug Description

With the backing store 'none' the container root filesystem will be a directory under /var/lib/lxc/container/rootfs

It'd be nice to be able to store the root filesystem in a user defined location and per container. Setting rootfs in lxc.conf doesn't work with lxc-create.

The use case is systems with multiple drives dedicated to specific activities (fast storage, high capacity, ...)

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: lxc 0.8.0~rc1-4ubuntu17
ProcVersionSignature: Ubuntu 3.5.0-2.2-generic 3.5.0-rc4
Uname: Linux 3.5.0-2-generic x86_64
ApportVersion: 2.2.5-0ubuntu1
Architecture: amd64
Date: Fri Jun 29 21:51:51 2012
ProcEnviron:
 TERM=xterm
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: lxc
UpgradeStatus: Upgraded to quantal on 2012-01-31 (149 days ago)

Related branches

Jean-Baptiste Lallement (jibel) wrote :
Serge Hallyn (serge-hallyn) wrote :

Thanks for the feature suggestion. That would indeed be useful. If I understand you correctly, the configuration file would still be under /var/lib/lxc/<container>, but only the rootfs would be moved?

Note that you can currently achieve this in a few ways.

You can use lvm backing stores with volume groups on several different drives.

You can also create the container as usual,

   lxc-create -t ubuntu -n p1

move the rootfs

   mv /var/lib/lxc/p1/rootfs /mnt/

and then edit /var/lib/lxc/p1/config to set

  lxc.rootfs = /mnt/rootfs

However, adding support for something like '-B dir --dir /mnt/rootfs' to lxc-create would be doable and avoid the need for hand-editing the container.

Changed in lxc (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.8.0~rc1-4ubuntu26

---------------
lxc (0.8.0~rc1-4ubuntu26) quantal; urgency=low

  * 0100-template-cleanup-cache: clean up template cache if interrupted
    during build. (LP: #1037331)
  * 0101-template-empty-apt-cache: do an apt-cache clean after creating
    a new cache. (LP: #1037626)
  * 0102-lxc-start-d-check-privs: exit early (with failure) if starting a
    daemonized container with insufficient privilege. (LP: #918327)
  * 0103-make-rootfs-location-optional: allow custom location for a
    container rootfs to be specified. (LP: #1019398)
 -- Serge Hallyn <email address hidden> Fri, 17 Aug 2012 09:44:02 -0500

Changed in lxc (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers