From: Linda Bebernes Date: Mon, 9 Sep 2013 18:41:14 +0000 (-0700) Subject: LUDOC-65 bugfix: Added workaround needed for setting quotas. X-Git-Tag: 2.5.0~32 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=702fc73f556d799ff05fed5a6754c7d5df0606e3;p=doc%2Fmanual.git LUDOC-65 bugfix: Added workaround needed for setting quotas. Also, split section 25.1 into two subsections, one addressing the 2.4+ solution and one addressing pre-2.4 releases (including workaround). Added l24 condition to 2.4 section. Signed-off-by: Linda Bebernes Change-Id: I01fd4ab846fb788cbeb10d6f34a360c0769e184e Reviewed-on: http://review.whamcloud.com/7540 Tested-by: Hudson Reviewed-by: Richard Henwood --- diff --git a/ConfiguringQuotas.xml b/ConfiguringQuotas.xml index c40af6b..d521207 100644 --- a/ConfiguringQuotas.xml +++ b/ConfiguringQuotas.xml @@ -52,65 +52,102 @@
<indexterm><primary>Quotas</primary><secondary>enabling disk</secondary></indexterm>Enabling Disk Quotas - Prior to Lustre 2.4.0, enabling quota involved a full filesystem scan via lfs quotacheck. All filesystems formatted with Lustre 2.4.0 or newer no longer require quotacheck to be run since up-to-date accounting information are now always maintained by the OSD layer, regardless of the quota enforcement status. Although quota enforcement is managed by Lustre itself, each OSD implementation relies on the backend filesystem to maintain per-user/group block and inode usage: - - - For ldiskfs backend, mkfs.lustre now creates empty quota files and enables the QUOTA feature flag in the superblock which turns quota accounting on at mount time automatically. e2fsck was also modified to fix the quota files when the QUOTA feature flag is present. - - - For ZFS backend, accounting ZAPs are created and maintained by the ZFS filesystem itself. While ZFS tracks per-user and group block usage, it does not handle inode accounting. The ZFS OSD implements its own support for inode tracking. Two options are available: - - - The ZFS OSD can estimate the number of inodes in-use based on the number of blocks used by a given user or group. This mode can be enabled by running the following command on the server running the target: lctl set_param osd-zfs.${FSNAME}-${TARGETNAME}.quota_iused_estimate=1. - - - Similarly to block accounting, dedicated ZAPs are also created the ZFS OSD to maintain per-user and group inode usage. This is the default mode which corresponds to quota_iused_estimate set to 0. - - - - - As a result, lfs quotacheck is now deprecated and not required any more when running Lustre 2.4 on the servers. - Lustre filesystems formatted with a Lustre version prior to 2.4.0 can be still safely upgraded to 2.4.0, but won't have functional space usage report until tunefs.lustre --quota is run against all targets. This command sets the QUOTA feature flag in the superblock and runs e2fsck (as a result, the target must be offline) to build the per-UID/GID disk usage database. - - - Lustre 2.4 and beyond requires a version of e2fsprogs that supports quota (i.e. newer or equal to 1.42.3.wc1) to be installed on the server nodes using ldiskfs backend (e2fsprogs isn't needed with ZFS backend). In general, we recommend to use the latest e2fsprogs version available on http://downloads.whamcloud.com/public/e2fsprogs. - The ldiskfs OSD relies on the standard Linux quota to maintain accounting information on disk. As a consequence, the Linux kernel running on the Lustre servers using ldiskfs backend must have CONFIG_QUOTA, CONFIG_QUOTACTL and CONFIG_QFMT_V2 enabled. - - - As of Lustre 2.4.0, quota enforcement is thus turned on/off independently of space accounting which is always enabled. lfs quotaon|off as well as the per-target quota_type parameter are deprecated in favor of a single per-filesystem quota parameter controlling inode/block quota enforcement. Like all permanent parameters, this quota parameter can be set via lctl conf_param on the MGS via the following syntax: - lctl conf_param fsname.quota.ost|mdt=u|g|ug|none - - - ost -- to configure block quota managed by OSTs - - - mdt -- to configure inode quota managed by MDTs - - - u -- to enable quota enforcement for users only - - - g -- to enable quota enforcement for groups only - - - ug -- to enable quota enforcement for both users and groups - - - none -- to disable quota enforcement for both users and groups - - - - Examples: - To turn on user and group quotas for block only on filesystem testfs1, run: - $ lctl conf_param testfs1.quota.ost=ug - To turn on group quotas for inodes on filesystem testfs2, run: - $ lctl conf_param testfs2.quota.mdt=g - To turn off user and group quotas for both inode and block on filesystem testfs3, run: - $ lctl conf_param testfs3.quota.ost=none - $ lctl conf_param testfs3.quota.mdt=none - - Once the quota parameter set on the MGS, all targets which are part of the filesystem will be notified of the new quota settings and enable/disable quota enforcement as needed. The per-target enforcement status can still be verified by running the following command on the Lustre servers: - $ lctl get_param osd-*.*.quota_slave.info + Prior to Lustre 2.4.0, enabling quota involved a full file system scan via lfs + quotacheck. All file systems formatted with Lustre 2.4.0 or newer no longer + require quotacheck to be run since up-to-date accounting information are now always maintained + by the OSD layer, regardless of the quota enforcement status. +
+ Enabling Disk Quotas (Lustre Release 2.4 and later) + Although quota enforcement is managed by Lustre itself, each OSD implementation relies + on the backend file system to maintain per-user/group block and inode usage: + + + For ldiskfs backend, mkfs.lustre now creates empty quota files and enables the QUOTA + feature flag in the superblock which turns quota accounting on at mount time + automatically. e2fsck was also modified to fix the quota files when the QUOTA feature + flag is present. + + + For ZFS backend, accounting ZAPs are created and maintained by the ZFS filesystem + itself. While ZFS tracks per-user and group block usage, it does not handle inode + accounting. The ZFS OSD implements its own support for inode tracking. Two options are + available: + + + The ZFS OSD can estimate the number of inodes in-use based on the number of + blocks used by a given user or group. This mode can be enabled by running the + following command on the server running the target: lctl set_param + osd-zfs.${FSNAME}-${TARGETNAME}.quota_iused_estimate=1. + + + Similarly to block accounting, dedicated ZAPs are also created the ZFS OSD to + maintain per-user and group inode usage. This is the default mode which corresponds + to quota_iused_estimate set to 0. + + + + + As a result, lfs quotacheck is now deprecated and not required any + more when running Lustre 2.4 on the servers. + Lustre filesystems formatted with a Lustre version prior to 2.4.0 can be still safely + upgraded to 2.4.0, but won't have functional space usage report until tunefs.lustre + --quota is run against all targets. This command sets the QUOTA feature flag in + the superblock and runs e2fsck (as a result, the target must be offline) to build the + per-UID/GID disk usage database. + + Lustre 2.4 and beyond requires a version of e2fsprogs that supports quota (i.e. newer + or equal to 1.42.3.wc1) to be installed on the server nodes using ldiskfs backend + (e2fsprogs isn't needed with ZFS backend). In general, we recommend to use the latest + e2fsprogs version available on http://downloads.whamcloud.com/public/e2fsprogs. + The ldiskfs OSD relies on the standard Linux quota to maintain accounting information + on disk. As a consequence, the Linux kernel running on the Lustre servers using ldiskfs + backend must have CONFIG_QUOTA, CONFIG_QUOTACTL and + CONFIG_QFMT_V2 enabled. + + As of Lustre 2.4.0, quota enforcement is thus turned on/off independently of space + accounting which is always enabled. lfs + quotaon|off as well as the per-target + quota_type parameter are deprecated in favor of a single per-filesystem + quota parameter controlling inode/block quota enforcement. Like all permanent parameters, + this quota parameter can be set via lctl conf_param on the MGS via the + following syntax: + lctl conf_param fsname.quota.ost|mdt=u|g|ug|none + + + ost -- to configure block quota managed by OSTs + + + mdt -- to configure inode quota managed by MDTs + + + u -- to enable quota enforcement for users only + + + g -- to enable quota enforcement for groups only + + + ug -- to enable quota enforcement for both users and + groups + + + none -- to disable quota enforcement for both users and + groups + + + Examples: + To turn on user and group quotas for block only on filesystem testfs1, run: + $ lctl conf_param testfs1.quota.ost=ug + To turn on group quotas for inodes on filesystem testfs2, run: + $ lctl conf_param testfs2.quota.mdt=g + To turn off user and group quotas for both inode and block on filesystem testfs3, + run: + $ lctl conf_param testfs3.quota.ost=none + $ lctl conf_param testfs3.quota.mdt=none + Once the quota parameter set on the MGS, all targets which are part of the filesystem + will be notified of the new quota settings and enable/disable quota enforcement as needed. + The per-target enforcement status can still be verified by running the following command on + the Lustre servers: + $ lctl get_param osd-*.*.quota_slave.info osd-zfs.testfs-MDT0000.quota_slave.info= target name: testfs-MDT0000 pool ID: 0 @@ -119,24 +156,59 @@ quota enabled: ug conn to master: setup user uptodate: glb[1],slv[1],reint[0] group uptodate: glb[1],slv[1],reint[0] - - Lustre 2.4 comes with a new quota protocol and a new on-disk format, be sure to check the Interoperability section below (see .) when migrating to 2.4 - - - For Lustre versions older than 2.4, lfs quotacheck must be first run from a client node to create quota files on the Lustre targets (i.e. the MDT and OSTs). lfs quotacheck requires the filesystem to be quiescent (i.e. no modifying operations like write, truncate, create or delete should run concurrently). Failure to follow this caution may result in inaccurate user/group disk usage. Operations that do not change Lustre files (such as read or mount) are okay to run. lfs quotacheck performs a scan on all the Lustre targets to calculates the block/inode usage for each user/group. If the Lustre filesystem has many files, quotacheck may take a long time to complete. Several options can be passed to lfs quotacheck: - # lfs quotacheck -ug /mnt/testfs - - - u -- checks the user disk quota information - - - g -- checks the group disk quota information - - - By default, quota is turned on after quotacheck completes. However, this setting isn't persistent and quota will have to be enabled again (via lfs quotaon) if one of the Lustre target is restarted. lfs quotaoff should be used to turn off quota. - To enable quota permanently with a Lustre version older than 2.4, the quota_type parameter must be used. This requires to set mdd.quota_type and ost.quota_type, respectively, on the MDT and OSTs. quota_type can be set to the string u (user), g (group) or ug for both users and groups. This parameter can be specified at mkfs time (mkfs.lustre --param mdd.quota_type=ug) or with tunefs.lustre. As an example: - tunefs.lustre --param ost.quota_type=ug $ost_dev - When using mkfs.lustre --param mdd.quota_type=ug or tunefs.lustre --param ost.quota_type=ug, be sure to run the command on all OSTs and the MDT. Otherwise, abnormal results may occur. + + Lustre 2.4 comes with a new quota protocol and a new on-disk format, be sure to check + the Interoperability section below (see .) when + migrating to 2.4 + +
+
+ Enabling Disk Quotas (Lustre Releases Previous to Release 2.4 ) + + + In Lustre software releases previous to Release 2.4, when new OSTs + are added to the file system, quotas are not automatically propagated to the new OSTs. + As a workaround, clear and then reset quotas for each user or group using the + lfs setquota command. In the example below, quotas are cleared and + reset for user bob on file system testfs: + $ lfs setquota -u bob -b 0 -B 0 -i 0 -I 0 /mnt/testfs +$ lfs setquota -u bob -b 307200 -B 309200 -i 10000 -I 11000 /mnt/testfs + For Lustre versions older than 2.4, lfs quotacheck must be first + run from a client node to create quota files on the Lustre targets (i.e. the MDT and OSTs). + lfs quotacheck requires the filesystem to be quiescent (i.e. no + modifying operations like write, truncate, create or delete should run concurrently). + Failure to follow this caution may result in inaccurate user/group disk usage. Operations + that do not change Lustre files (such as read or mount) are okay to run. lfs + quotacheck performs a scan on all the Lustre targets to calculates the + block/inode usage for each user/group. If the Lustre filesystem has many files, + quotacheck may take a long time to complete. Several options can be + passed to lfs quotacheck: + # lfs quotacheck -ug /mnt/testfs + + + u -- checks the user disk quota information + + + g -- checks the group disk quota information + + + By default, quota is turned on after quotacheck completes. However, + this setting isn't persistent and quota will have to be enabled again (via lfs + quotaon) if one of the Lustre targets is restarted. lfs + quotaoff is used to turn off quota. + To enable quota permanently with a Lustre version older than 2.4, the + quota_type parameter must be used. This requires setting + mdd.quota_type and ost.quota_type, respectively, on + the MDT and OSTs. quota_type can be set to the string + u (user), g (group) or ug for + both users and groups. This parameter can be specified at mkfs time + (mkfs.lustre --param mdd.quota_type=ug) or with + tunefs.lustre. As an example: + tunefs.lustre --param ost.quota_type=ug $ost_dev + When using mkfs.lustre --param mdd.quota_type=ug or + tunefs.lustre --param ost.quota_type=ug, be sure to run the command on + all OSTs and the MDT. Otherwise, abnormal results may occur. +