In the open-iscsi init script, I add "iscsiadm -m node --
loginall=all", so after type the command "/etc/init.d/open-iscsi
start", my computer will be able to detected /dev/sda (my SAN)
[root@localhost ~]# /etc/init.d/open-iscsi start
Starting iSCSI initiator service: [ OK ]
Setting up iSCSI targets: Login session [192.168.2.2:3260 iqn.
1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-target]
[ OK ]
[root@localhost ~]# ls /dev/sd*
/dev/sda
after that I type the command "/etc/init.d/open-iscsi stop"
[root@localhost ~]# /etc/init.d/open-iscsi stop
Stopping iSCSI initiator service: Logout session [0][192.168.2.2:3260
iqn.1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-target]
it will hang there forever ....
in my stop script in init, the hanging is caused by using this command
"iscsiadm -m node --logoutall=all".
can anyone help me to solve this question? I am so new to iscsi.
Thank you!
Susan
- What type of iSCSI SAN are you using?
- Have you tried looking into /var/log/messages if there are error
messages in there?
- Have you tried the command 'dmesg' to see if that gives any errors?
- Have you tried login in and out manually like this:
iscsiadm -m node -T iqn.
1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-target -p
192.168.2.2 -l
all on one line (last command is minus el for login). Does this work
fine?
Then logout by replacing in the previous command -l with -u
What will happen then.
Best to have an other console open as root and a 'tail -f /var/log/
messages' running.
- And before I forget to ask, what Linux distribution are you using?
Albert
What kernel and open-iscsi tools version are you using?
On 4月14日, 下午8時04分, "Albert Pauw" <p...@o2.ie> wrote:
> Few questions:
>
> - What type ofiSCSISAN are you using?
I am using Proware's SAN
>
> - Have you tried looking into /var/log/messages if there are error
> messages in there?
The following is the "dmesg" by typing "iscsiadm -m node --
logoutall=all".
Apr 16 16:53:21 localhost kernel: Loading iSCSI transport class
v2.0-754.
Apr 16 16:53:21 localhost kernel: iscsi: registered transport (tcp)
Apr 16 16:53:21 localhost iscsid: iSCSI logger with pid=23643 started!
Apr 16 16:53:21 localhost open-iscsi: iscsid startup succeeded
Apr 16 16:53:21 localhost open-iscsi: succeeded
Apr 16 16:53:21 localhost kernel: scsi0 : iSCSI Initiator over TCP/IP
Apr 16 16:53:21 localhost kernel: scsi 0:0:0:0: Direct-Access
proIPS__ SB-3164-G1A3 2.1. PQ: 0 ANSI: 4
Apr 16 16:53:21 localhost kernel: SCSI device sda: 780140544 512-byte
hdwr sectors (399432 MB)
Apr 16 16:53:21 localhost kernel: sda: Write Protect is off
Apr 16 16:53:21 localhost kernel: SCSI device sda: write cache:
enabled, read cache: enabled, doesn't support DPO or FUA
Apr 16 16:53:21 localhost kernel: SCSI device sda: 780140544 512-byte
hdwr sectors (399432 MB)
Apr 16 16:53:21 localhost kernel: sda: Write Protect is off
Apr 16 16:53:21 localhost kernel: SCSI device sda: write cache:
enabled, read cache: enabled, doesn't support DPO or FUA
Apr 16 16:53:21 localhost kernel: sda: unknown partition table
Apr 16 16:53:21 localhost kernel: sd 0:0:0:0: Attached scsi disk sda
Apr 16 16:53:21 localhost kernel: sd 0:0:0:0: Attached scsi generic
sg0 type 0
Apr 16 16:53:21 localhost open-iscsi: succeeded
Apr 16 16:53:22 localhost iscsid: transport class version 2.0-754.
iscsid version 2.0-754
Apr 16 16:53:22 localhost iscsid: iSCSI daemon with pid=23644 started!
Apr 16 16:53:22 localhost iscsid: an InitiatorAlias= is required, but
was not found in /etc/iscsi/initiatorname.iscsi
Apr 16 16:53:22 localhost iscsid: iSCSI sync pid=23646 started
Apr 16 16:53:22 localhost iscsid: connection0:0 is operational now
Apr 16 16:55:24 localhost syslog-ng[3485]: STATS: dropped 0
Apr 16 16:56:08 localhost kernel: Synchronizing SCSI cache for disk
sda:
Apr 16 16:59:32 localhost sshd(pam_unix)[31793]: session opened for
user root by root(uid=0)
> - Have you tried the command 'dmesg' to see if that gives any errors?
>
sda: Mode Sense: c3 00 00 08
SCSI device sda: write cache: enabled, read cache: enabled, doesn't
support DPO or FUA
sda: unknown partition table
sd 0:0:0:0: Attached scsi disk sda
sd 0:0:0:0: Attached scsi generic sg0 type 0
Synchronizing SCSI cache for disk sda:
>
> - Have you tried login in and out manually like this:
>
> iscsiadm -m node -T iqn.
> 1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-target -p
> 192.168.2.2 -l
>
> all on one line (last command is minus el for login). Does this work
> fine?
> Thenlogoutby replacing in the previous command -l with -u
>
> What will happen then.
==========================================================================
If i mannually login, then logout. after typing
iscsiadm -m node -T iqn.1997-05.tw.com.proware:sb-3164-
g1a3-000a202dc:default-target -p 192.168.2.2 -u
it will hang in there forever
==========================================================================
> Best to have an other console open as root and a 'tail -f /var/log/
> messages' running.
======================================================================
>tail -f /var/log/message
Apr 16 17:18:41 localhost kernel: SCSI device sda: write cache:
enabled, read cache: enabled, doesn't support DPO or FUA
Apr 16 17:18:41 localhost kernel: SCSI device sda: 780140544 512-byte
hdwr sectors (399432 MB)
Apr 16 17:18:41 localhost kernel: sda: Write Protect is off
Apr 16 17:18:41 localhost kernel: SCSI device sda: write cache:
enabled, read cache: enabled, doesn't support DPO or FUA
Apr 16 17:18:41 localhost kernel: sda: unknown partition table
Apr 16 17:18:41 localhost kernel: sd 0:0:0:0: Attached scsi disk sda
Apr 16 17:18:41 localhost kernel: sd 0:0:0:0: Attached scsi generic
sg0 type 0
Apr 16 17:18:57 localhost kernel: Synchronizing SCSI cache for disk
sda:
Apr 16 17:20:01 localhost crond(pam_unix)[16002]: session opened for
user root by (uid=0)
Apr 16 17:20:01 localhost crond(pam_unix)[16002]: session closed for
user root
======================================================================
I use linux 2.6.20 version of kernel.
Thank you!
Wolley
Could you run this by hand with debugging on?
Run iscsid with debugging on:
# iscsid -d 8
Login:
#iscsiadm -m node -T
iqn.1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-target -p
192.168.2.2 -l
Finally logout with debugging on so we can see where we hang:
#iscsiadm -m node -T
iqn.1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-target -p
192.168.2.2 -u -d 8
These commands should spit out a bunch of "iscsid: ...." messages. Could
you send them here?
[root@localhost ~]# iscsiadm -m node -T iqn.
1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-target -p
192.168.2.2:3260 -d8 -u
iscsiadm: exec_node_op: node [iqn.1997-05.tw.com.proware:sb-3164-
g1a3-000a202dc:default-target,192.168.2.2,3260]
iscsiadm: Looking for config file /etc/iscsi/nodes/iqn.
1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-target/
192.168.2.2,3260
iscsiadm: updated 'node.name', '' => 'iqn.
1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-target'
iscsiadm: updated 'node.transport_name', 'tcp' => 'tcp'
iscsiadm: updated 'node.tpgt', '-1' => '1'
iscsiadm: updated 'node.active_conn', '1' => '1'
iscsiadm: updated 'node.startup', 'manual' => 'manual'
iscsiadm: updated 'node.session.initial_cmdsn', '0' => '0'
iscsiadm: updated 'node.session.auth.authmethod', 'None' => 'None'
iscsiadm: updated 'node.session.timeo.replacement_timeout', '120' =>
'120'
iscsiadm: updated 'node.session.err_timeo.abort_timeout', '10' => '10'
iscsiadm: updated 'node.session.err_timeo.reset_timeout', '30' => '30'
iscsiadm: updated 'node.session.iscsi.InitialR2T', 'No' => 'No'
iscsiadm: updated 'node.session.iscsi.ImmediateData', 'Yes' => 'Yes'
iscsiadm: updated 'node.session.iscsi.FirstBurstLength', '262144' =>
'262144'
iscsiadm: updated 'node.session.iscsi.MaxBurstLength', '16776192' =>
'16776192'
iscsiadm: updated 'node.session.iscsi.DefaultTime2Retain', '0' => '0'
iscsiadm: updated 'node.session.iscsi.DefaultTime2Wait', '0' => '0'
iscsiadm: updated 'node.session.iscsi.MaxConnections', '1' => '1'
iscsiadm: updated 'node.session.iscsi.MaxOutstandingR2T', '1' => '1'
iscsiadm: updated 'node.session.iscsi.ERL', '0' => '0'
iscsiadm: updated 'node.conn[0].address', '' => '192.168.2.2'
iscsiadm: updated 'node.conn[0].port', '3260' => '3260'
iscsiadm: updated 'node.conn[0].startup', 'manual' => 'manual'
iscsiadm: updated 'node.conn[0].tcp.window_size', '524288' => '524288'
iscsiadm: updated 'node.conn[0].tcp.type_of_service', '0' => '0'
iscsiadm: updated 'node.conn[0].timeo.logout_timeout', '15' => '15'
iscsiadm: updated 'node.conn[0].timeo.login_timeout', '15' => '15'
iscsiadm: updated 'node.conn[0].timeo.auth_timeout', '45' => '45'
iscsiadm: updated 'node.conn[0].timeo.active_timeout', '5' => '5'
iscsiadm: updated 'node.conn[0].timeo.idle_timeout', '60' => '60'
iscsiadm: updated 'node.conn[0].timeo.ping_timeout', '5' => '5'
iscsiadm: updated 'node.conn[0].timeo.noop_out_interval', '0' => '10'
iscsiadm: updated 'node.conn[0].timeo.noop_out_timeout', '0' => '15'
iscsiadm: updated 'node.conn[0].iscsi.MaxRecvDataSegmentLength',
'131072' => '65536'
iscsiadm: updated 'node.conn[0].iscsi.HeaderDigest', 'None,CRC32C' =>
'None,CRC32C'
iscsiadm: updated 'node.conn[0].iscsi.DataDigest', 'None' => 'None'
iscsiadm: updated 'node.conn[0].iscsi.IFMarker', 'No' => 'No'
iscsiadm: updated 'node.conn[0].iscsi.OFMarker', 'No' => 'No'
iscsiadm: found targetname iqn.1997-05.tw.com.proware:sb-3164-
g1a3-000a202dc:default-target address 192.168.2.2 port 3260
iscsiadm: looking for session [iqn.1997-05.tw.com.proware:sb-3164-
g1a3-000a202dc:default-target,192.168.2.2,3260]
iscsiadm: deleting device using /sys/bus/scsi/devices/0:0:0:0/delete
........
it will hang there!
Thank you!
Wolley
Ok weird, and you are sure you are using 2.6.20? There was a bug in some
test kernels where we could hang there. If that is not your problem
then, we maybe we are getting stuck trying to send a cache sync command.
I am going to install 2.6.20 and try out a couple different targets, but
I thought I remember that kernel being ok.
Another possiblity is that if the connection is dropped while trying to
shutdown, we try to recover and make sure any IO sitting around is
completed before shutting down and that could take a while. You did not
pull a cable or try any test like that right? Run iscsiadm -m session -i
and make sure that you see that the sessions are in the "Logged in"
state before running shutdown.
=================================
At first, I start open-iscsi and login to session, then execute the
command to get the following message.
[root@localhost ~]# iscsiadm -m session -i
iscsiadm version 2.0-754
************************************
Session (sid 0) using module tcp:
************************************
TargetName: iqn.1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-
target
Portal Group Tag: 1
Network Portal: 192.168.2.2:3260
iSCSI Connection State: LOGGED IN
Internal iscsid Session State: NO CHANGE
************************
Negotiated iSCSI params:
************************
HeaderDigest: None
DataDigest: None
MaxRecvDataSegmentLength: 65536
MaxXmitDataSegmentLength: 8192
FirstBurstLength: 4096
MaxBurstLength: 1048576
ImmediateData: Yes
InitialR2T: No
MaxOutstandingR2T: 1
************************
Attached SCSI devices:
************************
Host Number: 0 State: running
scsi0 Channel 00 Id 0 Lun: 0
Attached scsi disk sda State: running
=================================================
Then I logout and it still stucked in "iscsiadm: deleting device
using /sys/bus/scsi/devices/0:0:0:0/delete".
then I execute iscsiadm -m session -i again ... the following is the
result.
[root@localhost ~]# iscsiadm -m session -i
iscsiadm version 2.0-754
************************************
Session (sid 0) using module tcp:
************************************
TargetName: iqn.1997-05.tw.com.proware:sb-3164-g1a3-000a202dc:default-
target
Portal Group Tag: 1
Network Portal: 192.168.2.2:3260
iSCSI Connection State: LOGGED IN
Internal iscsid Session State: NO CHANGE
************************
Negotiated iSCSI params:
************************
HeaderDigest: None
DataDigest: None
MaxRecvDataSegmentLength: 65536
MaxXmitDataSegmentLength: 8192
FirstBurstLength: 4096
MaxBurstLength: 1048576
ImmediateData: Yes
InitialR2T: No
MaxOutstandingR2T: 1
************************
Attached SCSI devices:
************************
Host Number: 0 State: running
scsi0 Channel 00 Id 0 Lun: 0
====================================================
The device does not exist anymore. But the session is still in "LOGGED
IN" state.
I am still new to iscsi, so I did not do the unplug or other
testing. About IO issue, I set my SAN to be read only, and I haven't
accessed my /dev/sda.
Maybe it's kernel issue - I am using Linux-2.6.20-no2, which is
applied the 2.6.20-no2 patch. I will check my kernel.
Thank you!
Wolley
Yeah, that is becuase the device is sort of half deleted from the
kernel's perspective.
> I am still new to iscsi, so I did not do the unplug or other
> testing. About IO issue, I set my SAN to be read only, and I haven't
> accessed my /dev/sda.
> Maybe it's kernel issue - I am using Linux-2.6.20-no2, which is
> applied the 2.6.20-no2 patch. I will check my kernel.
>
What is the no2 patch?
2.6.20-no2 - "Pardon Me? No. Pardon You" - Experimental Release
---------------------------------------------------------------
NEW Based on 2.6.20.1 & 2.6.20-git16
- Incredible new release not based on -mm, but it has a new unique
touch.
- Faster than 2.6.20-no1, much more stable.
- -git16 is like 6 mb of all updates, and it has things from -mm going
upstream. So this is close enough to the usual.
the main difference is it still has speed and the latest drivers,
but it's not so unstable.
- Updated NoSched with latest RSDL
- Scheduler is still basically -mm2 ingosched
- !NEW USE FLAGS FOR DESKTOP AND LAPTOP!
- These are completely optional, see patch list for what they include.
USE="desktop" or USE="laptop"
- No suspend2 in laptop version because it needs to be ported to -no.
^^ Even though it't vanilla based, it is nothing like 2.6.20
vanilla, its closer to -mm patching-wise.
- This should be very fun, this is my first real attempt at a good
vanilla patchset. I think I succeeded.
Wolley