ca1e152f2c47890b284cb51a741b08e6f8f85f2c
iscsi-dd can be used to copy the content of one iscsi lun onto a different iscsi lun of the exact same sixe. This example illustrates how to "steal" a task structure from a callback so we can use store it and have it remains valid after the read10 callback has completed. It also illustrates the async api of libiscsi for read10/write10. Initially a number of read10 calls are made asynchronously until the queue is full. As each read10 completes and returns data, we issue a write10 to write that data to the other lun. As soon as a write10 completes, we "release" the initial read10 task corresponding to what we wrote and issue a new read10 to continue copying the next set of un-read data. Using the async api, it should be easy to get very high performance and throughput even from one single thread.
Libiscsi is a clientside library to implement the iSCSI protocol
that can be used to access resource of an iSCSI Target.
The library is fully async with regards to iscsi commands and scsi
tasks, but a sync layer is also provided for ease of use for simpler
applications.
The src directory contain a handful of useful iscsi utilities
such as logging in to and enumerating all targets on a portal
and all devices of a target.
The examples directory contain example implementation of how to
access both the sync and acync api of libiscsi.
Libiscsi is a work in progress.
It aims to become a full async library for iscsi functionality,
including all features required to establish and maintain a iscsi
session, as well as a low level scsi library to create scsi cdb's
and parse/unmarshall data-in structures.
Installation
============
./autogen.sh
./configure
make
sudo make install
Build RPM
=========
To build RPMs run the following script from the libiscsi root directory
./packaging/RPM/makerpms.sh
iSCSI URL Format
================
iSCSI devices are specified by a URL format on the following form :
iscsi://[<username>[%<password>]@]<host>[:<port>]/<target-iqn>/<lun>
Example:
iscsi://server/iqn.ronnie.test/1
When using CHAP authentication, username and password can be specified as part of the URL
iscsi://ronnie%password@server/iqn.ronnie.test/1
but this may make the user and password visible in log files as well as in ps aux output.
So it is also possible to provide either just the password or both the password and username
via environment variables.
The username and/or password can be set via
LIBISCSI_CHAP_USERNAME=ronnie
LIBISCSI_CHAP_PASSWORD=password
Example:
LIBISCSI_CHAP_PASSWORD=password iscsi-inq iscsi://ronnie@10.1.1.27/iqn.ronnie.test/1
IPv6 support
============
Libiscsi supports IPv6, either as names resolving into IPv6 addresses or when
IPv6 addresses are explicitely set in the URL.
When specifying IPv6 addresses in the URL, they have to be specified in
[...] bracket form.
Example:
iscsi://[fec0:2727::3]:3260/iqn.ronnie.test/1
Header Digest
=============
Libiscsi supports HeaderDigest.
By default, libiscsi will offer None,CRC32C and let the target pick whether
Header digest is to be used or not.
This can be overridden by an application by calling iscsi_set_header_digest()
if the application wants to force a specific setting.
Description
Languages
C
97.7%
Shell
1.2%
Makefile
0.6%
M4
0.5%