Nsd

The Nsd object represents a storage device attatched to one or more server nodes. It may or may not have been added to a filesystem.

Description

class arcapix.fs.gpfs.nsd.Nsd(name, filesystem=None, servers=None)

An NSD (Network Shared Disk) is a storage device connected to one or more server nodes.

Parameters:
  • name (str) – Name of the NSD
  • filesystem (str or Filesystem) – Filesystem to which the NSD belongs (None if unassigned)
  • servers (list of str or Node) – A list of server nodes associated with the NSD
id

Returns the id of the NSD

synonym for name

Return type:str
name

Returns the name of the NSD

Return type:str
filesystemName

Returns the name of the filesystem the disk belongs to

Returns None if the NSD is unassigned

Return type:str
filesystem

Returns the filesystem the disk belongs to

Returns None if the NSD is unassigned

Return type:Filesystem
volumeId

Returns the alphanumeric volume id of the disk

Return type:str
servers

Returns a list of the server nodes attatched to the NSD

If the nsd is ‘directly attached’, an empty dict will be returned.

Return type:dict of Node objects
serverNames

Returns a list of names of server nodes attached to the NSD

If the nsd is ‘directly attached’, an empty list will be returned.

Return type:list of str
localCache

Returns whether the nsd is configure for local cache disk usage.

Return type:bool
device

Returns the path of the block device that makes up the NSD

Typically “/dev/…”

Return type:str
deviceType

Returns the device type of the NSD

Typically ‘hdisk’ or ‘dmm’

Return type:str
remarks

Returns any remarks about the NSD

e.g. ‘server node’

Return type:str
storagePoolName

Returns the name of the NSD.

Return type:str
totalSizeBytes

Returns the total capacity of the NSD in bytes.

Return type:long
failureGroup

Returns the failure group that the NSD is assigned to.

Return type:long
data

Returns True if the NSD is allocated for data usage.

Return type:bool
metadata

Returns True if the NSD is allocated for metadata usage.

Return type:bool
contiguousSpaceBytes

Returns the amount of contiguous space in bytes for the NSD.

Return type:long
fragmentedSpaceBytes

Returns the amount of fragmented space in bytes for the NSD.

Return type:long

Examples

Checks an NSD’s device name

>>> from arcapix.fs.gpfs import Nsd
>>>
>>> # create an NSD object
... n = Nsd('md3200_001_L001')
>>>
>>> # look up device name
... n.device
/dev/gpfsblock/mmfs1-md2

Check the state of an NSD’s server nodes

>>> from arcapix.fs.gpfs import Disk
>>>
>>> # create a Disk object
... d = Disk("md3200_001_L000", "mmfs1")
>>>
>>> # loop over disk's NSD's server nodes
... for s in d.nsd.servers:
...    print s.id, s.state
...
pixstor-sn-001 active
pixstor-sn-002 active