volume quota policy rule create

Create a new quota rule

Availability: This command is available to cluster and Vserver administrators at the admin privilege level.

Description

This command creates a quota policy rule. You must enter the following information to create a quota policy rule:
  • Vserver name
  • Quota policy name
  • Volume name
  • Quota target type
  • Target to which the rule applies
  • Qtree to which the rule applies
You can optionally specify the following additional attributes for the quota policy rule:
  • User mapping
  • Hard disk limit
  • Hard file limit
  • Threshold for disk limit
  • Soft disk limit
  • Soft file limit
Note: For a new quota policy rule to get enforced on the volume, you should create the rule in the quota policy assigned to the Vserver. Additionally, a quota off and on or a quota resize operation must be done using the "volume quota modify" command.

Parameters

-vserver <vserver name> - Vserver
This parameter specifies the Vserver containing the quota policy for which you are creating a rule.
-policy-name <text> - Policy Name
This parameter specifies the name of the quota policy in which you are creating a rule.
-volume <volume name> - Volume Name
This parameter specifies the name of the volume for which you are creating a rule.
-type {tree|user|group} - Type
This parameter specifies the quota target type of the rule you are creating.
-target <text> - Target
This parameter specifies the target to which the quota policy rule applies. For default quota rules, this parameter should be specified as "". For explicit tree quotas rules, this parameter should indicate the qtree name. For explicit user quota rules, this parameter can contain UNIX user name, UNIX user identifier, Windows user name, Windows Security Identifier or a path to an existing object within the volume. If a name contains a space, enclose the entire value in quotes. A UNIX user name cannot include a backslash (\) or an @ sign; user names with these characters are treated as Windows names. For multi-user quotas, this parameter can contain multiple user targets separated by a comma. For explicit group quota rules, this parameter can contain UNIX group name or UNIX group identifier or a path to an existing object within the volume. When a path is specified as the target, it should be of the format /vol/<vol-name>/<path to file from volume root> where the volume matches that of the -volume parameter.
-qtree <qtree name> - Qtree Name
This parameter specifies the name of the qtree to which the quota rule applies. This parameter is not applicable for tree type rules. For user or group type rules at the volume level, this parameter should contain "".
[-user-mapping {on|off}] - User Mapping
This parameter optionally specifies if user mapping needs to be performed for a user quota rule. If this parameter is "on", the UNIX user name specified as the quota target will be mapped to the corresponding Windows user name or vice-versa and quota accounting will be performed for the users together. The mapping will be obtained as configured in "vserver name-mapping".

Note that this parameter can be specified only for quota policy rules of type user. A value of "on" can be specified for this parameter only if the quota target is a UNIX user name or a Windows user name and cannot be specified for multi-user quota targets.

[-disk-limit {<size>|-}] - Disk Limit
This parameter optionally specifies a hard limit for the disk space that can be consumed by the quota target. The default unit for the disk limit is assumed to be Kilobytes if no units are specified. When the hard disk space limit is reached, no additional disk space can be consumed by the specified target. The value that you specify for this parameter should be greater than or equal to the threshold and soft disk limit. A disk limit of unlimited can be specified with a "-" for this parameter or by not specifying this parameter and will be indicated by a "-". The maximum value is 1,125,899,906,842,620 KB, which is approximately 1,023 PB. The value should be a multiple of 4 KB. If it is not, this field can appear incorrect in quota reports. This happens because the field is always rounded up to the nearest multiple of 4 KB to match disk space limits, which are translated into 4-KB disk blocks. The value can be larger than the amount of disk space available in the volume.
[-file-limit {<integer>|-}] - Files Limit
This parameter optionally specifies a hard limit for the number of files permitted on the quota target. When the hard number of files limit is reached, no additional files can be created by the specified target. The value that you specify for this parameter should be greater than or equal to the soft file limit. A file limit of unlimited can be specified with a "-" for this parameter or by not specifying this parameter and will be indicated by a "-". The maximum value is 4,294,967,295.
[-threshold {<size>|-}] - Threshold for Disk Limit
This parameter optionally specifies the disk limit threshold for the quota target. The default unit for the disk limit threshold is assumed to be Kilobytes if no units are specified. When the disk limit threshold is exceeded, a console message, EMS events, and SNMP traps are generated. The value that you specify for this parameter should be greater than or equal to the soft disk limit and equal to or less than the disk limit. A threshold of unlimited can be specified with a "-" for this parameter or by not specifying this parameter and will be indicated by a "-". The maximum value is 1,125,899,906,842,620 KB, which is approximately 1,023 PB. The value should be a multiple of 4 KB. If it is not, this field can appear incorrect in quota reports. This happens because the field is always rounded up to the nearest multiple of 4 KB to match disk space limits, which are translated into 4-KB disk blocks.
[-soft-disk-limit {<size>|-}] - Soft Disk Limit
This parameter optionally specifies a soft limit for the disk space that can be consumed by the quota target. The soft disk limit indicates that the hard limit for the disk space will soon be exceeded. The default unit for the soft disk limit is assumed to be Kilobytes if no units are specified. When the soft limit for the disk space is exceeded, a console message, EMS events and SNMP traps are generated. The same happens when the disk space used goes below the specified limit. The value that you specify for this parameter should be equal to or less than the threshold and the disk limit. A soft disk limit of unlimited can be specified with a "-" for this parameter or by not specifying this parameter and will be indicated by a "-". The maximum value is 1,125,899,906,842,620 KB, which is approximately 1,023 PB. The value should be a multiple of 4 KB. If it is not, this field can appear incorrect in quota reports. This happens because the field is always rounded up to the nearest multiple of 4 KB to match disk space limits, which are translated into 4-KB disk blocks.
[-soft-file-limit {<integer>|-}] - Soft Files Limit
This parameter optionally specifies a soft limit for the number of files permitted on the quota target. The soft file limit indicates that the hard limit for the number of files will soon be exceeded. When the soft limit for the number of files is exceeded, a console message, EMS events and SNMP traps are generated. The same happens when the files used goes below the specified limit. The value that you specify for this parameter should be equal to or less than the file limit. A soft file limit of unlimited can be specified with a "-" for this parameter or by not specifying this parameter and will be indicated by a "-". The maximum value is 4,294,967,295.

