Linux quota API support
Hello, folks!
I'm using ZFS with OpenVZ containers (separate ZFS volume for every containers) and customers want standard linux quotas inside containers (inside ZFS volume).
Is it possible to provide API for backward compatibility for old software without ZFS quota support?
Yes, at a minimum quota reporting should be available when #2577 is finalized and merged.
Hello!
Maybe my company can help project with some donation? This feature is very important for us.
@pavel-odintsov Unfortunately, it's man power that's in limited supply. You could try and sponsoring a developer to add this functionality. Adding the missing quota ioctl() handlers should get the basic space account working. I node accounting is a bigger change and that's being actively worked in #2577 but realistically it's a few months out.
@behlendorf I'm hired to do the job. I will start with adding ioctl() for regular quotas.
@paboldin that is awesome news. You can't imagine how many people are waiting at my org (vpsfree.cz) for support of that. Would you be willing to extend the work to support OpenVZ containers? We'll need some mechanism how to pass the control of this down to the containers. We're willing to make a contract with you, if you'd be interested.
Pavel will add full support for OpenVZ because we working together on implementing complete ZFS support for OpenVZ :)
@paboldin that's great news. Please let me know if you need any pointers to get started on this!
@behlendorf well, I did some investigation and compiled results into the following plan:
- Implement an option for the ZFS instance that makes kernel export pseudo block-device named e.g.
/dev/zfsfakes/<mountpoint>for thequotactltools to use. This is required becausequotaonand other tools do check for existence of the blockdevice used as a mountpoint. Note that this will also change the/etc/fstabentries for the ZFS instance a bit different. The other option was to patch thequotatools but thequotactlrequires a valid block device to acquirestruct super_blockanyway. - Implement appropriate
quotactl_opsusing the API provided. Usezfs_set_userquotafor setting quota (quotactl_ops->set_dqblk) and general*get_propsto read the quota status. As far as I see there is nograceimplementation since there is nosoftlimitso noquotactl_ops->set_infois required.
Is this corresponding with your expectations? I'm very interested if there is any alternative for the first item.
As a high level description of the solution at least I like the approach, this will make it very easy to pass it to the container. Though I am curious about the OpenVZ side of thibg as well. Is there a maching bug filed in the public OpenVZ bugzilla too, that you could link for reference?
Let's ask @pavel-odintsov to file one.
I'm not very good at the OpenVZ part of the deal at the moment, so someone will have to help me with that.
Well, bad news. quota-tools have a list of supported file systems hardcoded. So the fix for it is required anyway.
That's expected (at least I expected that). I've made my piece with the fact, that we're going to need to provide a repo for every major distribution we support with modified quota-utils(/tools). Can't be avoided. I've had a look at the source some time ago, but didn't find the time to do more about it, so I'm really glad that you guys have picked this up.
Well, for the OpenVZ containers that do have a lot of emulations it could be optional. But for the plain quota it is indeed necessary.
Seems like I will have to start with a simple implementation of quotas w/o OpenVZ involved first.
IMHO, the best approach for this would be to have quota-utils open the mountpoint of the filesystem to do the quota operations, rather than the block device. That avoids the need to even have a block device, which is useful for ZFS as well as network filesystems like Lustre that don't have block devices at all.
See https://github.com/FastVPSEestiOu/zfs-quota for the implementation of ZFS quota for OpenVZ.
Hi folks, I asked a couple of years ago on #3500 about whether we're likely to see any of this work merged into mainline zfsonlinux soon.
We're not OpenVZ users - just vanilla ZFS, migrated across from ext4. We were blindsided by the lack of Linux quota support, and have hacked in setting ZFS userquota properties for enforcement, but we don't have any reporting. On Linux this relies, universally, on support for the standard Linux "way".
We've just had our first user trip over the fact that our quota reporting is broken, and it's a bit embarrassing.
If zfsonlinux doesn't support standard quota reporting, what are sysadmins advised to do? I would really rather avoid writing replacements for warnquota, repquota, quotacheck, etc.
@ixhamza I see that you have been doing some excellent work on userquotas. Please could you shed any light on what the chances are that we'll see this (Linux quota API support) hitting OpenZFS on Linux at any point?
The problem is that Linux Diskquota Tools that is responsible for Linux quota doesn't use a universal API. Instead, it takes quotas info from different file systems using different ways in their hardcoded commands and libs.
So they need to implement a way to get/set quota from/to ZFS in their tools in order to this work for that in future releases of distros they implement this support.