Hi All,

working on this issue, I noticed that using iscsiadm modify discovery
-t/-s disable not all LUNs which *could* be offlined (because not
being in use) are in fact offlined.

iscsi_sess_destroy calls iscsi_lun_destroy for all LUNs in the LUN
list until it returns an error. When using the iscsiadm modify
discovery -s/-t disable method to intentionally offline LUNs (by
keeping the needed ones open), even this method may not work,
depending on whether the luns to offline are first in the list or not.

I am attaching a patch for nws-src-20080527 which fixes this
issue. IMHO, this is not really a bug by its own right, but as long as
we dont have a proper method to configure/unconfigure LUNs, with the
patch there is now a way to achieve almost the same goal:

* unmap LUNs you want to change or delete

* use iscsiadm modify discovery t/-s disable to remove all LUNs which
  are not currently in use

* use devfsadm to (re-)enable all LUNs which still exist.

Avoiding the modify discovery -s/t *enable* also *seems* to avoid the SCSI 
timeout issue
(which apparently is indirectly caused by a temporary "hang" of scsi I/O), but 
I could
not verify this because the system I have observed the behaviour on is a) a 
customer
production system and b) S10, so I would not dare to try snv_90 binaries there.

In other words: One could implement a "nicer" solution with devfsadm -Cv, but 
for
the time being, I would consider this issue fixed. I'll open a CR.

Here's a little demo:

=== SETUP ===

* LUNs on NatApp filer (shortened lun show -v output):

        /vol/luns/slink1             128m (134217728)     (r/w, online, mapped)
                Maps: slink=1
        /vol/luns/slink2             128m (134217728)     (r/w, online, mapped)
                Maps: slink=2
        /vol/luns/slink2a            256m (268435456)     (r/w, online, mapped)
                Maps: slink=3

* Initil cfgadm :

Jun 21 16:21:06 haggis iscsi: [ID 559844 kern.info] NOTICE: iscsi session(5) 
iqn.1992-08.com.netapp:sn.135019344 online
Jun 21 16:21:07 haggis scsi: [ID 799468 kern.notice] sd5 at iscsi0: name 
0000iqn.1992-08.com.netapp%3Asn.13501934407D0,1, bus address 
0000iqn.1992-08.com.netapp%3Asn.13501934407D0,1
Jun 21 16:21:07 haggis genunix: [ID 936769 kern.notice] sd5 is /iscsi/[EMAIL 
PROTECTED],1
Jun 21 16:21:07 haggis genunix: [ID 408114 kern.notice] /iscsi/[EMAIL 
PROTECTED],1 (sd5) online
Jun 21 16:21:07 haggis scsi: [ID 799468 kern.notice] sd6 at iscsi0: name 
0000iqn.1992-08.com.netapp%3Asn.13501934407D0,2, bus address 
0000iqn.1992-08.com.netapp%3Asn.13501934407D0,2
Jun 21 16:21:07 haggis genunix: [ID 936769 kern.notice] sd6 is /iscsi/[EMAIL 
PROTECTED],2
Jun 21 16:21:07 haggis genunix: [ID 408114 kern.notice] /iscsi/[EMAIL 
PROTECTED],2 (sd6) online
Jun 21 16:21:07 haggis scsi: [ID 799468 kern.notice] sd9 at iscsi0: name 
0000iqn.1992-08.com.netapp%3Asn.13501934407D0,3, bus address 
0000iqn.1992-08.com.netapp%3Asn.13501934407D0,3
Jun 21 16:21:07 haggis genunix: [ID 936769 kern.notice] sd9 is /iscsi/[EMAIL 
PROTECTED],3
Jun 21 16:21:08 haggis genunix: [ID 408114 kern.notice] /iscsi/[EMAIL 
PROTECTED],3 (sd9) online

=== Original behaviour nws-src-20080527 code ===

* Check the LUN list (mdb, shortened for clarity. Note: I've set symbold 
sd9/sd6/sd5 for the dev_info_ts)

> *iscsi_state::softstate 0|::print iscsi_hba_t hba_sess_list|::print struct 
> iscsi_sess sess_lun_list|::print struct iscsi_lun
{
    lun_state = 0x1
    lun_next = 0xffffff0154674380
    lun_dip = sd9
    lun_num = 0x3
    lun_addr = 0xffffff0154687740 
"0000iqn.1992-08.com.netapp:sn.13501934407D0,3"
}
> 0xffffff0154674380::print struct iscsi_lun
{
    lun_state = 0x1
    lun_next = 0xffffff015b0370e8
    lun_dip = sd6
    lun_num = 0x2
    lun_addr = 0xffffff015aec3690 
"0000iqn.1992-08.com.netapp:sn.13501934407D0,2"
}
> 0xffffff015b0370e8::print struct iscsi_lun
{
    lun_state = 0x1
    lun_next = 0
    lun_dip = sd5
    lun_num = 0x1
    lun_addr = 0xffffff015aec3578 
"0000iqn.1992-08.com.netapp:sn.13501934407D0,1"
}

AVAILABLE DISK SELECTIONS:
       0. c1t5d0 <DEFAULT cyl 126 alt 2 hd 64 sec 32>
          /iscsi/[EMAIL PROTECTED],1
       1. c1t6d0 <DEFAULT cyl 126 alt 2 hd 64 sec 32>
          /iscsi/[EMAIL PROTECTED],2
       2. c1t9d0 <DEFAULT cyl 254 alt 2 hd 64 sec 32>
          /iscsi/[EMAIL PROTECTED],3

