How COMSTAR Works
The OpenSolaris Common Multiprotocol SCSI TARget, or COMSTAR, is a software framework that enables you to convert any OpenSolaris host into a SCSI target device that can be accessed over a storage network by initiator hosts. COMSTAR breaks down the task of handling a SCSI target subsystem into independent functional modules. These modules are then managed by SCSI by the Target Mode Framework (STMF).
WATCH THE VIDEO on how to configure an OpenSolaris host as a storage array using COMSTAR.
COMSTAR Architecture
COMSTAR utilizes a SCSI Target Mode Framework (STMF) to manage target storage devices. The software stack consists of port providers (plug-ins) that implement various protocols, such as Fibre Channel (FC) and iSCSI, and logical unit providers that emulate various SCSI devices, such as disk, tape, and the like. The management library (libstmf) provides the management interface for COMSTAR through STMF.
The modules that implement functionality at the SCSI level do not need to interact directly with the underlying transport. Examples of modules that implement functionality are disk and tape. In a similar way, the modules that implement the transport protocol are unaware of the SCSI-level functionality that is inherent in the packets they are transporting. Some examples are Fibre Channel and iSCSI. The framework compartmentalizes the execution and cleanup of SCSI commands and the associated resources. This compartmentalization simplifies the task of writing SCSI or transport modules.
COMSTAR Elements
The following figure shows the inter-communication between COMSTAR elements.

The COMSTAR elements include:
- STMF – Manages transactions, such as context and resources for Small Computer System Interface (SCSI) command execution, and tracking logical unit and port providers. STMF also handles logical unit mappings, allocating memory, recovering failed operations, enumeration, and other necessary functions of an I/O stack.
- Port providers – Provide local connection points for host bus adapters (HBAs), or built-in network interface cards (NICs).
- Logical unit providers – Implement the function of a SCSI logical unit, such as a tape, disk, virtual tape library (VTL), and the like.
- Management library (libstmf) – Communicates with STMF, and performs configuration tasks.

