open-iscsi / target-isns

Target-isns is an iSNS client for the Linux LIO iSCSI target
GNU General Public License v2.0
16 stars 19 forks source link

Make configfs-iscsi-path configurable #35

Closed kyle-fortin closed 6 years ago

kyle-fortin commented 6 years ago

Provide an alternate configfs-iscsi-path for testing varied configs.

Add the configfs_iscsi_path field to target-isns.conf as well as the new command line options -s and --configfs-iscsi-path.

Signed-off-by: Kyle Fortin kyle.fortin@oracle.com

cvubrugier commented 6 years ago

Thanks @kyle-fortin! We may document the --configfs-iscsi-path option in the manual page (target-isns.8) as well. I will do that later.

Just curious; do you use the alternate configfs path option to point to a copy of a real configfs path to mimic a large iSCSI configuration?

kyle-fortin commented 6 years ago

Hi @cvubrugier, Oops, forgot about the man page change. I can do that.

Yes, I created several different fakesys hierarchies to test with, one is a 'smaller' one with 6 targets using 72 tpg's each that crosses the original target-isns buffer 4K size and led to SEGV.

I use isnsd running on the same host in a different terminal: # /usr/sbin/isnsd -f -d all

# target-isns -i 127.0.0.1 -d -f -s /root/fake/fakesys_good2/kernel/config/target/iscsi 0.000000 I: target-isns version 0.6.3 started 0.000025 I: iSNS server is 127.0.0.1:3205 0.002026 D: iSNS connection opened (fd = 7) 0.002333 D: registering target (all) 0.002348 D: source attribute set to iqn.2017-12.com.oracle.server:disk1 0.002385 D: gen header DevAttrReg: len = 6560, flags = 0x8c00, tx = 1, seq = 0 0.002393 D: sending last PDU seq 0, length 6560 0.057203 D: got header DevAttrRegRsp: len = 6532, flags = 0x4c00, tx = 1, seq = 0 0.057242 D: registration period is now 600 seconds 0.057256 D: iqn.2017-12.com.oracle.server:disk1 is a target 0.057260 D: iqn.2017-12.com.oracle.server:disk2 is a target 0.057267 D: iqn.2017-12.com.oracle.server:disk3 is a target 0.057274 D: iqn.2017-12.com.oracle.server:disk4 is a target 0.057278 D: iqn.2017-12.com.oracle.server:disk5 is a target 0.057281 D: iqn.2017-12.com.oracle.server:disk6 is a target ^C 6.530442 D: deregistering target (all) 6.530468 D: gen header DevDereg: len = 72, flags = 0x8c00, tx = 2, seq = 0 7.534746 I: target-isns stopped

Only a subset of the real sysfs tree files are needed in the faked scenario. Below is an example of a single disk target tpg. After building one, I simply 'cp -a' the hierarchy to add others or script it in a loop.

/root/fake/fakesys_good2/kernel/config/target/iscsi/iqn.2017-12.com.oracle.server:disk6/tpgt_19 /root/fake/fakesys_good2/kernel/config/target/iscsi/iqn.2017-12.com.oracle.server:disk6/tpgt_19/np /root/fake/fakesys_good2/kernel/config/target/iscsi/iqn.2017-12.com.oracle.server:disk6/tpgt_19/np/0.0.0.0:3260 /root/fake/fakesys_good2/kernel/config/target/iscsi/iqn.2017-12.com.oracle.server:disk6/tpgt_19/enable

Only the enable file has content, which is a '1'.

I have larger configs (>8K PDU or multi-PDU) but they also requires isnsd changes I am working on separately. With the standard isnsd the larger configs will just get dropped or ignored at isnsd.