Examples

The following example creates a default tree quota rule for volume vol0 in Vserver vs0 and in the quota policy named quota_policy_0. This quota policy applies to all qtrees on volume vol0.
cluster1::> volume quota policy rule create -vserver vs0 
-policy-name quota_policy_0 -volume vol0 -type user -target ""

The following example creates a quota policy rule for volume vol0 in Vserver vs0 and in the quota policy named quota_policy_0. This quota policy applies to the UNIX user myuser for a qtree named qtree1 on volume vol0 with a disk limit of 20 Gigabytes, soft disk limit of 15.4 Gigabytes and threshold limit of 15.4 Gigabytes. User mapping is turned on for this rule.

cluster1::> volume quota policy rule create -vserver vs0 
-policy-name quota_policy_0 -volume vol0 -type user -target myuser 
-qtree qtree1 -user-mapping on -disk-limit 20GB -soft-disk-limit 15.4GB 
-threshold 15.4GB

The following example creates a quota policy rule for volume vol0 in Vserver vs0 and in the quota policy named quota_policy_0. This quota policy applies to the Windows user DOMXYZ\myuser for a qtree named qtree1 on volume vol0 with a file limit of 40000 and a soft file limit of 26500. User mapping is turned on for this rule.

cluster1::> volume quota policy rule create -vserver vs0 
-policy-name quota_policy_0 -volume vol0 -type user -target DOMXYZ\myuser 
-qtree qtree1 -user-mapping on -file-limit 40000 -soft-file-limit 26500

The following example creates a quota policy rule for volume vol0 in Vserver vs0 and in the quota policy named quota_policy_0. This quota policy applies to the UNIX user identifier 12345 for a qtree named qtree1 on volume vol0.

cluster1::> volume quota policy rule create -vserver vs0 
-policy-name quota_policy_0 -volume vol0 -type user -target 12345 
-qtree qtree1

The following example creates a quota policy rule for volume vol0 in Vserver vs0 and in the quota policy named quota_policy_0. This quota policy applies to the Windows Security Identifier S-123-456-789 for a qtree named qtree1 on volume vol0.

cluster1::> volume quota policy rule create -vserver vs0 
-policy-name quota_policy_0 -volume vol0 -type user 
-target S-123-456-789 -qtree qtree1

The following example creates a quota policy rule for volume vol0 in Vserver vs0 and in the quota policy named quota_policy_0. This quota policy applies to the UNIX group engr for a qtree named qtree1 on volume vol0.

cluster1::> volume quota policy rule create -vserver vs0 
-policy-name quota_policy_0 -volume vol0 -type group -target engr 
-qtree qtree1

The following example creates a quota policy rule for volume vol0 in Vserver vs0 and in the quota policy named quota_policy_0. This quota policy applies to the user who is the owner of the file /vol/vol0/qtree1/file1.txt for qtree qtree1 on volume vol0.

cluster1::> volume quota policy rule create -vserver vs0 -policy-name 
quota_policy_0 -volume vol0 -type user -target /vol/vol0/qtree1/file1.txt 
-qtree qtree1

The following example creates a quota policy rule for volume vol0 in Vserver vs0 and in the quota policy named quota_policy_0. This quota policy applies to the users specified in the target for qtree qtree1 on volume vol0.

cluster1::> volume quota policy rule create -vserver vs0 
-policy-name quota_policy_0 -volume vol0 -type user 
-target user1,DOMXYZ\user2,23457,S-126-098-567,/vol/vol0/qtree1/file2.txt 
-qtree qtree1