Re: PATCH: open-iscsi: add userspace iscsi library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel P. Berrange wrote:
On Fri, Jan 16, 2009 at 12:50:06PM -0600, Mike Christie wrote:
Daniel P. Berrange wrote:
On Fri, Jan 16, 2009 at 12:17:19PM -0600, Mike Christie wrote:
Hans de Goede wrote:
- No API for enumerating the LUNs in a target once you're logged in ?
open-iscsi / iscsiadm does not do this, it merely creates a virtual scsi adapter and then the generic kernel scsi code does this (AFAIK).

I think you guys are talking about different things. open-iscsi/iscsiadm just does the iscsi parts and so it asks the scsi layer to find and setup/destroy luns. However, I think Daniel just wanted a way to see the mapping of a iscsi session to its target and luns (so the session to host/target/lun mappings see when you do iscsiadm -m session -P 3).
What we curretly do to find LUNs is

- Read all entries in /sys/class/iscsi_session/session$SID/device
  until we find the one matching the targetXXXX we want

- Read all entries in /sys/class/iscsi_session/session$SID/device/$TARGET/
  and if it matches pattern A.B.C.D its a LUN.

    Now read /sys/bus/scsi/devices/A.B.C.D/type and see if
    if this LUN corresponds to an actual device (with someo
    initiators there's a LUN which doesn't have corresponding
    /dev/sdXX device node)
You mean for tape devices or disks? All disks should have a /dev/sdXXX.

I honestly don't know - all I know is that if you setup a Linux based
iSCSI target, add 3 LUNs to it, and then login on the client, you get
4 LUNs, but only 3 devices - the first reported LUN never appears to
have any device associated with it, and certainly wasn't configured by
when setting up the sever.

Example, on the server run

  # /etc/init.d/tgtd start
  Starting SCSI target daemon:                               [  OK  ]
  # tgtadm --op new --mode target --tid=1  --targetname=demo1


Ah yeah, with tgtd you get the magic lun0.

This and something like this is common on iscsi and FC targets. It can actually happen on any SCSI type of target FC, iscsi, SAS, SRP, etc, so you are going to need to handle this generically on any transport.

Also for any scsi (scsi again includes iscsi, fc, sas, etc) tape devices (any non disk) you will not get a /dev/sdX. For tape you will get a /dev/st, but there will not be a /sys/block/sdX entry for it. Also there other types of scsi devices you will not get a /dev/sdX or /sys/block/sdX for.


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux