# jail + quota



## evgeni22 (Jun 22, 2012)

*I**s* i*t* possible *to* do quota in *a* jail? *I* have quota on a core freebsd FreeBSD but when *I* get into the jail the quota stop working. *W*hat can be the problem, if it is possible to do?


----------



## idownes (Jun 25, 2012)

What sort of quota are you referring to? For CPU binding cpuset(1). For disk you can use zfs(1). For memory and other things you can try rctl(8).


----------



## fbsd1 (Jun 29, 2012)

Quota runs on the host only. Native jails are just directory trees that consume the host*'*s disk space. The ability to control/limit a jail*'*s directory tree max size is not a function currently available using the native jail commands. That being said, the qjail port addresses this subject by providing the ability at jail create time to create a sparse image file containing the jail*'*s directory tree. The ezjail port has the ability to create a zfs directory tree space. Both the sparse image file and zfs methods provide a vehicle for limiting the amount of host disk space available to the individual jail.


----------



## zennybsd (Feb 24, 2013)

*Avoid complexity*

Yes, I am also trying to figure out the same so that I can get rid of other virtualization methods.

Actually, I could not figure out to easily bind disk-quota and cpu to specific jails like in openvz (just set cpu, virtual swap and diskspace etc. pretty easily in command line, this is somehting FreeBSD needs to focus on, imho).

In openvz, a single command can allocate 2 cpu cores, 512MB guaranteed and 1024MB burstable RAM, and 1024MB of swap to a jail 1000 (they call it VE) to start on boot like:

#vzctl set 1000\
  --cpus 2\
  --vmguarpages 512M\
  --oomguarpages 512M\
  --privvmpages 512M:1024M\
  --swappages 0:1024M\ 
  --onboot=yes\
  --save 

Something equivalent would be great in jails. I know that jails is not openvz, so don't say this is a comparison between apples and oranges. I am eagerly looking forward to somehting like this to happen in jails ;-)


----------



## fbsd1 (Mar 1, 2013)

In 9.1 the jail.conf file was introduced and it has the ability to enable quota on a per jail basis. Check out "man 8 jail"  If you try it out, please provide feedback on your results.


----------

