Package rtslib :: Module tcm :: Class RDDRStorageObject

[hide private]
[frames] | no frames]

# Class RDDRStorageObject

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

An interface to configFS storage objects for rd_dr backstore.

Instance Methods | [hide private]

__init__(self, backstore, name, size=None, gen_wwn=True) A RDDRStorageObject can be instantiated in two ways: |

_configure(self, size, wwn) |

_get_page_size(self) |

_get_pages(self) |

_get_size(self) |

Inherited from `StorageObject`: `delete`, `is_configured`

Inherited from `StorageObject` (private): `_control`, `_enable`, `_gen_attached_luns`, `_get_backstore`, `_get_name`, `_get_status`, `_get_udev_path`, `_get_wwn`, `_list_attached_luns`, `_parse_info`, `_set_udev_path`, `_set_wwn`, `_write_fd`

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 `node.CFSNode` (private): `_check_self`, `_create_in_cfs_ine`, `_exists`, `_get_path`, `_is_fresh`, `_list_files`

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]

| page_size Get the ramdisk page size.
| pages Get the ramdisk number of pages.
| size Get the ramdisk size in bytes.
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)
(Constructor)

A RDDRStorageObject can be instantiated in two ways:

- Creation mode: If size is specified, the underlying configFS object will be created with that parameter. No RDDRStorageObject with the same name can pre-exist in the parent RDDRBackstore in that mode, or instantiation will fail.
- Lookup mode: If size is not set, then the RDDRStorageObject will be bound to the existing configFS object in the parent RDDRBackstore having the specified name. The underlying configFS object must already exist in that mode, or instantiation will fail.

Parameters:
  - `backstore` (RDDRBackstore) - The parent backstore of the RDDRStorageObject.
  - `name` (string) - The name of the RDDRStorageObject.
  - `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 ?
Returns:
  A RDDRStorageObject 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)