[Lxc-users] limiting RAM usage and disk space usage

Matt Rechenburg matt at openqrm.com
Fri Dec 3 09:58:30 UTC 2010


Hi Lxc team,

actually I would vote against a loop mount.
Much easier and more flexible is to use lvm and mount a logical volume 
at the containers root directory before the container starts.
This will automatically limit the available disk space for the container 
and gives you the flexibility to e.g. snapshot and resize the
containers disk. In my setup I have several "master" images located on 
logical volumes and when I need a new lxc container I just
snapshot one of the master images and deploy the snapshot.
btw: this way Lxc is integrated into openQRM (root on lvm).

many thanks + keep up the great work,

Matt Rechenburg
Project Manager openQRM





On 12/03/2010 08:19 AM, Serge E. Hallyn wrote:
> Quoting Michael H. Warfield (mhw at WittsEnd.com):
>    
>>>> It seems to me that a little extension to lxc-create which creates
>>>> the container inside a loopback fs would be pretty neat.
>>>>          
>>> Wouldn't simply adding the rootfs to the fstab conf with the file system
>>> image and the "-o loop" option do it?  I would think it would.  I
>>> haven't tried it in lxc but I do it all the time just for general
>>> mounting and day to day work.
>>>        
>> So this is an excerpt from one of my LXC VM's fstab (I normally use an
>> explicit bind mount for them):
>>
>> /srv/lxc/private/1004 /srv/lxc/rootfs    none bind 0 0
>>
>> Now...  Wouldn't this work as well?  Untested:
>>
>> /srv/lxc/private/disk.image /srv/lxc/rootfs    none loop 0 0
>>
>> Seems to me that if the bind option works the loop option should as
>> well.
>>      
> Right, for using the container.  lxc-create would presumably need a
> loving touch to make it mount that before doing debootstrap
> or whatever
>
> -serge
>
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App&  Earn a Chance To Win $500!
> Tap into the largest installed PC base&  get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>    


-- 
http://openqrm.com
- The open-source Cloud Computing platform

http://openqrm-enterprise.com
- Professional services and support for openQRM







More information about the lxc-users mailing list