On 01/29/2016 06:50 AM, bharatvivek2...@gmail.com wrote:
> Dear All,
> 
> I came across following behavior of iscsiadm:
> 

What version of iscsiadm. What version? Where did you get it (distro?)?

> 1. Login to a LUN from a port:
> # time iscsiadm -m node -T
> iqn.2001-03:storage01:ist-m000-sn-0000000992000330.lx-0109.target0000 -p
> 172.168.0.220 --login
> Logging in to [iface: default, target:
> iqn.2001-03:storage01:ist-m000-sn-0000000992000330.lx-0109.target0000,
> portal: 172.168.0.220,3260] (multiple)
> Login to [iface: default, target:
> iqn.2001-03:storage01:ist-m000-sn-0000000992000330.lx-0109.target0000,
> portal: 172.168.0.220,3260] successful.
> 
> 2. Now make the port 172.168.0.220 down
> # ifdown elan3
> # ping 172.168.0.220 -c 1 -w 3
> PING 172.168.0.220 (172.168.0.220) 56(84) bytes of data.
> 
> --- 172.168.0.220 ping statistics ---
> 3 packets transmitted, 0 received, 100% packet loss, time 3000ms


After you did this, did you run any other iscsiadm commands like to logout?

If you didn't then just bringing down the session normally does not
logout the session. If you run

iscsiadm -m session

then you should still see it. If you do

iscsiadm -m session -P 1

then you would just see that the state is down, but we are trying to
reconnect.

However, I think some distros have some NM scripts which try to figure
out of sessions will be affected by ifdown and if so do a iscsiadm
logout. If that is the case for your distro, you would not see a session
with -m session, and in /var/log/messages you would see something about
it getting logged out or removed.



> 
> 3. Now, again login to the LUN:
> # time iscsiadm -m node -T
> iqn.2001-03:storage01:ist-m000-sn-0000000992000330.lx-0109.target0000 -p
> 172.168.0.220 --login

That does not happen in the upstream tools. If the session was still
created (so there was no NM auto logout and you did not do it), then you
would see:

iscsiadm: default: 1 session requested, but 1 already present.
iscsiadm: Could not log into all portals

If the session was logged out, then you should just see what you saw
initially with the logging into [something], then log in to [something]
successful (if you brought up the port) or failed (if the port was still
down).


> # echo $?
> 0
> 
> Is there a way to know, that the re-login on the down port is actually
> successful/failed using iscsiadm login command itself?
> 
> -- 
> 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
> <mailto:open-iscsi+unsubscr...@googlegroups.com>.
> To post to this group, send email to open-iscsi@googlegroups.com
> <mailto: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.

-- 
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