Pool

The Pool Object represents a PixStor storage pool in the Filesystem.

Pool Objects support Callback Functions

Description

class arcapix.fs.gpfs.pool.Pool(poolname, deviceName)

Class representing a single storage pool on the file system.

Instatiates a Pool Object

Parameters:
  • poolname (str) – The name of the pool this object represents
  • deviceName (str) – The name of the filesystem which this pool is on.
name

Returns the name of the pool

Return type:str
id

Returns the name of the pool

Return type:str
deviceName

Deprecated since version 1.0.

Returns the name of the filesystem on which this pool is located

Return type:str
filesystemName

Returns the name of the filesystem on which this pool is located

Return type:str
disks

Returns a collection of the disk belonging to the pool

Return type:Disks
data

Returns whether the pool contains any disks which can hold data

metadata

Returns whether the pool contains any disks which can hold metadata

descriptor

Returns whether the pool contains any descriptor disks

maintenanceIOPLimit

Returns the number of IOPs assigned to maintenance commands for this pool

Returns None if unlimited.

(GPFS 4.2+ only)

Return type:int
otherIOPLimit

Returns the number of IOPs assigned to other (non-maintenance) commands for this pool

Returns None if unlimited.

(GPFS 4.2+ only)

Return type:int
restripe(flag, nodes=None, qosClass=None)

Performs a restripe action on the files in the pool.

Parameters:
  • flag – The restripe action to perform
  • nodes – A node or nodes to participate in the restripe (default=all)
  • qosClass (str) – Quality of Service class to which the operation should be assigned. One of ‘maintenance’ (default) or ‘other’. (GPFS version 4.2+ only)
resetQoS()

Resets Quality of Service limits to unlimited for this pool

(GPFS 4.2+ only)

change(**kwargs)
Parameters:
  • maintenanceIOPLimit (int) – Number of IOPS to assign to maintenance commands for this pool. Either an integer, or None to imply no limit (GPFS 4.2+ only)
  • otherIOPLimit (int) – Number of IOPS to assign to other commands for this pool. Either an integer, or None to imply no limit (GPFS 4.2+ only)
  • force (bool) – If True, forces QoS to accept values less than 100IOPs

Note

IOPS limits can’t be enabled on a per-pool basis. Changing IOPS limits for one pool will enable Quality of Service for all pools in the parent filesystem.

If you don’t want other pools to be limited, you should make sure their limits are set to None.

poolId

Numerical id of the pool

Return type:int
blockSize

Returns the pool block size

Return type:int
usage

What the pool is used for.

One of (dataOnly, metadataOnly, dataAndMetadata)

Return type:str
maxDiskSize

Returns the max size of disks in the pool

Return type:int
layoutMap

Returns the name of the layout map used.

One of (scatter, cluster)

Return type:str
allowWriteAffinity

Returns whether the pool allows write affinity.

Return type:bool
writeAffinityDepth

Returns the pool’s write affinity depth.

Return type:int
blockGroupFactor

Returns the pool’s block group factor

Return type:int
freeSpaceBytes

Returns the amount of free space in the pool in bytes

Note: this value may not be acurate. It comes from mmlspool, which does not perform inter-node communication to determine space usage

Return type:long
totalSizeBytes

Returns the total capacity of the pool in bytes

Note: this value comes from a deprecated version of mmlspool. If that command fails, mmdf will be called instead, which may have a significant performance impact

Returns:Total size of the pool (bytes)
Return type:long
contiguousSpaceBytes

Returns the amount of contiguous space in bytes for the filesystem

Note: this will call mmdf, which may have a significant performance impact

Returns:Total contiguous space of the pool (bytes)
Return type:long
fragmentedSpaceBytes

Returns the amount of fragmented space in bytes for the pool

Note: this will call mmdf, which may have a significant performance impact

Returns:Total data space in fragments (bytes)
Return type:long
totalMaxDiskSizeBytes

Deprecated since version 0.8.7: Use maxDiskSize instead, as it doesn’t call mmdf

Returns the maximum size of the pool in bytes

Synonym for maxDiskSize

Note: this will call mmdf, which may have a significant performance impact

Returns:The maximum size of the pool (bytes)
Return type:long
callbacks

Returns a collection of the callbacks that are installed on this object

Return type:Callbacks
onLowDiskSpace

Returns a Callbacks collection, the members of which will be triggered when the file system manager detects that disk space is running below the low threshold that is specified in the current policy rule. (Local Event)

Note

This event is triggered every two minutes until the condition is solved.

onNoDiskSpace

Returns a Callbacks collection, the members of which will be triggered when the file system encounters a disk that ran out of space. (Local Event)

Note

This event is triggered every two minutes until the condition is solved.

Examples

Utilising Pool from the Cluster Object

>>> from arcapix.fs.gpfs import Cluster
>>>
>>> # Load the cluster
... mycluster = Cluster()
>>>
>>> for stgpool in mycluster.filesystems['mmfs1'].storagepools.values():
...     print(stgpool.name)
...
system
sas1
sata1
sata2

Displaying the amount of data space available for each pool in a filesystem

>>> from arcapix.fs.gpfs import Cluster
>>> myCluster = Cluster()
>>>
>>> for pool in myCluster.filesystems['mmfs1'].storagepools.values():
...     # print the remaining data space in MB for each pool
...     print("%s has %sMB space remaining usable for data " % (pool.name, pool.contiguousSpaceBytes/1024/1024))
...
system has 37264.0MB space remaining usable for data
sas1 has 5169152.0MB space remaining usable for data