* Mount the first LUN in the list (= open)

haggis:/kernel/drv/amd64# mount -F ufs /dev/dsk/c1t9d0s0 /mnt

Now unmap luns 2 and 1 (last in the list):

moonglow-phys1> lun unmap /vol/luns/slink1 slink 
Sat Jun 21 17:58:11 CEST [moonglow-phys1: lun.map.unmap:info]: LUN 
/vol/luns/slink1 unmapped from initiator group slink
moonglow-phys1> lun unmap /vol/luns/slink2 slink
Sat Jun 21 17:58:14 CEST [moonglow-phys1: lun.map.unmap:info]: LUN 
/vol/luns/slink2 unmapped from initiator group slink

=> Not accessible:

VAILABLE DISK SELECTIONS:
       0. c1t5d0 <drive type unknown>
          /iscsi/[EMAIL PROTECTED],1
       1. c1t6d0 <drive type unknown>
          /iscsi/[EMAIL PROTECTED],2
       2. c1t9d0 <DEFAULT cyl 253 alt 2 hd 64 sec 32>
          /iscsi/[EMAIL PROTECTED],3

* Try to inconfigure

haggis:/kernel/drv/amd64# sync ; iscsiadm modify discovery -s disable
iscsiadm: Logical unit in use
iscsiadm: Unable to complete operation

aggis:/kernel/drv/amd64# format
Searching for disks...done

=> LUNs not removed

AVAILABLE DISK SELECTIONS:
       0. c1t5d0 <drive type unknown>
          /iscsi/[EMAIL PROTECTED],1
       1. c1t6d0 <drive type unknown>
          /iscsi/[EMAIL PROTECTED],2
       2. c1t9d0 <DEFAULT cyl 253 alt 2 hd 64 sec 32>
          /iscsi/[EMAIL PROTECTED],3
       3. c5t0d0 <DEFAULT cyl 9369 alt 2 hd 255 sec 63>
          /[EMAIL PROTECTED],0/pci103c,[EMAIL PROTECTED],2/[EMAIL PROTECTED],0
Specify disk (enter its number): ^D

=== With patch ===

(skipped the demonstration that all luns are available)

moonglow-phys1> lun unmap /vol/luns/slink1 slink
Sat Jun 21 18:12:47 CEST [moonglow-phys1: lun.map.unmap:info]: LUN 
/vol/luns/slink1 unmapped from initiator group slink
moonglow-phys1> lun unmap /vol/luns/slink2 slink
Sat Jun 21 18:12:51 CEST [moonglow-phys1: lun.map.unmap:info]: LUN 
/vol/luns/slink2 unmapped from initiator group slink

haggis:~# iscsiadm modify discovery -s disable
iscsiadm: Logical unit in use
iscsiadm: Unable to complete operation
haggis:~# Jun 21 18:10:36 haggis genunix: [ID 408114 kern.notice] /iscsi/[EMAIL 
PROTECTED],2 (sd6) offline
Jun 21 18:10:36 haggis genunix: [ID 408114 kern.notice] /iscsi/[EMAIL 
PROTECTED],1 (sd5) offline
Jun 21 18:10:36 haggis iscsi: [ID 213721 kern.notice] NOTICE: iscsi session(8) 
- session logout failed (1)

format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t9d0 <DEFAULT cyl 253 alt 2 hd 64 sec 32>
          /iscsi/[EMAIL PROTECTED],3
       1. c5t0d0 <DEFAULT cyl 9369 alt 2 hd 255 sec 63>
          /[EMAIL PROTECTED],0/pci103c,[EMAIL PROTECTED],2/[EMAIL PROTECTED],0

=> Yupp. Luns are gone except for lun 3, which is still open /mounted

* Map them again

moonglow-phys1> lun map /vol/luns/slink1 slink 1
moonglow-phys1> lun map /vol/luns/slink2 slink 2

# devfsadm

Jun 21 18:13:05 haggis scsi: [ID 799468 kern.notice] sd5 at iscsi0: name 
0000iqn.1992-08.com.netapp%3Asn.13501934407D0,1, bus address 
0000iqn.1992-08.com.netapp%3Asn.13501934407D0,1
Jun 21 18:13:05 haggis genunix: [ID 936769 kern.notice] sd5 is /iscsi/[EMAIL 
PROTECTED],1
Jun 21 18:13:06 haggis genunix: [ID 408114 kern.notice] /iscsi/[EMAIL 
PROTECTED],1 (sd5) online
Jun 21 18:13:06 haggis scsi: [ID 799468 kern.notice] sd6 at iscsi0: name 
0000iqn.1992-08.com.netapp%3Asn.13501934407D0,2, bus address 
0000iqn.1992-08.com.netapp%3Asn.13501934407D0,2
Jun 21 18:13:06 haggis genunix: [ID 936769 kern.notice] sd6 is /iscsi/[EMAIL 
PROTECTED],2
Jun 21 18:13:06 haggis genunix: [ID 408114 kern.notice] /iscsi/[EMAIL 
PROTECTED],2 (sd6) online

=> Yupp. All back again ;-)
 
 
This message posted from opensolaris.org
_______________________________________________
storage-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/storage-discuss

Reply via email to