pyTarget - Windows binary version 184.108.40.206 tested. "...Implement a powerful iSCSI target in python, easily use under most popular systems. ..." - a standalone binary is available for Windows 32-bit (will run without python environment). This project does not have a GUI, however it can be configured from a web interface. Alternatively a .xml configuration file can be used.
Service Name: N/A
|GNU General Public License version 2.0 (GPLv2)||N/A||YES||YES||YES||NO||✔||✘||✔|
pyTarget is a Windows iSCSI Target with a GPLv2 licence. The project homepage (here) states that pyTarget can be used to "...Implement a powerful iSCSI target in python, 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..."
A standalone binary is available for Windows 32-bit - this version does not require that the python environment be installed on the Target system. The pyTarget executable is a console application and can be configured from a web interface. Alternatively the pytarget configuration file can be manually edited.
A third party GUI is being developed by Erwan Labalec and is available for download here.
A Discussion topic on reboot.pro may cover additional settings not discussed in this guide - see here.
pyTarget documentation is limited. A .pdf document is included in the download package and a .txt document is available here. This page covers creating a basic Target using either the configuration file or the GUI.
Screenshot of the pyTarget console (debug level 6) -
Error when attempting to run UEFI (stage2) -
This page contains the following sections -
pyTarget supports fixed type disks including RAW files and Virtual Hard Disks (VHD). pyTarget does not support EXPANDABLE type VHD files, however it does support SPARSE type disk images\files.
An existing disk image can be specified in the configuration file. The disk capacity will also need to be specified - 1 x unit = 512 bytes. The following may be useful in calculating disk image capacity -
If a disk specified in the configuration file does not exist, the pyTarget executable will create a RAW file of the size specified in the capacity= field in config.xml.
Running the GUI will parse data from any existing configuration file (config.xml). Any settings changed in the GUI will be written to the configuration file and will start the pyTarget executable when the Start button is selected. The pyTarget executable will be hidden, however any output will be displayed in the GUI. Starting the GUI without an existing configuration file will display settings similar to the following (GUI version 0.4 - released on 10th February 2017) -
Working from the top to the bottom (and left to right), the fields in the GUI displayed in the image above -
Any changes made in the GUI will be written to the configuration file when the Start button is pressed.
A configuration file config.xml is included in the pyTarget download, however I recommend that you use the GUI to create a configuration file or compile your own.
The following entries can be used as the header for config.xml
Now add a Target -
Now add a Host for authentication purposes. Connections to this Target will be refused from any Initiator/Host not specified -
Now specify/add a disk image -
And now add a second disk image -
Observe that the LUN ID has been changed (id=1), type is still 0 for a disk (type="0"), path is for a different disk image (path="D:\iSCSI_target2.ima") and the disk capacity is 10 GiB (capacity="20971520").
Resulting config.ini file with XML closing tags added for all elements -
NOTE - Multiple Targets can be specified in the Configuration file - this is not (yet?) possible in the GUI.
NOTE - It is not (yet?) possible to set negotiation parameters in the GUI.
iSCSI Negotiation Parameters for individual Targets can be set in the pyTarget configuration file. Supported parameters are -
NOTE - the above negotiation parameters are the default values used for each Target. The configuration file can be used to change the default values.
Sample config.xml including negotiation parameters -
pyTarget documentation is limited and the error messages appear obscure at times.
An error message similar to the following may indicate that another application is listening on port 80 (used by web servers) -
An error message similar to the following may indicate that another application is listening on port 3260 - the default iSCSI port. This may indicate another iSCSI Target is running (including a hidden pyTarget.exe launched from the GUI) -
As stated elsewhere in this page, connections from Initiator/Host systems will require authentication. Assuming that the Initiator/Host identifier was set as iqn.client, add the following command to your iPXE script -
Installing Windows 7 is unusually slow when installing to a pyTarget iSCSI Target. This is covered here.
In tests it took several hours to install Windows 7 when using pyTarget - via a Gigabit Ethernet connection. It is possible that changing the Negotiation parameters may increase the installation speed.
The web interface can be accessed in a browser (FireFox recommended in the pyTarget documentation). Use the loopback address if accessing the web interface on the same system hosting pyTarget ( http://127.0.0.1 )
Screenshot of the web interface after running the target ls command -
Document date - 14th June 2019