...
コード ブロック | ||
---|---|---|
| ||
--- /usr/lib/python2.7/dist-packages/rtslib/node.py 2012-06-06 17:59:41.515308657 +0000 +++ node.py 2012-06-06 17:59:50.185146504 +0000 @@ -189,7 +189,7 @@ % str(parameter)) else: try: - fwrite(path, "%s \n" % str(value)) + fwrite(path, "%s\n" % str(value)) except IOError, msg: msg = msg[1] raise RTSLibError("Cannot set parameter %s: %s" |
コード ブロック | ||||||
---|---|---|---|---|---|---|
| ||||||
from rtslib.target import * fabric = FabricModule('iscsi') if not fabric.exists: for mod in fabric.load(): pass if not fabric.exists: error('failed to load iSCSI fabric modules') |
コード ブロック | ||||||
---|---|---|---|---|---|---|
| ||||||
from rtslib.tcm import * bs = IBlockBackstore(0) storage = None for s in bs.storage_objects: if s.name == 'NAME': storage = s break if storage is None: storage = bs.storage_object('NAME', '/dev/ubuntu/VOLUME') |
コード ブロック | ||||||
---|---|---|---|---|---|---|
| ||||||
from rtslib.target import * target = Target(fabric, 'iqn.2012-03.com.cybozu:HOST:NAME') tpg = TPG(target, 1) if len(tpg.luns) == 0: tpg.lun(0, storage, 'NAME at HOST') tpg.network_portal('IP', 3260) tpg.set_attribute('authentication', '0') tpg.set_attribute('generate_node_acls', '1') tpg.set_attribute('demo_mode_write_protect', '0') tpg.set_parameter('InitialR2T', 'No') tpg.enable = True |
...