Quota¶
PixStor provides three types of Quota:
- Per User
- Per Group
- Per Fileset
In addition, quotas can also be appplied to specific users and groups within a Fileset
.
Quotas can either be created independently, or via their parent Filesystem
or Fileset
object. (See Quotas
collection)
Note
Quotas for per-user-per-fileset and per-group-per-fileset are not supported via the API, although this form of quota can be set interactively using the mmedquota command
Important
Due to a bug in PixStor, if the filesystem or cluster manager is changed, any subsequent quota operation will fail. If the operation is repeated, the operation will be successful.
This issue has been resolved in the following file system versions and subsequent releases:
- 3.5.0.33
- 4.1.1.9
- 4.2.0.4
- 4.2.1.1
Description¶
-
class
arcapix.fs.gpfs.quota.
GroupQuota
(name, filesystemName, filesetName=None, **kwargs)¶ Represents a quota which is applied to a group
Construct a quota object. Params are:
Parameters: Other optional parameters include:
blockSoftLimit, blockHardLimit, filesSoftLimit, filesHardLimit
or
blockQuota, blockLimit, filesQuota and filesLimit
-
blockGracePeriod
¶ The time period between a user exceeding the soft blocks limit (aka blockQuota), and being unable to write further data.
Returns None if the soft blocks limit has not been exceeded
Return type: timedelta
-
blockHardLimit
¶ The limit on the number of allocated blocks
AKA Hard Limit - Space which cannot be exceeded
Synonym for blockLimit
Return type: long
-
blockInDoubt
¶ The number of blocks which are uncertain.
blockUsage+blockInDoubt < blockHardLimit
Return type: long
-
blockLimit
¶ The limit on the number of allocated blocks
AKA Hard Limit - Space which cannot be exceeded
Synonym for blockHardLimit
Return type: long
-
blockQuota
¶ The number of allocated blocks at which point quota warning will trigger.
i.e. the grace period will commence.
Synonym for blockSoftLimit
Return type: long
-
blockSoftLimit
¶ The number of allocated blocks at which point quota warning will trigger.
i.e. the grace period will commence.
Synonym for blockQuota
Return type: long
-
change
(**kwargs)¶ Performs changes to an existing quota object.
Possible parameters are:
blockSoftLimit, blockHardLimit, filesSoftLimit, filesHardLimit
or
blockQuota, blockLimit, filesQuota and filesLimit
Return type: None
-
create
()¶ Creates the quota, based on the values which were passed in during construction.
NOTE: Quotas for per-user-per-fileset and per-group-per-fileset are not supported via the API, although this form of quota can be set interactively using the mmedquota command
Return type: None
-
delete
()¶ Removes the quota
-
filesGracePeriod
¶ The time period between a user exceeding the soft files limit (aka filesQuoata), and being unable to create further files.
Returns None if the soft files limit has not been exceeded
Return type: timedelta
-
filesHardLimit
¶ The limit on the total number of files which cannot be exceeded.
Synonym for filesLimit
Return type: long
-
filesLimit
¶ The limit on the total number of files which cannot be exceeded.
Synonym for filesHardLimit
Return type: long
-
filesQuota
¶ The number of files at which quota operations (i.e. grace period) will be trigged.
Synonym for filesSoftLimit
Return type: long
-
filesSoftLimit
¶ The number of files at which quota operations (i.e. grace period) will be trigged.
Synonym for filesQuota
Return type: long
-
id
¶ Returns the ‘id’ of the object, which must be unique for that type.
Typically the name or snapshot ID
-
-
class
arcapix.fs.gpfs.quota.
UserQuota
(name, filesystemName, filesetName=None, **kwargs)¶ Represents a quota which is applied to a user
Construct a quota object. Params are:
Parameters: Other optional parameters include:
blockSoftLimit, blockHardLimit, filesSoftLimit, filesHardLimit
or
blockQuota, blockLimit, filesQuota and filesLimit
-
filesetName
¶ Name of the fileset this quota applies to
Returns None if filesystem wide
Return type: str
-
blockGracePeriod
¶ The time period between a user exceeding the soft blocks limit (aka blockQuota), and being unable to write further data.
Returns None if the soft blocks limit has not been exceeded
Return type: timedelta
-
blockHardLimit
¶ The limit on the number of allocated blocks
AKA Hard Limit - Space which cannot be exceeded
Synonym for blockLimit
Return type: long
-
blockInDoubt
¶ The number of blocks which are uncertain.
blockUsage+blockInDoubt < blockHardLimit
Return type: long
-
blockLimit
¶ The limit on the number of allocated blocks
AKA Hard Limit - Space which cannot be exceeded
Synonym for blockHardLimit
Return type: long
-
blockQuota
¶ The number of allocated blocks at which point quota warning will trigger.
i.e. the grace period will commence.
Synonym for blockSoftLimit
Return type: long
-
blockSoftLimit
¶ The number of allocated blocks at which point quota warning will trigger.
i.e. the grace period will commence.
Synonym for blockQuota
Return type: long
-
change
(**kwargs)¶ Performs changes to an existing quota object.
Possible parameters are:
blockSoftLimit, blockHardLimit, filesSoftLimit, filesHardLimit
or
blockQuota, blockLimit, filesQuota and filesLimit
Return type: None
-
create
()¶ Creates the quota, based on the values which were passed in during construction.
NOTE: Quotas for per-user-per-fileset and per-group-per-fileset are not supported via the API, although this form of quota can be set interactively using the mmedquota command
Return type: None
-
delete
()¶ Removes the quota
-
filesGracePeriod
¶ The time period between a user exceeding the soft files limit (aka filesQuoata), and being unable to create further files.
Returns None if the soft files limit has not been exceeded
Return type: timedelta
-
filesHardLimit
¶ The limit on the total number of files which cannot be exceeded.
Synonym for filesLimit
Return type: long
-
filesLimit
¶ The limit on the total number of files which cannot be exceeded.
Synonym for filesHardLimit
Return type: long
-
filesQuota
¶ The number of files at which quota operations (i.e. grace period) will be trigged.
Synonym for filesSoftLimit
Return type: long
-
filesSoftLimit
¶ The number of files at which quota operations (i.e. grace period) will be trigged.
Synonym for filesQuota
Return type: long
-
id
¶ Returns the ‘id’ of the object, which must be unique for that type.
Typically the name or snapshot ID
-
-
class
arcapix.fs.gpfs.quota.
FilesetQuota
(name, filesystemName, **kwargs)¶ Represents a quota which is applied to a specific fileset.
NB. One can also have quotas for users within a fileset
Construct a quota object. Params are:
Parameters: Other optional parameters include:
blockSoftLimit, blockHardLimit, filesSoftLimit, filesHardLimit
or
blockQuota, blockLimit, filesQuota and filesLimit
-
blockGracePeriod
¶ The time period between a user exceeding the soft blocks limit (aka blockQuota), and being unable to write further data.
Returns None if the soft blocks limit has not been exceeded
Return type: timedelta
-
blockHardLimit
¶ The limit on the number of allocated blocks
AKA Hard Limit - Space which cannot be exceeded
Synonym for blockLimit
Return type: long
-
blockInDoubt
¶ The number of blocks which are uncertain.
blockUsage+blockInDoubt < blockHardLimit
Return type: long
-
blockLimit
¶ The limit on the number of allocated blocks
AKA Hard Limit - Space which cannot be exceeded
Synonym for blockHardLimit
Return type: long
-
blockQuota
¶ The number of allocated blocks at which point quota warning will trigger.
i.e. the grace period will commence.
Synonym for blockSoftLimit
Return type: long
-
blockSoftLimit
¶ The number of allocated blocks at which point quota warning will trigger.
i.e. the grace period will commence.
Synonym for blockQuota
Return type: long
-
change
(**kwargs)¶ Performs changes to an existing quota object.
Possible parameters are:
blockSoftLimit, blockHardLimit, filesSoftLimit, filesHardLimit
or
blockQuota, blockLimit, filesQuota and filesLimit
Return type: None
-
create
()¶ Creates the quota, based on the values which were passed in during construction.
NOTE: Quotas for per-user-per-fileset and per-group-per-fileset are not supported via the API, although this form of quota can be set interactively using the mmedquota command
Return type: None
-
delete
()¶ Removes the quota
-
filesGracePeriod
¶ The time period between a user exceeding the soft files limit (aka filesQuoata), and being unable to create further files.
Returns None if the soft files limit has not been exceeded
Return type: timedelta
-
filesHardLimit
¶ The limit on the total number of files which cannot be exceeded.
Synonym for filesLimit
Return type: long
-
filesLimit
¶ The limit on the total number of files which cannot be exceeded.
Synonym for filesHardLimit
Return type: long
-
filesQuota
¶ The number of files at which quota operations (i.e. grace period) will be trigged.
Synonym for filesSoftLimit
Return type: long
-
filesSoftLimit
¶ The number of files at which quota operations (i.e. grace period) will be trigged.
Synonym for filesQuota
Return type: long
-
id
¶ Returns the ‘id’ of the object, which must be unique for that type.
Typically the name or snapshot ID
-
Examples¶
Creating a Quota entry directly¶
>>> from arcapix.fs.gpfs import UserQuota, GroupQuota, FilesetQuota
>>>
>>> # Create a specific quota for a user
... myquota = UserQuota('pixuser', 'mmfs1', blockHardLimit=65536, blockSoftLimit=32768)
>>> myquota.create()
>>>
>>> # Create a group quota within a specific fileset
... myquota = GroupQuota('pixgroup', 'mmfs1', filesetName='independent1', filesSoftLimit=100, filesHardLimit=200)
>>> myquota.create()
>>>
>>> # Create a per fileset Quota
... myquota = FilesetQuota('independent1', 'mmfs1', blockHardLimit=128000)
>>> myquota.create()
Creating a Quota entry via the cluster object directly¶
>>> from arcapix.fs.gpfs import Cluster
>>>
>>> # Create a quota on a specific fileset.
... fset = Cluster().filesystems["mmfs1"].filesets["val"]
>>> fset.quotas.user.new("pixuser", blockSoftLimit=16384, blockHardLimit=32768)
>>>
>>> # Modify an existing quota
... fset.quotas.user['pixuser'].change(blockHardLimit=65536)
>>>
>>> # Modify a fileset quota via the fileset object
... fset.change(blockSoftLimit=16384, blockHardLimit=32768)