csi-lib-iscsi rescan

16 views
Skip to first unread message

Paul Monday

unread,
Nov 25, 2019, 8:47:47 PM11/25/19
to Kubernetes developer/contributor discussion
I am using csi-lib-iscsi for a new CSI driver with a remote appliance that has multiple LUNs per target

For example, the following session has 7 different LUNs with different assigned numbers
iscsiadm -m session
tcp: [1] 10.80.44.165:3260,2 iqn.1986-03.com.sun:02:ab7b55fa-53ee-e5ab-98e1-fad3cc29ae57 (non-flash)

In my CSI driver when I hit the CreateVolume, I go to the remote appliance and create the new LUN.

On the ControllerPublish, I have to rescan the target (you can see what happens below)

It would be really helpful if I could add something like:

// Rescan sessions rescans all existing sessions for LUNs
func RescanSessions() (string, error) {
debug.Println("Rescan sessions...")
out, err := iscsiCmd("-m", "session", "--rescan")
return out, err
}

I think if I wanted to make it more 'localized' to the session id I would have to uplevel getCurrentSessions as well so I could grab the ID from the session.

As I'm new to the group and the github repo, I would appreciate any thoughts :-)

Still working through the contributor guidelines but this seemed to be the right place to start.

[root@paul ~]# lsscsi -d
[0:0:0:0]    disk    ATA      SAMSUNG MZ7LN512 2L6Q  /dev/sda [8:0]
[1:0:0:0]    disk    ATA      ST1000DM003-1SB1 CC63  /dev/sdb [8:16]
[6:0:0:1]    disk    SUN      ZFS Storage 7330 1.0   /dev/sdc [8:32]
[6:0:0:3]    disk    SUN      ZFS Storage 7330 1.0   /dev/sdd [8:48]
[6:0:0:5]    disk    SUN      ZFS Storage 7330 1.0   /dev/sde [8:64]
[6:0:0:7]    disk    SUN      ZFS Storage 7330 1.0   /dev/sdf [8:80]
[6:0:0:9]    disk    SUN      ZFS Storage 7330 1.0   /dev/sdg [8:96]
[6:0:0:11]   disk    SUN      ZFS Storage 7330 1.0   /dev/sdh [8:112]
[6:0:0:13]   disk    SUN      ZFS Storage 7330 1.0   /dev/sdi [8:128]
[root@paul ~]# iscsiadm -m session --rescan
Rescanning session [sid: 1, target: iqn.1986-03.com.sun:02:ab7b55fa-53ee-e5ab-98e1-fad3cc29ae57, portal: 10.80.44.165,3260]
[root@paul ~]# lsscsi -d
[0:0:0:0]    disk    ATA      SAMSUNG MZ7LN512 2L6Q  /dev/sda [8:0]
[1:0:0:0]    disk    ATA      ST1000DM003-1SB1 CC63  /dev/sdb [8:16]
[6:0:0:1]    disk    SUN      ZFS Storage 7330 1.0   /dev/sdc [8:32]
[6:0:0:3]    disk    SUN      ZFS Storage 7330 1.0   /dev/sdd [8:48]
[6:0:0:5]    disk    SUN      ZFS Storage 7330 1.0   /dev/sde [8:64]
[6:0:0:7]    disk    SUN      ZFS Storage 7330 1.0   /dev/sdf [8:80]
[6:0:0:9]    disk    SUN      ZFS Storage 7330 1.0   /dev/sdg [8:96]
[6:0:0:11]   disk    SUN      ZFS Storage 7330 1.0   /dev/sdh [8:112]
[6:0:0:13]   disk    SUN      ZFS Storage 7330 1.0   /dev/sdi [8:128]
[6:0:0:15]   disk    SUN      ZFS Storage 7330 1.0   /dev/sdj [8:144]
[6:0:0:17]   disk    SUN      ZFS Storage 7330 1.0   /dev/sdk [8:160]


John Griffith

unread,
Nov 27, 2019, 12:12:12 PM11/27/19
to Paul Monday, Kubernetes developer/contributor discussion
--
You received this message because you are subscribed to the Google Groups "Kubernetes developer/contributor discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/dad40072-5b00-4511-8ff2-6738f4674826%40googlegroups.com.

Hey Paul,

Not sure if you've seen this [1], but I think this will fix up your use case of multiple luns and rescans.  Let me know if this doesn't work for you for some reason but based on what you describe this should work I think.


Thanks,
John
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages