Fork me on GitHub


The target is entirely written in Java. Based on its use-case as stand-alone process, it offers the ability to be started in an own process. It is easily available over maven provided over central-repo:



The configuration of the initiator takes place over the class storing global configurations as well as target-specific ones. Instead of building a suitable configuration by hand, a xsd is provided under src/main/resources/jscsi.xsd. Please note that every own xml used for configuring the jSCSI-target must satisfy the denoted xsd. One example of such an xml is given at the end of the document.

A detailed description of the supported settings is given in the class org.jscsi.parser.datasegment.OperationalTextKey in the commons-bundle. If the config is created by hand, the same settings than denoted by the xsd must be set. Otherwise the target may not be fully functional (even if no exception might be thrown). In all cases, the Configuration must be initialized properly to get the target running

Handling the Target

The main class refers to a Configuration, created with the help of such an XML, while running. At the moment (April 2012), the target is not supporting any authentication or authorization If the storage, referring in the Configuration, is not existing, a creation process must triggered implicitly by the implementing StorageModule. The login-process is performed afterwards.

Reading and Writing

The target listens on the port denoted in the Configuration an maps any request to the registered StorageModules. The main functionalities for a StorageModule is read, write and close. Fully capable to support multithreaded-environments, jSCSI offers a method to for non-blocking read-/write-operations (returning Future-objects) as well as to block directly within each read-/write-access.

Example of initialization

The fastest way to get the jSCSI-target on is the writing of the denote configuration-xml and giving the path of the XML to the TargetServer as only parameter. If no parameter is given as parameter, the standard configuration from target/src/main/resources/jscsi-target.xml is taken.

Example of a configuration-xml

See below an example of the target-config. Note, that many settings are negotiated between initiator and target and therefore not set by a configuration.

<configuration xmlns=""
    xsi:schemaLocation=" jscsi-target.xsd">

            <TargetAlias>jSCSI Target</TargetAlias>
                <NoCreate />
                <!-- <Create size="0.75"/>-->>
            <TargetAlias>jSCSI Target</TargetAlias>
                <NoCreate />
                <!-- <Create size="0.75"/>-->