On Tuesday, July 18, 2017 at 7:43:13 AM UTC-7, Damir wrote:
>
> Hello!
>
> I try to configure iscsi initiator on Linux (Mageia 5 x86_64, open-iscsi). 
> The goal is to automatically connect to iscsi-storage by starting linux. 
> Iscsi-storae is configured on 10.11.104.10 (by the provider, and I don't 
> have any access to the storage management) 
>
> 1) I discovered targets with command:
>

Discoverd is a thread that gets started that repeated does your discovery 
command.
 

> [root@localhost ~]# iscsiadm -m discovery -p 10.11.104.10 -t st
> And get a list of avalaible targets:10.11.104.10:3260,1 
> iqn.1991-05.com.microsoft:bckp-104-target10.10.83.10:3260,1 
> iqn.1991-05.com.microsoft:bckp-104-target10.11.100.10:3260,1 
> iqn.1991-05.com.microsoft:bckp-104-target10.11.106.10:3260,1 
> iqn.1991-05.com.microsoft:bckp-104-target10.11.114.10:3260,1 
> iqn.1991-05.com.microsoft:bckp-104-target
>
>
So you've found 5 paths to the same target. 

>  2) To initiate the connection on startup I changed the value of 
> discovery.sendtargets.use_discoveryd = No to Yes
>
> /var/lib/iscsi/send_targets/10.11.104.10,3260/st_config:
>
> # BEGIN RECORD 2.0-872
> discovery.startup = manual
> discovery.type = sendtargets
> discovery.sendtargets.address = 10.11.104.10
> discovery.sendtargets.port = 3260
> discovery.sendtargets.auth.authmethod = None
> discovery.sendtargets.timeo.login_timeout = 15
> discovery.sendtargets.use_discoveryd = Yes
> discovery.sendtargets.discoveryd_poll_inval = 30
> discovery.sendtargets.reopen_max = 5
> discovery.sendtargets.timeo.auth_timeout = 45
> discovery.sendtargets.timeo.active_timeout = 30
> discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
> # END RECORD
>
> In /etc/iscsi/iscsid.conf:
>
> node.startup = manual
> node.leading_login = No
>
>
As iscsid.conf explains, leading_login only applies when "startup" is set 
to "automatic".

>  After restarting of iscsid I get /dev/sdb disk and can work with it. But 
> see also in /var/log/messages the foolowing:
>
> iscsid: Logging in to [iface: default, target: 
> iqn.1991-05.com.microsoft:bckp-104-target, portal: 10.10.83.10,3260] 
> (multiple)
> iscsid: Logging in to [iface: default, target: 
> iqn.1991-05.com.microsoft:bckp-104-target, portal: 10.11.100.10,3260] 
> (multiple)
> iscsid: Logging in to [iface: default, target: 
> iqn.1991-05.com.microsoft:bckp-104-target, portal: 10.11.106.10,3260] 
> (multiple) 
> iscsid: Logging in to [iface: default, target: 
> iqn.1991-05.com.microsoft:bckp-104-target, portal: 10.11.114.10,3260] 
> (multiple)
>
> It means, that iscsid tries to connect to all discovered targets. I delete 
> unwanted targets with the command: 
>
> iscsiadm -m node -p 10.11.100.10  -T 
> iqn.1991-05.com.microsoft:bckp-104-target -o delete
>
>
 it disappears from /var/lib/iscsi, but all the same in /var/log/messages 
> (there are still connections to all discovered targets). Restarting of 
> iscsid does not change anything.
>
> The question is, how to limit logins to discovered targets to only one 
> target 10.11.104.10:3260,1 iqn.1991-05.com.microsoft:bckp-104-target ?
>

The way to get what you want is to:

1. Set node_startup to automatic in iscisd.conf (and leading_login to Yes)
2. Perform discovery. This should only be needed once. If there are extra 
nodes, i.e. nodes discovered you do not want, delete them (as you noted)
3. run "iscsiadm -m node -l" to login to that one node
4. Reboot to test that the "startup=automatic" works. If not, you may need 
to enable one more systemd service.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to