https://bugzilla.redhat.com/show_bug.cgi?id=1100000
--- Comment #8 from James Slagle jslagle@redhat.com --- I'm using a privileged container running sshd as the process (so that I can login with a couple of different shells),
I had to add this to my Dockerfile for the container, otherwise iscsid won't start: VOLUME ["/var/lock/iscsi"]
i start the conatiner with: docker run --privileged -ti --name initiator -p 8022:22 -d iscsi-initiator
then ssh in, and i start iscsid: iscsid -d 8 -f that appears to start fine
then ssh in another session, and i can discover the target (target is actually on the container host): [root@bcf697cb8673 ~]# iscsiadm -m discovery -t st -p 192.168.122.1 192.168.122.1:3260,1 iqn.2013-07.com.example.storage.ssd1
but when i try to login to the target, iscsid exits (or crashes, hard to tell): [root@bcf697cb8673 ~]# iscsiadm -m node --targetname iqn.2013-07.com.example.storage.ssd1 --portal 192.168.122.1 --login Logging in to [iface: default, target: iqn.2013-07.com.example.storage.ssd1, portal: 192.168.122.1,3260] (multiple) iscsiadm: got read error (0/0), daemon died? iscsiadm: Could not login to [iface: default, target: iqn.2013-07.com.example.storage.ssd1, portal: 192.168.122.1,3260]. iscsiadm: initiator reported error (18 - could not communicate to iscsid) iscsiadm: Could not log into all portals
from the ssh session where iscsid is running i see: iscsid: mgmt_ipc_write_rsp: rsp to fd 5 iscsid: poll result 1 iscsid: mgmt_ipc_write_rsp: rsp to fd 5 iscsid: poll result 1 iscsid: in read_transports iscsid: Adding new transport tcp iscsid: Matched transport tcp
iscsid: sysfs_attr_get_value: open '/class/iscsi_transport/tcp'/'handle'
iscsid: sysfs_attr_get_value: new uncached attribute '/sys/class/iscsi_transport/tcp/handle'
iscsid: sysfs_attr_get_value: add to cache '/sys/class/iscsi_transport/tcp/handle'
iscsid: sysfs_attr_get_value: cache '/sys/class/iscsi_transport/tcp/handle' with attribute value '18446744072107593760'
iscsid: sysfs_attr_get_value: open '/class/iscsi_transport/tcp'/'caps'
iscsid: sysfs_attr_get_value: new uncached attribute '/sys/class/iscsi_transport/tcp/caps'
iscsid: sysfs_attr_get_value: add to cache '/sys/class/iscsi_transport/tcp/caps'
iscsid: sysfs_attr_get_value: cache '/sys/class/iscsi_transport/tcp/caps' with attribute value '0x39'
iscsid: Allocted session 0x7f38ceb4f9b0 iscsid: no authentication configured... iscsid: resolved 192.168.122.1 to 192.168.122.1 iscsid: setting iface default, dev , set ip , hw , transport tcp.
iscsid: get ev context 0x7f38ceb5c470 iscsid: set TCP recv window size to 524288, actually got 425984 iscsid: set TCP send window size to 524288, actually got 425984 iscsid: connecting to 192.168.122.1:3260 iscsid: sched conn context 0x7f38ceb5c470 event 2, tmo 0 iscsid: thread 0x7f38ceb5c470 schedule: delay 0 state 3 iscsid: Setting login timer 0x7f38ceb578e0 timeout 15 iscsid: thread 0x7f38ceb578e0 schedule: delay 60 state 3 iscsid: exec thread 7f38ceb5c470 callback iscsid: put ev context 0x7f38ceb5c470 iscsid: connected local port 37259 to 192.168.122.1:3260 iscsid: in kcreate_session iscsid: in __kipc_call iscsid: in kwritev iscsid: sendmsg: bug? ctrl_fd 4
Maybe the lines with sysfs_attr_get_value are indicative of something that's needed from /sys still?
These exact same discovery and login commands work fine running from a libvirt vm connecting to the same target.
On my container host, i do have the correct iscsi kernel modules, and I also see these in the container: on the host: [root@teletran-1 docker]# lsmod | grep iscsi iscsi_tcp 18333 0 libiscsi_tcp 24176 1 iscsi_tcp libiscsi 54750 2 libiscsi_tcp,iscsi_tcp scsi_transport_iscsi 97405 4 iscsi_tcp,libiscsi
on the container: [root@bcf697cb8673 ~]# lsmod | grep iscsi iscsi_tcp 18333 0 libiscsi_tcp 24176 1 iscsi_tcp libiscsi 54750 2 libiscsi_tcp,iscsi_tcp scsi_transport_iscsi 97405 4 iscsi_tcp,libiscsi
i'll attach an strace of the iscsid process that's exiting, if that helps. i can also attach an strace of an iscsid process that shows it working from a libvirt VM, if you think that would be helpful to compare.