__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__
|