[RFC] Updated quota-support for LXC!

rickyo

Renowned Member
Oct 21, 2015
26
17
68
Hi,

I know I'm late to the party but I've had 2 real headaches on our cluster:

  1. We use containers, a lot of containers running special applications which in some cases are stuck on older versions of Linux, like CentOS7, (Systemd woes)
  2. We use a few containers running a hosting-environment (which we also use for 1) which is dependent on quotas. If quotas isn't working, nothing works, no virtual sites and no users get created.
Anyway, I bit the sour-grape and started upgrading the machines with old Systemd and that's all and well, the 2 machines which I couldn't upgrade are already replaced with new containers.

So, back to the real problem which might not be a problem at all if we get a few things changed in Proxmox.


The way quota is implemented on PX6 (can be used on PVE7 and 8 if enabling legacy cgroupv1 to be used instead of cgroupv2) is using the old /aquota.* files and appending quota-information to the mount command.

When trying this on a newly upgraded PVE7 I got a few warnings that the aquota.* files are deprecated and replaced with a built-in ext4 kernel-module feature instead.
This feature can be enabled using "tunefs -O quota <device>", can be /dev/rbd1 if you are using CEPH.
Anyway, to do this on PVE7 or later you have to
  1. Create the privileged container using a relatively late Linux EL8 or later or other distro, you don't need to click quota as there aren't any special mount options for this.
  2. Not start the CT
  3. On host: pct mount <vmid>
  4. On host: Check what device it mounted, do: unmount <mountpoint on host>
  5. On host: tune2fs -O quota <device>, this can be check with: tune2fs -l <device> both before and after so you see the difference with and without quota.
  6. On host: pct unmount <vmid>
  7. Start the CT
  8. On CT: All regular commands for handling quota should work, to check if quota is available use quotastat as tune2fs doesn't have permission to read the root-device. If the old /aquota.* files are there, just delete them. There is also a command to convert the old files to the new metadata-version.
This could be implemented as a replacement for the old quota system on newer PVE as it works with cgroup2 and theoretically it should work with unprivileged containers as well, I just haven't tried it.


I hope to get comment on this and maybe get Proxmox to revive quota support for LXC.

Best regards,

Rickard
 
Last edited: