Package rtslib :: Module tcm :: Class RDMCPStorageObject
[hide private]
[frames] | no frames]

Class RDMCPStorageObject

  object --+        
           |        
node.CFSNode --+    
               |    
   StorageObject --+
                   |
                  RDMCPStorageObject

An interface to configFS storage objects for rd_mcp backstore.

Instance Methods [hide private]
 
__init__(self, backstore, name, size=None, gen_wwn=True, nullio=False)
A RDMCPStorageObject can be instantiated in two ways:
 
_configure(self, size, wwn, nullio)
 
_get_page_size(self)
 
_get_pages(self)
 
_get_size(self)
 
_get_nullio(self)

Inherited from StorageObject: delete, is_configured

Inherited from node.CFSNode: __nonzero__, __str__, 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

Properties [hide private]
  page_size
Get the ramdisk page size.
  pages
Get the ramdisk number of pages.
  size
Get the ramdisk size in bytes.
  nullio
Get the nullio status.

Inherited from StorageObject: attached_luns, backstore, name, status, udev_path, wwn

Inherited from node.CFSNode: exists, is_fresh, path

Inherited from object: __class__

Method Details [hide private]

__init__(self, backstore, name, size=None, gen_wwn=True, nullio=False)
(Constructor)

 

A RDMCPStorageObject can be instantiated in two ways:

  • Creation mode: If size is specified, the underlying configFS object will be created with that parameter. No RDMCPStorageObject with the same name can pre-exist in the parent RDMCPBackstore in that mode, or instantiation will fail.
  • Lookup mode: If size is not set, then the RDMCPStorageObject will be bound to the existing configFS object in the parent RDMCPBackstore having the specified name. The underlying configFS object must already exist in that mode, or instantiation will fail.
Parameters:
  • backstore (RDMCPBackstore) - The parent backstore of the RDMCPStorageObject.
  • name (string) - The name of the RDMCPStorageObject.
  • size (string or int) - The size of the ramdrive to create:
    • If size is an int, it represents a number of bytes
    • If size is a string, the following units can be used :
      • B or no unit present for bytes
      • k, K, kB, KB for kB (kilobytes)
      • m, M, mB, MB for MB (megabytes)
      • g, G, gB, GB for GB (gigabytes)
      • t, T, tB, TB for TB (terabytes) Example: size="1MB" for a one megabytes storage object.
      • Note that the size will be rounded to the closest 4096 Bytes RAM pages count. For instance, a size of 100000 Bytes will be rounded to 24 pages, really 98304 Bytes.
      • The base value for kilo is 1024, aka 1kB = 1024B. Strictly speaking, we use kiB, MiB, etc.
  • gen_wwn (bool) - Should we generate a T10 WWN Unit Serial ?
  • nullio (bool) - If rd should be created w/o backing page store.
Returns:
A RDMCPStorageObject object.
Overrides: object.__init__

Property Details [hide private]

page_size

Get the ramdisk page size.

Get Method:
_get_page_size(self)

pages

Get the ramdisk number of pages.

Get Method:
_get_pages(self)

size

Get the ramdisk size in bytes.

Get Method:
_get_size(self)

nullio

Get the nullio status.

Get Method:
_get_nullio(self)