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]