# iSCSI: istgt, docs, questions, multiple target config



## Pfarthing6 (Feb 26, 2011)

Hi,

I'm attempting to setup a storage solution with FreeBSD using it as an iSCSI target for vmware/xen. 

I'm a bit new to the iSCSI world, but I have gotten 1 target to basically to work, but there doesn't seem to be any real documentation, just the sample configs.

So, I was wondering if anyone could point me to some actual documentation for this package or maybe answer a few brief questions below from your personal experience? 

For each of these, I have searched quite a bit without finding any relavent results. I am referencing the default samples included with pkg version istgt-20110103 from the ports collection of 8.2-RC3.

auth.conf
- what is a mutual user? Are these the creds that will be supplied by the target daemon to the initiator during Chap Mutual authentication?

istgtcontrol.conf
- what is the istgtcontrol.conf file used for?
- why is the same auth info defined both here and in auth.conf?
- what is the relationship between LUN0 here (as default target) and LUN0 in istgt.conf (in [LogicalUnit1] block)?
- does this config need to be updated to handle multiple targets? how?

istgt.conf/general
- can anyone show me an example config that provides multipe distinct targets?
- I noticed that the example of [LogicalUnit2] uses LUN0 also. Is this right? Or do I need a separate LUN<n> for each target?

thanks a bunch!


----------



## aoyama (Feb 27, 2011)

> So, I was wondering if anyone could point me to some actual documentation for this package



There is no document of English now. Main note is written in Japanese.
Also this package is used for FreeNAS project. And an easy cofiguration is done in FreeNAS.



> I am referencing the default samples included with pkg version istgt-20110103



If you want to use QueueDepth, I recommend upgrading to 20110223.
The previous versions have a performance decrease and memory leak bug.
Now istgt-20110223 is testing under 10Gbps link and 6-core CPU.



> auth.conf



CHAP authentication has two ways. (not only istgt feature)

1)initiator -> target (using user and password)

It confirms whether the target is used by known user and password.
The initiator believes the target is good, but the target may be changed to others.

2)target -> initiator (using mutual user and password)

It confirms whether the initiator is used by known target.
If the password is wrong, the initiator can detect an evil target.




> what is the istgtcontrol.conf file used for?



The istgtcontrol is a remote program to operate removable media,
and to get information and to reset some conditions.
The istgt can provide virtual tape device based on LTO/DLT,
and CD/DVD device. (still experimental)



> why is the same auth info defined both here and in auth.conf?



auth.conf is a server side definition.
istgtcontrol.conf is a client side definition.

You can execute istgtcontrol from the place permitted by istgt.conf.
(the sample is localhost only in UnitControl)



> what is the relationship between LUN0 here (as default target) and LUN0 in istgt.conf (in [LogicalUnit1] block)?



The istgt provides one LUN or more. So that, you must specify LUN
to access virtual medium. If you omit the command line option,
it's assumed that default LUN is specified with istgtcontrol.conf.



> does this config need to be updated to handle multiple targets? how?



No.



> I noticed that the example of [LogicalUnit2] uses LUN0 also. Is this right? Or do I need a separate LUN<n> for each target?



It is a historical reason, "LogicalUnit2" means Logical Unit Group #2.
It is not a problem in the use of LUN0 in a different group.
Each unit group is mapped to the iSCSI target by TargetName.

This is a part of my test configuration.
This sample defines three targets:


```
iqn.2007-09.jp.ne.peach.istgt:freenas-d10
iqn.2007-09.jp.ne.peach.istgt:freenas-d11
iqn.2007-09.jp.ne.peach.istgt:freenas-d12
```

In this case, unique SCSI serial is automatically generated from group
number (110, 111, 112 => "10000110", "10000111", "10000112").
Of course, you can specify it by 4th value of UnitInquiry like this:


```
[LogicalUnit110]
  UnitInquiry "FreeBSD" "iSCSI Disk" "0123" "MYSERIAL"
```

----------------------------------------------------------------------

```
[LogicalUnit110]
  TargetName freenas-d10
  Mapping PortalGroup4 InitiatorGroup9
  AuthMethod Auto
  AuthGroup AuthGroup1
  UnitType Disk
  QueueDepth 32
  LUN0 Storage /tank/iscsiz9/istgt-freenas-d10 1TB
[LogicalUnit111]
  TargetName freenas-d11
  Mapping PortalGroup4 InitiatorGroup9
  AuthMethod Auto
  AuthGroup AuthGroup1
  UnitType Disk
  QueueDepth 32
  LUN0 Storage /tank/iscsiz9/istgt-freenas-d11 1TB
[LogicalUnit112]
  TargetName freenas-d12
  Mapping PortalGroup4 InitiatorGroup9
  AuthMethod Auto
  AuthGroup AuthGroup1
  UnitType Disk
  QueueDepth 32
  LUN0 Storage /tank/iscsiz9/istgt-freenas-d12 1500GB
```
----------------------------------------------------------------------


----------



## Pfarthing6 (Feb 28, 2011)

Thank you!


----------



## mix_room (Mar 1, 2011)

aoyama said:
			
		

> There is no document of English now. Main note is written in Japanese.



How well does it translate? Is it readable if you put it through google-translate? I guess people would be willing to, at least try to, help with the translation of the documentation.


----------



## Diman (Mar 17, 2011)

aoyama said:
			
		

> ...
> If you want to use QueueDepth, I recommend upgrading to 20110223.
> The previous versions have a performance decrease and memory leak bug.
> Now istgt-20110223 is testing under 10Gbps link and 6-core CPU.
> ...



istgt-20110223 still have memory leak bug


----------

