Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-18816

Lustre quota enforcement for root files in group quota

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • Lustre 2.14.0, Lustre 2.16.1
    • 3
    • 9223372036854775807

    Description

      Some sites run workloads as root, and would like to be able to enforce a quota limit when the process is running with a group ID. This would affect all files written by that process (or process group), not only files written to a specific directory that has a project ID assigned to it.

      Similar to LU-16415 root quota enforcement for projects, it should be possible to enable group quota enforcement for root by setting "lctl set_param -P osd*.*.quota*.root_grp_enable=1" on the MGS.  

      # mkdir /mnt/lustre/testdir
      # chmod 777 /mnt/lustre/testdir# lfs project -g 100 -s /mnt/lustre/testdir
      # lfs setquota -B 200M -g 100 /mnt/lustre/
      # lfs quota -g 100 /mnt/lustre/
      Disk quotas for grp 100 (gid 100):
           Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
          /mnt/lustre       4       0  204800       -       1       0       0       -
      # newgrp wheel
      # id
      uid=0(root) gid=100(users) groups=0(root),100(users)
      # dd if=/dev/zero of=/mnt/lustre/testdir/file bs=1M count=300
      300+0 records in
      300+0 records out
      314572800 bytes (315 MB, 300 MiB) copied, 0.21125 s, 1.5 GB/s
      # lfs quota -g 100 /mnt/lustre
      Disk quotas for grp 100 (gid 100):
           Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
          /mnt/lustre  307112*      0  204800       -       2       0       0       -
      gid 10 is using default file quota setting
      $ id
      uid=8888(serega) gid=100(users) groups=100(users)
      $ dd if=/dev/zero of=/mnt/lustretestdir/file bs=1M count=300
      dd: error writing '/mnt/lustre/testdir/file': Disk quota exceeded
      229+0 records in
      228+0 records out
      239075328 bytes (239 MB, 228 MiB) copied, 0.182616 s, 1.3 GB/s[root@ec01 ~]
      # lfs quota -g 100 /mnt/lustre
      Disk quotas for grp 100 (pid 100):
           Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
          /mnt/lustre  233480*      0  204800       -       2       0       0       -
      gid 100 is using default file quota setting
       

      Attachments

        Issue Links

          Activity

            People

              scherementsev Sergey Cheremencev
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: