A Nodeclass can contain either or both of nodes or other nodeclasses (to a maximum depth of 2) - you can pass either a Node or Nodeclass object to many of the functions. (cf. the -N flag to mmlsnodeclass)

Nodeclass Objects support Callback Functions


class arcapix.fs.gpfs.nodeclass.Nodeclass(name, memberNodes=None, memberClasses=None)

The Nodeclass is slightly different from the standard arcapix collection objects, in that it supports add and remove, rather than new and destroy.

Since nodeclass objects can be nested, we have chosen to deviate from the norm, in order to avoid confusion between delete and destroy, which would otherwise result.

Creates a new Node class object, which can be used to either read state from the disk, or to create a new nodeclass.

  • name (str) – The name of the nodeclass to work with
  • memberNodes (list) – A list of nodes which will become members of this nodeclass (either Nodes objects or names)
  • memberClasses (list) – A list of sub-classes which will become members of this nodeclass (either NodeClasses or names)

Create a nodeclass and add the initial nodes (memberNodes) into the nodeclass.

Return type:None

Removes the nodeclass from GPFS

Return type:None

Adds a node to the nodeclass.

Parameters:node_or_nodeclass (Node or Nodeclass or str) – Node object that you want to add
Return type:Nothing

Remove a node from the nodeclass

Parameters:node_or_nodeclass (Node or Nodeclass or str) – Node object that you would like to remove
Return type:Nothing

Replace all existing members of the nodeclass.

Parameters:memberNode – A Node or list of nodes that should replace the existing members

Change attributes of the nodes associated with this nodeclass.

  • gateway (bool) – change whether these nodes are a gateway nodes
  • manager (bool) – change whether these nodes are candidates to be managers
  • quorum (bool) – change whether these nodes are quorum nodes
Return type:



Shuts down GPFS on all nodes in the nodeclass

Parameters:unmountTimeout (int) – Time to wait for filesystem(s) to unmount on the nodes. If unmount doesn’t complete within unmountTimeout, the GPFS daemon will shutdown anyway (default=60+3*(num nodes) seconds).
Return type:Nothing
startup(async=False, timeout=60)

Starts up GPFS on all nodes in the nodeclass

  • async (bool) – If True, do not wait for startup (default=False).
  • timeout (int) – Time to wait for the nodes to start up if not async (in seconds) (default=60s)
Return type:



GPFSError if not async and the nodes aren’t back up within the timeout period


Returns all direct members of the nodeclass

i.e. does not include members of the nodeclasses listed in ‘memberClasses’.

Return type:dict of Node

List of all members, including those from subsiduary nodeclasses

i.e. those returned by ‘memberClasses’

Return type:dict of Node

Returns the identifier for the nodeclass

Synonym for name

Return type:str

Returns the name of the node class

Return type:str

Returns the type of the node class.

Either ‘system’ or ‘user’.

Return type:str

Returns the list of member class names

Return type:dict of Nodeclass


Using Nodeclass directly

>>> from arcapix.fs.gpfs import nodeclass
>>> from arcapix.fs.gpfs import Cluster
>>> # Create a new nodeclass object and create it in GPFS
... myNodeclass = Nodeclass("myNewNodeclass", memberNodes=[node01, node02])
>>> myNodeclass.create()
>>> # Add all nodes which do not contain 'sn' in their name to the nodeclass
... # create a cluster object
... mycluster = Cluster()
>>> # We need to pass Node objects to the
... for nodename in self.mycluster.nodes.values():
...     if "sn" not in
...         node = nodename
...                 myNodeclass.add(node)
>>> # Delete the nodeclass from GPFS
... myNodeclass.delete()