Registry / storage / rtslib-fb

rtslib-fb

JSON →
library2.2.4pypypi✓ verified 88d ago

rtslib-fb is a Python object API for managing the Linux kernel SCSI target subsystem (LIO). Version 2.2.4 requires Python >=3.9 and is actively maintained under the open-iscsi organization on GitHub. It provides classes to configure iSCSI, Fibre Channel, and other target backstores, ACLs, and LUNs.

pip install rtslib-fb
INSTALL
IMPORT
SIG · RTSLIB-FB
R
rtslib-fb
storagepythonv2.2.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RTSLibError
✓ from rtslib_fb.utils import RTSLibError
RTSLibError is in rtslib_fb.utils, not directly in rtslib_fb
Target
✓ from rtslib_fb.target import Target
✗ from rtslib_fb import Target
Target class is in rtslib_fb.target submodule
BlockStorageObject
✓ from rtslib_fb.block import BlockStorageObject
Use rtslib_fb.block for block storage objects

Initialize RTSRoot and list existing targets and backstores.

import os from rtslib_fb.root import RTSRoot # Ensure root privileges (rtslib_fb requires root) if os.geteuid() != 0: raise PermissionError('This example requires root privileges') root = RTSRoot() print('Targets:', [t.to_dict() for t in root.targets]) # Example: list all backstores for backstore in root.backstores: print(f'Backstore: {backstore.to_dict()}')
Debug
Known issues
gotchartslib-fb requires root privileges. Most operations will fail with PermissionError if not run as root.
fix
Run the Python script with sudo or as root.
affects: all
breakingIn version 2.2.0, the module name changed from rtslib to rtslib_fb. Old imports like 'import rtslib' will fail.
fix
Replace all imports of rtslib with rtslib_fb (e.g., from rtslib_fb.root import RTSRoot).
affects: >=2.2.0
gotchaThe library directly manipulates kernel configfs and sysfs; concurrent modifications from other tools (e.g., targetcli) can cause race conditions or stale state.
fix
Ensure no other process is modifying LIO config concurrently, or use locking mechanisms.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'rtslib'
Old import path using 'rtslib'; the module was renamed to 'rtslib_fb' in 2.2.0.
fix
Change import to 'rtslib_fb' (e.g., 'from rtslib_fb.root import RTSRoot').
PermissionError: [Errno 1] Operation not permitted
Trying to create or modify LIO objects without root privileges.
fix
Run the script with sudo or as root user.
AttributeError: module 'rtslib_fb' has no attribute 'Target'
Importing Target directly from the top-level module instead of the submodule.
fix
Use 'from rtslib_fb.target import Target'.
Upgrade
Version history
2.2.4latest on PyPI · released Mar 4, 2026
Audit
Dependencies
pyudevrequiredUsed for device discovery and event handling
Agent activity
36 hits · last 30 days
node
32
OpenAI (training)
1
Resources
rtslib-fb — pip install rtslib-fb · libregistry