[CentOS] Possible to run iscsi-target and initiator on same server?

Sun Oct 11 16:36:16 UTC 2009
Ross Walker <rswwalker at gmail.com>

On Oct 10, 2009, at 12:29 AM, C Linus Hicks <linush at verizon.net> wrote:

> On Fri, 2009-10-09 at 21:42 -0400, Ross Walker wrote:
>> On Oct 9, 2009, at 6:14 PM, C Linus Hicks wrote:
>>>
>>> So for iet, that means /etc/iet/ietd.conf should define the Lun like
>>> this:
>>>
>>> Lun 0 Path=/dev/sdb,Type=blockio,ScsiId=asmdg,ScsiSN=dg0
>>>
>>> If that's all it takes to make it do blockio instead of fileio, then
>>> that is already the case. Deadlocks on the cache pages - wouldn't  
>>> that
>>> only affect I/O and not logging in?
>>
>> Ok, well at least that's covered.
>>
>> Is iptables disabled?
>>
>> Also the latest version of IET won't advertise the loopback on
>> discovery unless you are discovering on that same same loopback
>> address. You can still statically connect though, which I recommend
>> for loopback connections.
>
> Yep, iptables doesn't run on that machine, the service is disabled.  
> And
> I'm just using the one IP address on that machine.
>
> Here's my /var/lib/iscsi/ifaces/iface0 file:
>
> iface.transport_name = tcp
> iface.hwaddress = 00:1D:92:B4:50:6E
>
> Is the transport_name for loopback still tcp?
> The discovery appears to work properly:
>
> [root at lh6 iscsi]# iscsiadm -m discovery -t st -p 10.200.1.6:3260 -I  
> iface0 -P 1
>    Target: iqn.2009-10.net.linush:storage.disk1.sys1.asmdg
>        Portal: 10.200.1.6:3260,1
>           Iface Name: iface0
>
> I found a way to make the entry in /var/lib/iscsi/static which is  
> just a
> symbolic link back to the entry in /var/lib/iscsi/nodes, but you  
> must be
> seeing different documentation because I don't see any thing that  
> talks
> about logging in using the static entry. At any rate, I run this  
> command
> and get the output as shown:
>
> [root at lh6 iscsi]# iscsiadm -m node -T iqn. 
> 2009-10.net.linush:storage.disk1.sys1.asmdg -p 10.200.1.6:3260 -l
> Logging in to [iface: iface0, target: iqn. 
> 2009-10.net.linush:storage.disk1.sys1.asmdg, portal: 10.200.1.6,3260]
> iscsiadm: Could not login to [iface: iface0, target: iqn. 
> 2009-10.net.linush:storage.disk1.sys1.asmdg, portal: 10.200.1.6,3260]:
> iscsiadm: initiator reported error (8 - connection timed out)
>
> And here's the node:
>
> [root at lh6 iscsi]# cat nodes/iqn.2009-10.net.linush 
> \:storage.disk1.sys1.asmdg/10.200.1.6\,3260\,1/iface0
> # BEGIN RECORD 2.0-868
> node.name = iqn.2009-10.net.linush:storage.disk1.sys1.asmdg
> node.tpgt = 1
> node.startup = manual
> iface.hwaddress = 00:1D:92:B4:50:6E
> iface.iscsi_ifacename = iface0
> iface.net_ifacename = default
> iface.transport_name = tcp
> node.discovery_port = 0
> node.discovery_type = static
> node.session.initial_cmdsn = 0
> node.session.initial_login_retry_max = 4
> node.session.cmds_max = 128
> node.session.queue_depth = 32
> node.session.auth.authmethod = None
> node.session.timeo.replacement_timeout = 120
> node.session.err_timeo.abort_timeout = 15
> node.session.err_timeo.lu_reset_timeout = 30
> node.session.err_timeo.host_reset_timeout = 60
> node.session.iscsi.FastAbort = Yes
> node.session.iscsi.InitialR2T = No
> node.session.iscsi.ImmediateData = Yes
> node.session.iscsi.FirstBurstLength = 262144
> node.session.iscsi.MaxBurstLength = 16776192
> node.session.iscsi.DefaultTime2Retain = 0
> node.session.iscsi.DefaultTime2Wait = 2
> node.session.iscsi.MaxConnections = 1
> node.session.iscsi.MaxOutstandingR2T = 1
> node.session.iscsi.ERL = 0
> node.conn[0].address = 10.200.1.6
> node.conn[0].port = 3260
> node.conn[0].startup = manual
> node.conn[0].tcp.window_size = 524288
> node.conn[0].tcp.type_of_service = 0
> node.conn[0].timeo.logout_timeout = 15
> node.conn[0].timeo.login_timeout = 15
> node.conn[0].timeo.auth_timeout = 45
> node.conn[0].timeo.noop_out_interval = 5
> node.conn[0].timeo.noop_out_timeout = 5
> node.conn[0].iscsi.MaxRecvDataSegmentLength = 131072
> node.conn[0].iscsi.HeaderDigest = None,CRC32C
> node.conn[0].iscsi.IFMarker = No
> node.conn[0].iscsi.OFMarker = No
> # END RECORD
>
>> From ifconfig:
>
> eth2      Link encap:Ethernet  HWaddr 00:1D:92:B4:50:6E
>          inet addr:10.200.1.6  Bcast:10.200.1.255  Mask:255.255.255.0

What does the ietd.conf, initiators.allow and targets.allow look like?

What is your network setup? Are you using a vif on the loopback?

-Ross