Project Description
Implement a powerful iscsi target in python, and easily use under most popular systems. It also includes the following features: multi-target, multi-connect/session support chap authentication support header & data digest support erl =2

Download
http://sourceforge.net/projects/pytarget/

Features
  • Current support the following features:
    • multi-target,multi-session, multi-connection (MC/s)
    • each target can be configured independently, and use its own iscsi parameters. independent of each other.
    • to negotiate the iscsi parameter by iscsi text request in full feature phase.
    • target/initiator None/CHAP authentication.
    • login request pdu with all kinds of flags(e.g tbit, cbit)
    • iscsi pdu header/data segment digest
    • all of lun devices are through file I/O to achieve.
    • all configurations are saved with xml files for easy modification and reading.
    • simulate all kinds of temporary / permanent scsi disk errors.
    • simulate scsi disk plist / glist and bad block inquiry.
    • scsi disk bad block reassign
    • scsi device start/stop unit
    • simulate scsi enclosure device for SES
    • web user-interface for online management(recommend firefox browser).
    • ERL = 2 (error recovery level)
      • all kinds of snack functions (data/r2t/status/dataack/rdata, etc)
      • all kinds of task management (reset Lun/Target, task reassign, etc)
      • command retry
      • reject pdu
      • logout connect for recovery

Requirements
  • python2.6

Installation
  • xxx.binary-for-windows-x86.rar
    • build for windows platform, run without python environment.
  • xxx.src.tar.bz2
    • pyTarget source package, run under python-2.6 environment.

Configuration (config.xml)
  • <console ip="" port="3260" debug_level="5" />
    • ip: which ip target can listen, empty indicated all of local ips.keep empty is a good choice.
    • debug_level: target console debug level (0 to 6)
  • <target name="iqn.2006-11.1.python.iscsi.target-1" ip="10.0.0.1" port="3260" portal="1">
    • name : iscsi target name, keep unique within
    • ip : target ip address
    • port : target port address
    • portal : target TargetPortalGroupTag
  • <host name="iqn.2006-11.1" targetpwd="" initiatorpwd="">
    • name : iqn(iscsi qualified name), keep unique within target.
    • target_pwd : target chap secret
    • initiator_pwd : initiator chap secret
    • both targetpwd and initiatorpwd are empty indicate none chap.
  • <lun id="0" path="Lun0" capacity="20480" />
    • id: lun id, keey unique within host
    • path: lun file path, keey unique
    • capacity: lun capacity, 1MB = 2*1024 =2048
  • <item key= ... />
    • keep unique within target.
    • iscsi parameters, please refer to rfc3720, section 12

Last edited Mar 14, 2010 at 7:25 PM by wuqingxiu, version 21