[Lxc-users] disk limit?

Serge Hallyn serge.hallyn at canonical.com
Wed May 18 15:52:34 UTC 2011


Quoting Ulli Horlacher (framstag at rus.uni-stuttgart.de):
> 
> Is there an easy way to set up a disk limit for a container?
> I could create a LVM partition for each container, but this is not what I
> call "easy" :-}

(Not trying to argue, just probe)

Why do you call it not easy?  Because you don't have spare partitions to
dedicate to a pv?  Or because you're not used to using lvm?

If the former, then you could use a loopback filesystem instead of
an LVM.  I assume that'll impact performance, but I've not tested it
to see by how much.

If the latter, then in the next few months I intend to push some
stuff to lxc to integrate LVM usage.  Daniel had had comments to
my first patches so it'll likely change, but what I'm using right
now let's me just do lxc-lvmcreate in place of lxc-create to create
a lvm-backed lxc partition, and 'lxc-clone -s -o c1 -n c2' lets me
create container c2 with a lvm snapshot of c1's rootfs.
(See http://s3hh.wordpress.com/2011/03/30/lxc-lvm-clone/ and
http://s3hh.wordpress.com/2011/03/30/one-more-lxc-clone-update/)

There's no cgroup to do what you want, though.

-serge




More information about the lxc-users mailing list