TrueNAS v12 as iSCSI Initiator

mikhail

Cadet
Joined
Apr 11, 2022
Messages
3
Hi all!

Trying to solve problem with mounting remote volume over iSCSI on the TrueNAS. I was able to attach the session, but /dev/da* device does not appear.
Code:
root@truenas[~]# iscsictl -Lv
Session ID:               2
Initiator name:           iqn.1994-09.org.freebsd:truenas
Initiator portal:
Initiator alias:
Target name:              iqn.1992-08.com.netapp:sn.6a50eb14b80021fcefdf1bce95dc15d3:vs.4
Target portal:            10.128.12.15
Target alias:             Test1-Mixed
User:
Secret:
Mutual user:
Mutual secret:
Session type:             Normal
Enable:                   Yes
Session state:            Connected
Failure reason:
Header digest:            None
Data digest:              None
MaxRecvDataSegmentLength: 262144
MaxSendDataSegmentLength: 65536
MaxBurstLen:              1048576
FirstBurstLen:            65536
ImmediateData:            Yes
iSER (RDMA):              No
Offload driver:           None
Device nodes:


Code:
root@truenas[~]# uname -a
FreeBSD truenas 12.2-RELEASE-p12 FreeBSD 12.2-RELEASE-p12 ec84e0c52a1(HEAD) TRUENAS  amd64


Any ideas?
Thanks in advance!

--
Mikhail
 

mikhail

Cadet
Joined
Apr 11, 2022
Messages
3
My bad. That problem was not caused by the system, but by the target itself. After setting everything as required on the target side, device got created.

Thanks for everyone who thought on helping here :smile:
 

hliverance

Cadet
Joined
Apr 12, 2022
Messages
1
Mikhail, thanks for this. Do you have a step-by-step on how to use TrueNAS-Core 12 as an iSCSI initiator? I don't find any instructions on this, and what you've posted above is not 100% clear. I am running TrueNAS as a Virtual Machine in a VMware environment. I have a storage array that is already set up as iSCSI, and I want to use TrueNAS to host ands manage shared volumes for users on the network, using the iSCSI storage array.
 

mikhail

Cadet
Joined
Apr 11, 2022
Messages
3
Yeah. Not too much of information in previous messages. Let me fix this. :smile:

Problem I'm solving:
This setup is a test for possible solution to migrate TrueNAS to AWS with FSx (ONTAP) as a datastore.
So please note, that this is not a production ready or suggested in any way setup. Use on your own risk.

Notes on AWS:
- If you'll ever need to run it on AWS, keep in mind, that out of 3 available TrueNAS AMIs, only one is working: ami-0b29297d20ee25b3a
Two others can't find the network adapter during initial boot and then stuck on the configuration menu which you cannot ever access.
- I'm using instance type - t2.xlarge - as remember seen this suggestion in one of the documents. AWS thinks that instance is underprovisioned and shows spikes of CPU reaching 100% load. Suggests to change to t4g.xlarge, which is much cheaper in addition. But I didn't try to change type yet.

TrueNAS configuration as an iSCSI initiator:

On TrueNAS side, you have to modify/create following files:

/conf/base/etc/iscsi.conf
Code:
t0 {
  TargetAddress = 10.128.12.15
  TargetName = iqn.1992-08.com.netapp:sn.6a50eb14b80021fcefdf1bce95dc15d3:vs.4
}

Of course, you have to put your values here.
When created, you have to chmod 600 this file!

/conf/base/etc/rc.conf
add following lines at the end of the file
Code:
iscsid_enable="YES"
iscsictl_enable="YES"
iscsictl_flags="-Aa"


/conf/base/etc/ix.rc.d/ix-zfs
find line with following content
Code:
# REQUIRE: hostid mountcritlocal

and change it to
Code:
# REQUIRE: hostid mountcritlocal iscsictl


That's all. This configuration survives reboots just fine.
After the reboot, you should see da0 disk in Storage menu.

--
Mikhail
 
  • Like
Reactions: TN5
Top