ISCSI Target and Initiator on same host

137 views
Skip to first unread message

Riaan Pretorius

unread,
Jun 30, 2021, 6:41:24 AM6/30/21
to open-iscsi
I have an interesting question to ask:

Is it possible to share the target on the same server as a initiator ?
e.g. server1: target -> server1: initiator 

And then share:
server1: target > server2: initiator 


The idea here it it is sharing a lun to the target itself and other servers. The intention is to use it with oracle RAC. 

Something like this possible with ISCSI?

maybe not the right forum to ask, but asking the creators might get a better answer

Ulrich Windl

unread,
Jun 30, 2021, 7:30:02 AM6/30/21
to open-iscsi
I think I did that about 10 years ago...

>>> Riaan Pretorius <riaan.p...@4cgroup.co.za> schrieb am 30.06.2021 um 12:41
in Nachricht <07b30064-72b3-42c1...@googlegroups.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "open-iscsi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to open-iscsi+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/open-iscsi/07b30064-72b3-42c1-ae71-f40c885c
> 06ffn%40googlegroups.com.




Paul Koning

unread,
Jun 30, 2021, 9:10:54 AM6/30/21
to open-...@googlegroups.com


> On Jun 30, 2021, at 7:29 AM, Ulrich Windl <Ulrich...@rz.uni-regensburg.de> wrote:
>
> I think I did that about 10 years ago...
>
>>>> Riaan Pretorius <riaan.p...@4cgroup.co.za> schrieb am 30.06.2021 um 12:41
> in Nachricht <07b30064-72b3-42c1...@googlegroups.com>:
>> I have an interesting question to ask:
>>
>> Is it possible to share the target on the same server as a initiator ?
>> e.g. server1: target -> server1: initiator

Yes, I've used that in a test setup when I needed to put a file system on iSCSI (to test pNFS).

paul

Riaan Pretorius

unread,
Jun 30, 2021, 11:15:03 AM6/30/21
to open-iscsi
I get strange messages in my logs when i tried do that. and get disk "flapping" when the disk just appear and reappear continuously after a reboot.   logically it would make sense that you can do this, but practically  there is weird issues. Would you guys say it might be a misconfiguration ?

Ulrich Windl

unread,
Jul 1, 2021, 2:12:07 AM7/1/21
to open-iscsi
>>> Riaan Pretorius <riaan.p...@4cgroup.co.za> schrieb am 30.06.2021 um 17:15
in Nachricht <f3e8a3df-cfb2-4913...@googlegroups.com>:
> I get strange messages in my logs when i tried do that. and get disk
> "flapping" when the disk just appear and reappear continuously after a
> reboot. logically it would make sense that you can do this, but
> practically there is weird issues. Would you guys say it might be a
> misconfiguration ?

Maybe be concrete with your setup and messages first.

>
> On Wednesday, 30 June 2021 at 15:10:54 UTC+2 Paul Koning wrote:
>
>>
>>
>> > On Jun 30, 2021, at 7:29 AM, Ulrich Windl <
>> Ulrich...@rz.uni-regensburg.de> wrote:
>> >
>> > I think I did that about 10 years ago...
>> >
>> >>>> Riaan Pretorius <riaan.p...@4cgroup.co.za> schrieb am 30.06.2021 um
>> 12:41
>> > in Nachricht <07b30064-72b3-42c1...@googlegroups.com>:
>> >> I have an interesting question to ask:
>> >>
>> >> Is it possible to share the target on the same server as a initiator ?
>> >> e.g. server1: target -> server1: initiator
>>
>> Yes, I've used that in a test setup when I needed to put a file system on
>> iSCSI (to test pNFS).
>>
>> paul
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "open-iscsi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to open-iscsi+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/open-iscsi/f3e8a3df-cfb2-4913-b518-e01a8016
> 14dbn%40googlegroups.com.




The Lee-Man

unread,
Jul 1, 2021, 11:37:15 AM7/1/21
to open-iscsi
I need a bit more information about your setup. What target are you using? I'm guessing LIO, since that's the most common (using targetcli), but there are others, and each one is different with respect to ACLs, using passwords, etc.

I use LIO/targetcli, and I usually work with the initiator and target on the same system, no problem. This is a network protocol, so it shouldn't matter if the initiator and target are on the same system or miles apart, as long as they are connected via the network.

With LIO, you have to either add your initiator IQN to the ACL for the target, or you need to put the target in "demo" mode. Though poorly named, demo mode allows connection without ACLs (it generates the ACLs on the fly).

Are you using initiator and/or target name/password protection? If so, that adds a layer of complication. For testing, I do not set up any names/passwords.

How to you try to connect to your target? What distribution are you on and what version of that distro? Do you run iscsi discovery first, then connect? Show us the sequence of commands you use, and the actual error messages you say you are getting?

Are you setting up the target the automatically reconnect on each reboot? If so, the steps you take to do that may differ per distrubution. And what systemd services do you have running?

You need to supply much more information, in general, when asking for technical help. :)

Riaan Pretorius

unread,
Jul 1, 2021, 11:56:27 AM7/1/21
to open-iscsi
Hi All,

Thank you all for your comments. I have originally wondered if it was possible to share the target to the host itself and that was answered as a yes. that lead me to "I must be doing something wrong". It turns out it was 2 things. 

1st the way I created my LUNs was wrong and 2nd forgot about the ACL. After I reviewed those 2 things, everything is working as expected.  Just had to re-read the examples i was working from to better understand the issue. 

Original way:
asmdatadisk4 is a udev raw device

/iscsi> 
create iqn.2021-04.local.poc-ora-cluster1:asmdatadisk4
cd iqn.2021-04.local.poc-ora-cluster1:asmdatadisk4/tpg1/
luns/ create/backstores/block/asmdatadisk4
acls/ create iqn.2021-04.local.poc-ora-cluster1:asmdatadisk4
set attribute authentication=0
set attribute generate_node_acls=1
set attribute demo_mode_write_protect=0
cd ../..


Working way:
cd /backstores/block
create name=LUN_0 dev=/dev/sdf
create name=LUN_1 dev=/dev/sdd
create name=LUN_2 dev=/dev/sde

cd /iscsi
create
ls
cd iqn.2003-01.org.linux-iscsi.poc-ora-cluster1.x8664:sn.d67e31a1c6f9/tpg1/luns

create /backstores/block/LUN_0
create /backstores/block/LUN_1
create /backstores/block/LUN_2

and of course this line for ACL
cd /iscsi/iqn.2003-01.org.linux-iscsi.poc-ora-cluster1.x8664:sn.d67e31a1c6f9/tpg1
set attribute authentication=0 demo_mode_write_protect=0 generate_node_acls=1 cache_dynamic_acls=1


Apologies for not replying sooner, was working on getting this demo going.
Reply all
Reply to author
Forward
0 new messages