iscsi-osx / iSCSIInitiator

iSCSI Initiator for macOS
BSD 2-Clause "Simplified" License
550 stars 97 forks source link

Does this work on OS X 10.12.3 - Sierra? Unable to get any targets... #89

Closed n0nuf2 closed 7 years ago

n0nuf2 commented 7 years ago

iSCSI device is ARECA 5040. Works fine with all Linux and Windows. Need initiator to work on Mac. Turned off SIP and ran csrutil disable. Only thing that seems to work is dynamic discovery via IP, and then nothing. No response/No output.

Debian reports login to iqn.com.sgmsys-10, portal: 192.168.x.x successful.

None of the commands on iscsictl report anything except "... is not a valid IQN or EUI-64 Identifier".

I've installed from: iSCSIInitiator-1.0.0-beta5.dmg that I downloaded yesterday.

All of these commands (replaced with my info work on Debian, yes, a different OS): Install iSCSI Initiator on your system

apt install -y open-iscsi

Find your Initiator IQN

cat /etc/iscsi/initiatorname.iscsi

InitiatorName=iqn.1993-08.org.debian:01:6af387c68d Discover targets on 10.0.0.44 iscsiadm -m discovery -t sendtargets -p 10.0.0.44 10.0.0.44:3260,1 iqn.1992-04.com.emc:cx.apm00240108337.a0 Confirm iSCSI status iscsiadm -m node -o show Login to target iscsiadm -m node --login Logout of target iscsiadm -m node --logout Confirm active session

iscsiadm -m session -o show

Examine available partitions

fdisk -l

So, is this package not complete to establish a connection to iSCSI and then attach and use the storage? Am I missing something? Had bought GlobalSAN, but that was an expensive waste as it continuously failed and now don't run. I've gotta be missing something. I can use this functionality on every other OS. As you know, these are your commands that come up:

Usage: iscsictl add target , [-interface ] iscsictl remove target [,]

   iscsictl login  <target>[,<portal>]
   iscsictl logout <target>[,<portal>]

   iscsictl modify initiator-config [...]
   iscsictl modify target-config <target>[,<portal>] [...]
   iscsictl modify discovery-config [...]

   iscsictl list initiator-config
   iscsictl list target-config <target>
   iscsictl list discovery-config

   iscsictl add discovery-portal <portal> [-interface <interface>]
   iscsictl remove discovery-portal <portal>

   iscsictl list targets
   iscsictl list luns

I have 2 LUNs: iqn.com.sgmsys-10 and iqn.com.sgmsys-11.

Assistance/help appreciated.

V/r, n0nuf

nsinenian commented 7 years ago

Your target names: "iqn.com.sgmsys-10" and "iqn.com.sgmsys-11" are invalid names. iSCSI requires a date corresponding to when the naming authority was registered. For example, your initiator has an IQN: "iqn.1993-08.org.debian:01:6af387c68d" (with a date as shown in bold). The target needs to have the same format. I'm surprised it works with any initiator, as it is a violation of the iSCSI specification.

n0nuf2 commented 7 years ago

I tried the following with the same errors:

iqn.1998-01.com.sgmsys

Windows shows the unit providing the following with only the above configured in Areca: iqn.1998-01.com.sgmsys-10 iqn.1998-01.com.sgmsys-11

and the same shows up in Debian (Jesse) and RHEL 7 with iscsiadm. I do not have, nor receive the hex string after the colon after the target. I'm sure this is just to make the target unique.

The Areca 5040 unit web interface is very vague. It does not show the full names. I have to go to Win or Nix and use discovery to display all the target names from the unit.

I understand the devs are following a standard, but it would be nice to 'loosen' the naming convention for obvious reasons (even if it were a custom setting in a .config). I can use the same 'non-standard' naming conventions on my QNAP iSCSI as well, and the QNAP sees and connects with the Areca over iSCSI when configured to do so without the name issue mentioned.

Any other information or Mac utilities (prefer terminal) would be greatly appreciated.

V/r, n0nuf

n0nuf2 commented 7 years ago

iqn.1998-01.com.sgmsys,192.168.0.1:3260

iscsictl: The specified target name is not a valid IQN or EUI-64 identifier. . .

