hosting iscsi on smartos

5

3

I am trying to get back into the unix game for some storage projects we have got going. We would love to use joyents smartos (based on illumos) for that.

Working with it is a real joy (setting up vms etc) but i can't get iscsi to work.

I would love to simply share a zfs device as an iscsi connection point but cant get it to work. I also cant get smb or nfs to work, but those properties at least exist and i am sure they would work.

The documentation i can find seems a little all-over-the-place with some old solaris, new solaris, illumos stuff etc. Which is understandable since it is such a new release though.

Does anybody have any pointers ?

I already tried

zfs set shareiscsi=on zones/name

which results in "unknown property". And its not listed in the zfs properties anyway.

I also tried

sbdadm create-lu /dev/zvol/rdsk/zones/

but this results in

sbdadm: unknown error

itadm also is not available and not service containing iscsi is listed in "svcs".

Any help is greatly appreciated.

Update: It seems iscsi is provided by COMSTAR and not in the same way that old solaris did it so the set shareiscsi is not supported because of that.

Update: i found out that the stmf service needs to be started for it (related to COMSTAR). sadly its in maintainance mode (svcs|grep stmf) log in /var/svc/log/system-stmf:default.log says:

svc-stmf: Unable to load the configuration. See /var/adm/messages for details

/var/adm/messages says:

svc:/system/stmf:default: Method "/lib/svc/method/svc-stmf start" failed with exit status 1.
system/stmf:default failed: transitioned to maintenance (see 'svcs -xv' for details)

probably a driver is missing, but which one ? and how do I install it ?

mgoetzke

Posted 2012-02-06T12:24:43.000

Reputation: 191

Answers

4

Creating an ISCSI Target

enable the storage server and iscsi target server if necessary

svcadm enable stmf
svcadm enable -r svc:/network/iscsi/target:default

create a volume if necessary (sparse 10T in example)

zfs create -V 10T -s zones/iscsi

create a logical unit

sbdadm create-lu /dev/zvol/rdsk/zones/iscsi

Add a view on it (GUID is output by previous command or list-lu)

stmfadm add-view GUID

Create a target group to connect to (Choose a GROUPNAME and a TARGETNAME and use an IP from the current server) An Example TARGETNAME could be: iqn.2010-08.org.illumos:02:iscsi-100T where the iscsi-100T part can be whatever you like. I think creating the target group is not essential, though it might be sensible.

itadm create-tpg GROUPNAME IP

Create a target in this group

itadm create-target -t GROUPNAME  -n TARGETNAME

BTW: If you dont set a TARGETNAME a unique identifier will be generated. But this happens everytime on boot on smartos and thus clients wont be able to reconnect automatically.

mgoetzke

Posted 2012-02-06T12:24:43.000

Reputation: 191

@mgoetzke thanks, how could one trace back down to backing storage from iSCSI target name in that set-up? – poige – 2017-01-27T11:00:28.977

@poige not sure I can follow. What exactly is it you need ? – mgoetzke – 2017-02-01T14:20:07.047

you have some TARGETNAME (iqn.2010-08.org.illumos:02:iscsi-100T) — how do you find its backing store (zones/iscsi)? – poige – 2017-02-01T18:46:56.220

@poige I don't know right now, but I am sure the command line tools I used above also have options to backtrack the configured state. You might have to look into them – mgoetzke – 2017-02-16T08:19:53.537

Useless reply; surely I did. I assume you didn't though. :-> – poige – 2017-02-16T09:01:18.463

@poige well you didn't write that and sometimes people don't look, I did not want to offend just say that is where I would start. If you didn't find it there maybe ask in the smartos-discuss group unless you did that too. – mgoetzke – 2017-02-17T09:49:49.637

2btw: this will get lost on reboot. in order to persist you should create a script that will execute on startup. – mgoetzke – 2012-03-18T12:15:13.097

1create a script that will execute on startup and place it in /opt/custom/smf along with an smf file that executes the script on startup. – mgoetzke – 2012-03-18T12:25:27.703

it might be possible to use "stmfadm create-lu ..." with option --lu-prop alias=myname in order to create a consistent name instead of creating new names all the time ... that might make it easier for clients to autoreconnect to the iscsi device" – mgoetzke – 2013-01-08T12:33:52.317

Excellent instructions. I followed these on my smartOS machine using 20130725. It appears to be only possible in the global zone. – Matt Connolly – 2014-02-08T04:45:54.147