Package rtslib :: Module loop :: Class LUN
[hide private]
[frames] | no frames]

Class LUN

  object --+    
           |    
node.CFSNode --+
               |
              LUN

This is an interface to RTS Target LUNs in configFS. A LUN is identified by its parent Nexus and LUN index.

Instance Methods [hide private]
 
__init__(self, parent_nexus, lun, storage_object=None, alias=None)
A LUN object can be instantiated in two ways:
 
__str__(self)
str(x)
 
_create_in_cfs_ine(self, mode)
Creates the configFS node if it does not already exists depending on the mode.
 
_configure(self, storage_object, alias)
 
_get_alias(self)
 
_get_storage_object(self)
 
_get_parent_nexus(self)
 
_get_lun(self)
 
_get_alua_metadata_path(self)
 
delete(self)
If the underlying configFS object does not exists, this method does nothing.

Inherited from node.CFSNode: __nonzero__, get_attribute, get_auth_attr, get_parameter, list_attributes, list_auth_attrs, list_parameters, set_attribute, set_auth_attr, set_parameter

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]

Inherited from node.CFSNode: alua_metadata_dir, configfs_dir, spec_dir

Properties [hide private]
  alua_metadata_path
Get the ALUA metadata directory path for the LUN.
  parent_nexus
Get the parent Nexus object.
  lun
Get the LUN index as an int.
  storage_object
Get the storage object attached to the LUN.
  alias
Get the LUN alias.

Inherited from node.CFSNode: exists, is_fresh, path

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent_nexus, lun, storage_object=None, alias=None)
(Constructor)

 

A LUN object can be instantiated in two ways:

  • Creation mode: If storage_object is specified, the underlying configFS object will be created with that parameter. No LUN with the same lun index can pre-exist in the parent Nexus in that mode, or instantiation will fail.
  • Lookup mode: If storage_object is not set, then the LUN will be bound to the existing configFS LUN object of the parent Nexus having the specified lun index. The underlying configFS object must already exist in that mode.
Parameters:
  • parent_nexus (Nexus) - The parent Nexus object.
  • lun (0-255) - The LUN index.
  • storage_object (StorageObject subclass) - The storage object to be exported as a LUN.
  • alias (string) - An optional parameter to manually specify the LUN alias. You probably do not need this.
Returns:
A LUN object.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

_create_in_cfs_ine(self, mode)

 

Creates the configFS node if it does not already exists depending on the mode. any -> makes sure it exists, also works if the node already does exists lookup -> make sure it does NOT exists create -> create the node which must not exists beforehand Upon success (no exception raised), self._fresh is True if a node was created, else self._fresh is False.

Overrides: node.CFSNode._create_in_cfs_ine
(inherited documentation)

delete(self)

 

If the underlying configFS object does not exists, this method does nothing. If the underlying configFS object exists, this method attempts to delete it.

Overrides: node.CFSNode.delete

Property Details [hide private]

alua_metadata_path

Get the ALUA metadata directory path for the LUN.

Get Method:
_get_alua_metadata_path(self)

parent_nexus

Get the parent Nexus object.

Get Method:
_get_parent_nexus(self)

lun

Get the LUN index as an int.

Get Method:
_get_lun(self)

storage_object

Get the storage object attached to the LUN.

Get Method:
_get_storage_object(self)

alias

Get the LUN alias.

Get Method:
_get_alias(self)