Any other ideas?

V/r, n0nuf

nsinenian commented 7 years ago

It looks like the ':' is also required at the moment. So this for example should work:

iqn.1998-01.com.sgmsys:target0

Since the colon is optional per RFC3721, we'll remove that from the validation code in the next build. The date has to stay though.

On Wed, Apr 12, 2017 at 8:28 AM, n0nuf2 notifications@github.com wrote:

iqn.1998-01.com.sgmsys,192.168.0.1:3260

iscsictl: The specified target name is not a valid IQN or EUI-64 identifier. . .

Any other ideas?

V/r, n0nuf

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/iscsi-osx/iSCSIInitiator/issues/89#issuecomment-293438180, or mute the thread https://github.com/notifications/unsubscribe-auth/AEH_Qz7btSaSOSFlz0Pu774NGAOHLPdvks5rvBqUgaJpZM4M5lIO .

n0nuf2 commented 7 years ago

######### I have this configured in the ARECA 5040 configuration interface:

Raid Set IDE Channels Volume Set(Ch/Drv#) Volume State Capacity raidset0 Ch01 target0 (1/0) Normal 1000.0GB Ch02 target1 (0&1/9) Normal 2000.0GB Ch03 target2 (0&1/1) Normal 4000.0GB Ch04
Ch05
Ch06
Ch07
Ch08

FYI: target0 is a single disk, target1 is 2-disk RAID1, target2 is 4-disk RAID5.

######### OS X Terminal with iscsictl and nothing shows up with:

iscsictl add discovery-portal 192.168.0.9 iscsictl modify discovery-config -SendTargets enable

######### So I added the following targets; (notice they are all inactive?):

iscsictl list targets iqn.1998-01.com.sgmsys-09:target2 <inactive, static> 192.168.0.9 <inactive, port 3260, interface default> iqn.1998-01.com.sgmsys-09:target0 <inactive, static> 192.168.0.9 <inactive, port 3260, interface default> iqn.1998-01.com.sgmsys-09:target1 <inactive, static> 192.168.0.9 <inactive, port 3260, interface default>

######### Here's a single target config (also inactive):

iscsictl list target-config iqn.1998-01.com.sgmsys-09:target0 iqn.1998-01.com.sgmsys-09:target0 <inactive, static> node-alias: auto-login: disabled persistent: yes Configuration: MaxConnections (1) ErrorRecoveryLevel (0) HeaderDigest (none) DataDigest (none) Authentication: none CHAP-name CHAP-secret 192.168.0.9 <inactive, port 3260, interface default> Raid Set Hierarchy

######### I am unable to log into anything (see below):

iscsictl login iqn.1998-01.com.sgmsys-09:target0,192.168.0.9:3260 iscsictl: An initiator error has occurred iscsictl login iqn.1998-01.com.sgmsys-09:target1,192.168.0.9:3260 iscsictl: An initiator error has occurred iscsictl login iqn.1998-01.com.sgmsys-09:target2,192.168.0.9:3260 iscsictl: An initiator error has occurred

So, with that information, are you able to guide me further? Windows and Nix still see them, mount them, and can use them. Can you help me get these usable in OS X Sierra?

Thank you for your time.

V/r, n0nuf

n0nuf2 commented 7 years ago

Here's a snippet from the system.log:

Apr 10 18:10:09 n0nufs-Mac-mini com.apple.xpc.launchd[1] (com.github.iscsi-osx.iscsid[1542]): Service exited with abnormal code: 35 Apr 10 18:10:09 n0nufs-Mac-mini com.apple.xpc.launchd[1] (com.github.iscsi-osx.iscsid): Service only ran for 0 seconds. Pushing respawn out by 10 seconds. Apr 10 18:10:19 n0nufs-Mac-mini com.apple.xpc.launchd[1] (com.github.iscsi-osx.iscsid[1548]): Service exited with abnormal code: 35 Apr 10 18:10:19 n0nufs-Mac-mini com.apple.xpc.launchd[1] (com.github.iscsi-osx.iscsid): Service only ran for 0 seconds. Pushing respawn out by 10 seconds. Apr 10 20:18:48 n0nufs-Mac-mini com.apple.xpc.launchd[1] (com.github.iscsi-osx.iscsid): This service is defined to be constantly running and is inherently inefficient. Apr 12 19:33:20 localhost com.apple.xpc.launchd[1] (com.github.iscsi-osx.iscsid[90]): Service exited with abnormal code: 35 Apr 12 19:33:20 localhost com.apple.xpc.launchd[1] (com.github.iscsi-osx.iscsid): Service only ran for 1 seconds. Pushing respawn out by 9 seconds. Apr 12 19:54:15 n0nufs-Mac-mini com.apple.xpc.launchd[1] (com.github.iscsi-osx.iscsid): This service is defined to be constantly running and is inherently inefficient.

nsinenian commented 7 years ago

Use Wireshark to capture the traffic between your machine and the NAS when you connect. After you see the "initiator error" stop the capture and post it here.

Are you saying that globalSAN doesn't connect either?

n0nuf2 commented 7 years ago

Hello. I have attached WireShark capture of iSCSI traffic between Mac and Areca 5040 during connect. The targets still say inactive and I am unable to mount any volumes. I have used filter:iSCSI in WS. Are there any additional filters that you would find helpful?

iscsi2.pcapng.zip

iqn.1998-01.com.sgmsys:target1 <inactive, static> 192.168.0.6 <inactive, port 3260, interface default>

iscsictl login iqn.1998-01.com.sgmsys-09:target0,192.168.0.6:3260 The specified target does not exist

iscsictl logout iqn.1998-01.com.sgmsys-09:target0,192.168.0.6:3260 The specified target has no active session

. . .

Commands used are:

iscsictl add discovery-portal 192.168.0.6 iscsictl modify discovery-config -SendTargets enable iscsictl list discovery-config

iscsictl add target iqn.1998-01.com.sgmsys-09:target0,192.168.0.6:3260 iscsictl add target iqn.1998-01.com.sgmsys-09:target1,192.168.0.6:3260 iscsictl add target iqn.1998-01.com.sgmsys-09:target2,192.168.0.6: iscsictl list targets

iscsictl login iqn.1998-01.com.sgmsys-09:target0,192.168.0.6:3260 iscsictl login iqn.1998-01.com.sgmsys-09:target1,192.168.0.6:3260 iscsictl login iqn.1998-01.com.sgmsys-09:target2,192.168.0.6:3260

iscsictl logout iqn.1998-01.com.sgmsys-09:target0,192.168.0.6:3260 iscsictl logout iqn.1998-01.com.sgmsys-09:target1,192.168.0.6:3260 iscsictl logout iqn.1998-01.com.sgmsys-09:target2,192.168.0.6:3260

iscsictl remove target iqn.1998-01.com.sgmsys-09:target0,192.168.0.6:3260 iscsictl remove target iqn.1998-01.com.sgmsys-09:target1,192.168.0.6:3260 iscsictl remove target iqn.1998-01.com.sgmsys-09:target2,192.168.0.6:3260

iscsictl modify discovery-config -SendTargets disable iscsictl remove discovery-portal 192.168.0.6

Does this further assist your in determining what is going on?

Information appreciated, Thank you.

V/r, n0nuf

nsinenian commented 7 years ago

Try the attached build and let me know if that works out (change .ZIP extension to .DMG and install as usual) iSCSIInitiator-1.0.0-beta5++.zip

n0nuf2 commented 7 years ago

GE (good evening).

I am downloading now. I will uninstall previous version before installing. I just saw that you asked:

"Are you saying that globalSAN doesn't connect either?"

globalSAN would work for a bit and then crash. Didn't matter which SAN/NAS I attached. Same results. Soon as I start moving large amounts of data it was done. Since going to Sierra, it is just throwing a class error and won't start. I stopped wasting time on it. It was an expensive "sure, that's nice, but now what..." that isn't reliable for me on my system(s). Everything works fine on Windows/Linux/BSD, so I know my hardware is operational.

Will post results. Thank you for your assistance.

V/r, n0nuf

nsinenian commented 7 years ago

I would caution you with the logic of "It works in Windows/Linux/BSD..." so therefore it must not be your target. There are a number of non-compliant targets out there, and quite a few initiators that have "relaxed" their protocol in order to work with all of the stuff out there. For instance, globalSAN has a "always send session" option which technically shouldn't be required by the standard -- some targets are fussy and so globalSAN included that option.

We've already seen one instance - namely target naming - where your target didn't stick to the standard. So please try to keep an open mind as we move forward and we'll fix the actual problem.

nsinenian commented 7 years ago

One more thing -- the Wireshark data you posted -- that data did not show login at all. It only showed discovery activity. Based on that I fixed an issue, which may be occurring during login also.

However, it may still not work. In which case, please post a Wireshark capture that includes login. I would suggest starting the capture, login, then stop capture. Thanks.

n0nuf2 commented 7 years ago

Also, I keep getting a bunch of "Permission Denied" messages as user or as root. Is there a clear or clean command? Only way to get rid of this is to shut SAN and MAC down and then bring them back up.

Last login: Thu Apr 27 22:10:45 on console n0nufs-Mac-mini:~ n0nuf$ n0nufs-Mac-mini:~ n0nuf$ iscsictl add discovery-portal 192.168.0.6 -interface en0 The specified discovery portal already exists n0nufs-Mac-mini:~ n0nuf$ iscsictl modify discovery-config -SendTargets enable iscsictl: Permission denied n0nufs-Mac-mini:~ n0nuf$ iscsictl list discovery-config SendTargets: enabled interval: 30 seconds discovery-portals: 1 192.168.0.6 <port 3260, interface en0> n0nufs-Mac-mini:~ n0nuf$

n0nufs-Mac-mini:~ n0nuf$ iscsictl add target iqn.1998-01.com.sgmsys-09:target0,192.168.0.6:3260 iscsictl: Permission denied n0nufs-Mac-mini:~ n0nuf$ iscsictl add target iqn.1998-01.com.sgmsys-09:target1,192.168.0.6:3260 iscsictl: Permission denied n0nufs-Mac-mini:~ n0nuf$ iscsictl add target iqn.1998-01.com.sgmsys-09:target2,192.168.0.6:3260 iscsictl: Permission denied n0nufs-Mac-mini:~ n0nuf$ iscsictl list targets iqn.1998-01.com.sgmsys-09:0 <inactive, static> 192.168.0.6 <inactive, port 3260, interface default> iqn.1998-01.com.sgmsys-09:target0 <inactive, static> 192.168.0.6 <inactive, port 3260, interface default>

n0nufs-Mac-mini:~ n0nuf$ iscsictl login iqn.1998-01.com.sgmsys-09:target0,192.168.0.6:3260 n0nufs-Mac-mini:~ n0nuf$ iscsictl login iqn.1998-01.com.sgmsys-09:target1,192.168.0.6:3260 The specified target does not exist n0nufs-Mac-mini:~ n0nuf$ iscsictl login iqn.1998-01.com.sgmsys-09:target2,192.168.0.6:3260 The specified target does not exist

WireShark:

Frame 2762: 314 bytes on wire (2512 bits), 314 bytes captured (2512 bits) on interface 0 Ethernet II, Src: ArecaTec_78:0e:a0 (00:1b:4d:78:0e:a0), Dst: Apple_99:06:f9 (10:dd:b1:99:06:f9) Internet Protocol Version 4, Src: 192.168.0.6, Dst: 192.168.0.2 Transmission Control Protocol, Src Port: 3260, Dst Port: 49539, Seq: 265, Ack: 393, Len: 260 iSCSI (Text Response) Opcode: Text Response (0x24) Flags: 0x80 TotalAHSLength: 0x00 DataSegmentLength: 210 (0x000000d2) LUN InitiatorTaskTag: 0x00000000 TargetTransferTag: 0xffffffff StatSN: 0x00000004 ExpCmdSN: 0x00000001 MaxCmdSN: 0x00000001 Key/Value Pairs KeyValue: TargetName=iqn.1998-01.com.sgmsys-08 KeyValue: TargetAddress=192.168.0.6:3260,1 KeyValue: TargetName=iqn.1998-01.com.sgmsys-09 KeyValue: TargetAddress=192.168.0.6:3260,1 KeyValue: TargetName=iqn.1998-01.com.sgmsys-10 KeyValue: TargetAddress=192.168.0.6:3260,1 Padding: 0000

Still nothing to connect to.

V/r, n0nuf

nsinenian commented 7 years ago

Try removing the configuration file and see if the permissions issue goes away.

rm /Library/Preferences/com.github.iscsi-osx.iSCSIInitiator.plist

Also, you don't have to add/remove targets each time. You can either add them manually, or let discovery add them for you. It's described in the Wiki.

n0nuf2 commented 7 years ago

After some fiddling, I was able to get 2 LUNs found and attached. Several issues with that. Got them reformatted and began transferring data to one of them. Then KP. Dump below:

Anonymous UUID: B843F51F-D6B2-B550-571B-EC80E15578E6

Sun Apr 30 23:25:16 2017

Panic Report panic(cpu 0 caller 0xffffff8003e011bd): Kernel trap at 0xffffff7f86eaf82a, type 14=page fault, registers: CR0: 0x000000008001003b, CR2: 0x0000000000000000, CR3: 0x00000000076a5000, CR4: 0x00000000001626e0 RAX: 0x0000000000000000, RBX: 0x0000000000002000, RCX: 0x0000000000002000, RDX: 0x0000000000000001 RSP: 0xffffff81eb583dc0, RBP: 0xffffff81eb583e60, RSI: 0x0000000000000002, RDI: 0x0000000000000000 R8: 0x00000005c5cb4e40, R9: 0x0000000000000000, R10: 0x00000000002d35ff, R11: 0x0000000000000000 R12: 0xffffff80312d5c00, R13: 0x0000000000000000, R14: 0x0000000000000000, R15: 0x0000000000002000 RFL: 0x0000000000010287, RIP: 0xffffff7f86eaf82a, CS: 0x0000000000000008, SS: 0x0000000000000010 Fault CR2: 0x0000000000000000, Error code: 0x0000000000000000, Fault CPU: 0x0, PL: 0, VF: 1

Backtrace (CPU 0), Frame : Return Address 0xffffff81eb583a50 : 0xffffff8003cec3ec 0xffffff81eb583ad0 : 0xffffff8003e011bd 0xffffff81eb583cb0 : 0xffffff8003c9d543 0xffffff81eb583cd0 : 0xffffff7f86eaf82a 0xffffff81eb583e60 : 0xffffff7f86eb0229 0xffffff81eb583eb0 : 0xffffff7f86eaf9ba 0xffffff81eb583f10 : 0xffffff7f86ead76b 0xffffff81eb583f30 : 0xffffff80042bb811 0xffffff81eb583f80 : 0xffffff80042badf6 0xffffff81eb583fb0 : 0xffffff8003c9a8f7 Kernel Extensions in backtrace: com.github.iscsi-osx.iSCSIInitiator(1.0)[BD336C79-FD7C-357F-ADE4-2C102053A203]@0xffffff7f86eab000->0xffffff7f86eb5fff dependency: com.apple.iokit.IOSCSIParallelFamily(3.0.0)[52F1A21B-F265-3D00-8F29-FC5E2B4069BD]@0xffffff7f84520000

BSD process name corresponding to current thread: kernel_task

Mac OS version: 16E195

Kernel version: Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 Kernel UUID: 06F94FD7-451F-34A1-B13C-D68FF7EDE0A0 Kernel slide: 0x0000000003a00000 Kernel text base: 0xffffff8003c00000 __HIB text base: 0xffffff8003b00000 System model name: Macmini6,2 (Mac-F65AE981FFA204ED)

System uptime in nanoseconds: 5087345649782 last loaded kext at 4024401537585: com.apple.driver.AppleXsanScheme 3 (addr 0xffffff7f86ea3000, size 32768) last unloaded kext at 4358687660676: com.apple.filesystems.ntfs 3.13 (addr 0xffffff7f86eb6000, size 380928)

I have a pcap file but it is 35MB zipped. Will have to try to split is or start over to get this to you as github only allows 10MB.

iscsi4_Commands_Log.txt

These are the commands and responses that I was using . Still have a lot of permission denied.

V/r, n0nuf

n0nuf2 commented 7 years ago

GE nsinenian:

I have only captured the login/out packets and have attached that pcap to this post. The commands at the bottom are the commands that I have run to connect to storage. Notice that I did NOT use the :target0 (colon) parameter. I believe you allowed this to be omitted in the code you posted for me to try. Transfer rate on a 1Gbps wire (eth) connection is about 1GB per minute. I did have to install/remove the pkg several times as I was experimenting as well as use launchctl unload -w /Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist to kill the process at one point as it killed Finder. I have also included a screenshot of Areca 5040 RAID config in case it is helpful. I deleted 3 volumes and created a single 8TB RAID5 (7TB usable) volume for this test.

I was able to Partition/Erase the new drive as exFAT 7TB successfully (I don't believe the array understands NIX/MAC partitions). On a 8GB file, I was able to xfer 3.54 GB before the transfer died at 3.54GB. The process is currently locked up and I will have to deal with it again IOT cancel it. Where do we go from here to troubleshoot?

V/r, n0nuf

=== iscsictl add target iqn.1998-01.com.sgmsys-09,192.168.0.6:3260 iscsictl login iqn.1998-01.com.sgmsys-09 iscsictl list targets iscsictl list luns iscsictl logout iqn.1998-01.com.sgmsys-09 iscsictl remove target iqn.1998-01.com.sgmsys-09,192.168.0.6:3260

n0nufs-Mac-mini:~ n0nuf$ iscsictl add target iqn.1998-01.com.sgmsys-09,192.168.0.6:3260 The specified target has been added n0nufs-Mac-mini:~ n0nuf$ iscsictl login iqn.1998-01.com.sgmsys-09 Attached iqn.1998-01.com.sgmsys-09 <scsi domain 1, target 0> Areca target0 R001 Serial Number 0000003286787813 lun 0: type 0x00 (Block device) n0nufs-Mac-mini:~ n0nuf$ iscsictl list targets iqn.1998-01.com.sgmsys-09 <active, static, sid 0, tpgt 1, tsid 0x600> 192.168.0.6 <active, cid 0, port 3260, interface default> n0nufs-Mac-mini:~ n0nuf$ iscsictl list luns iqn.1998-01.com.sgmsys-09 <scsi domain 1, target 0> Areca target0 R001 Serial Number 0000003286787813 lun 0: type 0x00 (Block device) disk4: 7 TB (13671874048 512 byte blocks

pcap4.pcapng.zip screen shot 2017-05-02 at 6 15 39 pm

n0nuf2 commented 7 years ago

BTW. Apologize for formatting. Don't know why plain text is getting set to large/bold.

V/r, n0nuf

n0nuf2 commented 7 years ago

Also, appears the amount of data transferred is random before it dies. This time died at 39MB.

nsinenian commented 7 years ago

Ok, so now your issue seems to be similar to #83 . A handful of people are experiencing this (as far I know) but we have not been able to determine why. I have a suspicion based on the kernel crash logs you posted, so please try the attached build and let me know if you still experience crashes (change extension to DMG and install as before).

iSCSIInitiator-1.0.0-beta5++nosleep.zip

n0nuf2 commented 7 years ago

It appears the new code will successfully connect to multiple iSCSI devices:

iscsictl add target iqn.1998-01.com.sgmsys-09,192.168.0.16:3260 iscsictl login iqn.1998-01.com.sgmsys-09

iscsictl add target iqn.2004-04.com.qnap:ts-870pro:iscsi.qnap.e0c776,192.168.0.6:3260 iscsictl login iqn.2004-04.com.qnap:ts-870pro:iscsi.qnap.e0c776

Even deleting the plist file, I still get 'permission denied' occasionally until I power cycle all the Mac. And, the process of copying files often causes the system to Panic using either device.

Using iscsiadm from Debian Linux 8.5 VM on the Mac, I was able to move 15+ TB to the devices successfully.

What can I do now?

V/r, n0nuf

nsinenian commented 7 years ago

The two problems you cite are known issues. I'm closing this thread -- please follow #87 and #83 for more information on updates. For the system panic, it appears to be in some cases related to sleep --- if you can disable sleep on your machine and re-try the transfer, let us know if the panics stop at #83