What version of the tools and what kernel are you using with Ubuntu and
ArchLinux?
There was some sysfs changes that broke iscsiadm. You might be hitting
them in some distros with older tools and newer kernels. After you login
could you send the output of
iscsiadm -m session -R -d 8
so I can see the output of a manual scan.
I'm using open-iscsi 2.0.872 with kernel 2.6.37.
Archlinux is always in sync with the official releases and uses a nearly
vanilla kernel.
In the meantime I managed to manually find a workaround, but this is
still nothing to work with a real server-setup...
When I start iscsid I get a kernel message like:
scsi10 : iSCSI Initiator over TCP/IP
The host is being created in /sys/bus/scsi/devices/host10 but the target
is missing. Well from this point the output of iscsiadm -m session -R -d
8 is below.
A rescan of the host has no success.
$echo "- - -" > /sys/class/scsi_host/host10/scan
Now, when I manally add the target with
$echo "scsi add-single-device 10 0 0 1" >/proc/scsi/scsi
dmesg tells me that the target has been added and everything works fine.
scsi 10:0:0:1: Direct-Access Areca ARC-1680-VOL#001 R001 PQ: 0
ANSI: 5
sd 10:0:0:1: [sdb] physical block alignment offset: 1850368
sd 10:0:0:1: [sdb] 3906247680 512-byte logical blocks: (1.99 TB/1.81 TiB)
sd 10:0:0:1: [sdb] Write Protect is off
sd 10:0:0:1: Attached scsi generic sg2 type 0
sd 10:0:0:1: [sdb] Mode Sense: cb 00 00 08
sd 10:0:0:1: [sdb] Write cache: enabled, read cache: enabled, doesn't
support DPO or FUA
sdb: unknown partition table
sd 10:0:0:1: [sdb] Attached SCSI disk
iscsiadm -m session -R -d 8 now has exactly one more line compared with
the output at the end:
...
>>>> iscsiadm: rescanning device 10:0:0:1 <<<<
iscsiadm: scanning host10
iscsiadm: scanning host10 completed
I also patched iscsid which gave me an notice for newer kernel but this
has nothing to do with this problem:
iscsid (1129): /proc/1129/oom_adj is deprecated, please use
/proc/1129/oom_score_adj instead.
--- a/usr/iscsi_util.c 2011-04-04 12:22:24.000000000 +0200
+++ b/usr/iscsi_util.c 2011-04-04 12:22:40.000000000 +0200
@@ -54,7 +54,7 @@
char path[48];
nice(-10);
- sprintf(path, "/proc/%d/oom_adj", getpid());
+ sprintf(path, "/proc/%d/oom_score_adj", getpid());
fd = open(path, O_WRONLY);
if (fd < 0) {
return -1;
$iscsiadm -m session -R -d 8
iscsiadm: Max file limits 1024 1024
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session5'/'targetname'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session5/targetname'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session5/targetname'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session5/targetname' with attribute value
'iqn.2011-03.de.XXXXXXXXX.in:iscsi-backup.target1.lun1'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_session/session5'/'tpgt'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session5/tpgt'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session5/tpgt'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session5/tpgt' with attribute value '1'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_connection/connection5:0'/'persistent_address'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_connection/connection5:0/persistent_address'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_connection/connection5:0/persistent_address'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_connection/connection5:0/persistent_address' with
attribute value 'XXX.XXX.XXX.XXX'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_connection/connection5:0'/'address'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_connection/connection5:0/address'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_connection/connection5:0/address'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_connection/connection5:0/address' with attribute value
'XXX.XXX.XXX.XXX'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_connection/connection5:0'/'persistent_port'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_connection/connection5:0/persistent_port'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_connection/connection5:0/persistent_port'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_connection/connection5:0/persistent_port' with
attribute value '3260'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_connection/connection5:0'/'port'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_connection/connection5:0/port'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_connection/connection5:0/port'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_connection/connection5:0/port' with attribute value '3260'
iscsiadm: sysfs_device_get: open '/class/iscsi_session/session5'
iscsiadm: sysfs_resolve_link: path link '/class/iscsi_session/session5'
points to '../../devices/platform/host10/session5/iscsi_session/session5'
iscsiadm: sysfs_resolve_link: base '/class/iscsi_session/session5', tail
'devices/platform/host10/session5/iscsi_session/session5', back 2
iscsiadm: sysfs_resolve_link: after moving back ''
iscsiadm: sysfs_device_get: new uncached device
'/devices/platform/host10/session5/iscsi_session/session5'
iscsiadm: sysfs_device_set_values: kernel='session5'
iscsiadm: sysfs_device_set_values: kernel_number='5'
iscsiadm: sysfs_device_get: subsystem link
'/sys/devices/platform/host10/session5/iscsi_session/session5/subsystem'
points to '../../../../../../class/iscsi_session'
iscsiadm: sysfs_device_get: add to cache
'devpath=/devices/platform/host10/session5/iscsi_session/session5',
subsystem='iscsi_session', driver=''
iscsiadm: sysfs_device_get_parent: open
'/devices/platform/host10/session5/iscsi_session/session5'
iscsiadm: sysfs_device_get_parent:
'/devices/platform/host10/session5/iscsi_session/session5'
iscsiadm: sysfs_device_get: open
'/devices/platform/host10/session5/iscsi_session'
iscsiadm: sysfs_device_get: new uncached device
'/devices/platform/host10/session5/iscsi_session'
iscsiadm: sysfs_device_set_values: kernel='iscsi_session'
iscsiadm: sysfs_device_set_values: kernel_number=''
iscsiadm: sysfs_device_get: add to cache
'devpath=/devices/platform/host10/session5/iscsi_session', subsystem='',
driver=''
iscsiadm: sysfs_device_get_parent: open
'/devices/platform/host10/session5/iscsi_session'
iscsiadm: sysfs_device_get_parent:
'/devices/platform/host10/session5/iscsi_session'
iscsiadm: sysfs_device_get: open '/devices/platform/host10/session5'
iscsiadm: sysfs_device_get: new uncached device
'/devices/platform/host10/session5'
iscsiadm: sysfs_device_set_values: kernel='session5'
iscsiadm: sysfs_device_set_values: kernel_number='5'
iscsiadm: sysfs_device_get: add to cache
'devpath=/devices/platform/host10/session5', subsystem='', driver=''
iscsiadm: sysfs_device_get_parent: open '/devices/platform/host10/session5'
iscsiadm: sysfs_device_get_parent: '/devices/platform/host10/session5'
iscsiadm: sysfs_device_get: open '/devices/platform/host10'
iscsiadm: sysfs_device_get: new uncached device '/devices/platform/host10'
iscsiadm: sysfs_device_set_values: kernel='host10'
iscsiadm: sysfs_device_set_values: kernel_number='10'
iscsiadm: sysfs_device_get: subsystem link
'/sys/devices/platform/host10/subsystem' points to '../../../bus/scsi'
iscsiadm: sysfs_device_get: add to cache
'devpath=/devices/platform/host10', subsystem='scsi', driver=''
iscsiadm: sysfs_attr_get_value: open '/class/scsi_host/host10'/'proc_name'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/scsi_host/host10/proc_name'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/scsi_host/host10/proc_name'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/scsi_host/host10/proc_name' with attribute value 'iscsi_tcp'
iscsiadm: in read_transports
iscsiadm: Adding new transport be2iscsi
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_transport/be2iscsi'/'handle'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/be2iscsi/handle'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/be2iscsi/handle'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/be2iscsi/handle' with attribute value
'4170378528'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_transport/be2iscsi'/'caps'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/be2iscsi/caps'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/be2iscsi/caps'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/be2iscsi/caps' with attribute value '0x8b9'
iscsiadm: Adding new transport bnx2i
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_transport/bnx2i'/'handle'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/bnx2i/handle'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/bnx2i/handle'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/bnx2i/handle' with attribute value '4170106592'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_transport/bnx2i'/'caps'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/bnx2i/caps'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/bnx2i/caps'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/bnx2i/caps' with attribute value '0x839'
iscsiadm: Adding new transport cxgb3i
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_transport/cxgb3i'/'handle'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/cxgb3i/handle'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/cxgb3i/handle'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/cxgb3i/handle' with attribute value '4169167712'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_transport/cxgb3i'/'caps'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/cxgb3i/caps'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/cxgb3i/caps'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/cxgb3i/caps' with attribute value '0x3039'
iscsiadm: Adding new transport tcp
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_transport/tcp'/'handle'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/tcp/handle'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/tcp/handle'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/tcp/handle' with attribute value '4170172032'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_transport/tcp'/'caps'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/tcp/caps'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/tcp/caps'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/tcp/caps' with attribute value '0x39'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_host/host10'/'hwaddress'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_host/host10/hwaddress'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_host/host10/hwaddress'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_host/host10/hwaddress' with attribute value '(null)'
iscsiadm: could not read hwaddress for host10
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_host/host10'/'ipaddress'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_host/host10/ipaddress'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_host/host10/ipaddress'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_host/host10/ipaddress' with attribute value
'XXX.XXX.XXX.XXX'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_host/host10'/'netdev'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_host/host10/netdev'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_host/host10/netdev'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_host/host10/netdev' with attribute value 'eth1'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session5'/'initiatorname'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session5/initiatorname'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session5/initiatorname'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session5/initiatorname' with attribute value
'iqn.2011-03.de.tuc.stor1:8ba8c821783e'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session5'/'ifacename'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session5/ifacename'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session5/ifacename'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session5/ifacename' with attribute value 'iface'
iscsiadm: found targetname
iqn.2011-03.de.XXXXXXX.in:iscsi-backup.target1.lun1 address
XXX.XXX.100.6 pers address XXX.XXX.100.6 port 3260 pers port 3260 driver
tcp iface name iface ipaddress XXX.XXX.101.5 netdev eth1 hwaddress
iname iqn.2011-03.de.tuc.stor1:8ba8c821783e
iscsiadm: no rec info to match
Rescanning session [sid: 5, target:
iqn.2011-03.de.XXXXXXXX.in:iscsi-backup.target1.lun1, portal:
XXX.XXX.100.6,3260]
iscsiadm: sysfs_device_get: open '/class/iscsi_session/session5'
iscsiadm: sysfs_resolve_link: path link '/class/iscsi_session/session5'
points to '../../devices/platform/host10/session5/iscsi_session/session5'
iscsiadm: sysfs_resolve_link: base '/class/iscsi_session/session5', tail
'devices/platform/host10/session5/iscsi_session/session5', back 2
iscsiadm: sysfs_resolve_link: after moving back ''
iscsiadm: sysfs_device_get: found in cache
'/devices/platform/host10/session5/iscsi_session/session5'
iscsiadm: sysfs_device_get_parent: open
'/devices/platform/host10/session5/iscsi_session/session5'
iscsiadm: sysfs_device_get_parent: open
'/devices/platform/host10/session5/iscsi_session'
iscsiadm: sysfs_device_get_parent: open '/devices/platform/host10/session5'
iscsiadm: scanning host10
iscsiadm: scanning host10 completed
So that is why the iscsiadm/iscsid scanning is not working. We do the
above command to scan the session.
Something in the kernel must have busted. Could you send me the kernel
.config that is used, and I will try to replicate that kernel here?
> Now, when I manally add the target with
> $echo "scsi add-single-device 10 0 0 1" >/proc/scsi/scsi
> dmesg tells me that the target has been added and everything works fine.
>
That goes through a slightly different kernel path. It skips the
transport and some driver model code. So I will look through that code.
> scsi 10:0:0:1: Direct-Access Areca ARC-1680-VOL#001 R001 PQ: 0 ANSI: 5
> sd 10:0:0:1: [sdb] physical block alignment offset: 1850368
> sd 10:0:0:1: [sdb] 3906247680 512-byte logical blocks: (1.99 TB/1.81 TiB)
> sd 10:0:0:1: [sdb] Write Protect is off
> sd 10:0:0:1: Attached scsi generic sg2 type 0
> sd 10:0:0:1: [sdb] Mode Sense: cb 00 00 08
> sd 10:0:0:1: [sdb] Write cache: enabled, read cache: enabled, doesn't
> support DPO or FUA
> sdb: unknown partition table
> sd 10:0:0:1: [sdb] Attached SCSI disk
>
> iscsiadm -m session -R -d 8 now has exactly one more line compared with
> the output at the end:
> ...
> >>>> iscsiadm: rescanning device 10:0:0:1 <<<<
> iscsiadm: scanning host10
> iscsiadm: scanning host10 completed
>
>
>
>
> I also patched iscsid which gave me an notice for newer kernel but this
> has nothing to do with this problem:
> iscsid (1129): /proc/1129/oom_adj is deprecated, please use
> /proc/1129/oom_score_adj instead.
Will fix that. Thanks!
Sure. I've attached it.
>
>
>
>> Now, when I manally add the target with
>> $echo "scsi add-single-device 10 0 0 1" >/proc/scsi/scsi
>> dmesg tells me that the target has been added and everything works fine.
>>
>
> That goes through a slightly different kernel path. It skips the
> transport and some driver model code. So I will look through that code.
>
>
I would be very happy to have this fixed in future. In the meantime I
can live with the workaround ;-) Currently I cannot help very much in
investigating the iscsi code since I've to rescue sereval VMWare
machines from our old (and failed) storages in total of approx 30TB.
Anyway I'll continue in watching this list and (perhaps) help to fix
this issue.
Best,
Joern
> $echo "scsi add-single-device 10 0 0 1" >/proc/scsi/scsi
Weird. I checked the code and bother interfaces call the same function.
If you do
echo - - 1 > /sys/class/scsi_host/host10/scan
does that work? Maybe something with lun0.
Hmm, well currently I cannot manage to get anything working here from
@home ;-) May be it's me, but neither scsi add... nor /sys/class/..
works right now. I'll have a look on it tomorrow morning when I'm
back@work. I'm at host 46 now, which may (but should not) be the
problem, but I cannot reboot this emergency storage yet until all the
data has been moved...
Best,
J�rn
I tested the 2.6.37 kernel with that config and tgt and it worked fine
for me.
Could you send me your tgt targets.conf or your tgt script you use to
add luns?
Hi!
BTW: I had a similar problem with FibreChannel, but without iSCSI on two identical machines (hardware+software (SLES11 SP1)): One host found new LUNs, while the other did not. I could solve my problem by unloading/re-loading the HBA-driver. So maybe open-iscsi is not responsible for that.
[...]
Regards,
Ulrich