Setting up IET (iSCSI Enterprise Target) on homeserver for vmware hypervisor.

Create folder for disk binary file.

mkdir -p /d2

Create binary disk file.

dd if=/dev/zero of=/d2/ds1.bin count=0 obs=1 seek=50G

Edit  /etc/iet/ietd.conf and insert text below.

Target iqn.2012-05.local.mynet:storage.sys0
Lun 0 Path=/d2/ds1.bin,Type=fileio,ScsiId=lun0,ScsiSN=lun0

MaxConnections 1
MaxSessions 0 
InitialR2T Yes
MaxRecvDataSegmentLength 81920
MaxXmitDataSegmentLength 81920
MaxBurstLength 2621440
FirstBurstLength 655360
DefaultTime2Wait 2
DefaultTime2Retain 0
MaxOutstandingR2T 1
DataPDUInOrder Yes
DataSequenceInOrder Yes
ErrorRecoveryLevel 0
HeaderDigest None,CRC32C
DataDigest None,CRC32C
NOPInterval 0
NOPTimeout 0 # Wait that many seconds for a
Wthreads 2
QueuedCommands 320

If you get errors like this one below in syslog, you might need to up the vallues above.

iscsi_trgt: Abort Task (01) issued on tid:1 lun:0 by sid:282574492336640 (Function Complete)

If this limit has been reached your iscsi target wont answer again until target service has been restarted.

Additional config.

Chap mutual

IncomingUser incusername incpasswd
OutgoingUser outusername outpasswd

Skip outgoing for one way chap.

Add more luns to your target,  add the following lines right bellow lun 0 in config above.

Lun 1 Path=/d2/ds2.bin,Type=fileio,ScsiId=lun1,ScsiSN=lun1
Lun 2 Path=/d2/ds3.bin,Type=fileio,ScsiId=lun2,ScsiSN=lun2