Solaris iSCSI

From Wiki
Jump to: navigation, search

Create iSCSI target

svcadm enable iscsitgt
zfs create -V 2g primary/xen_target
zfs set shareiscsi=on primary/xen_target

Restrict IPs that initiators can use:

iscsitadm create tpgt 1
iscsitadm modify tpgt --ip-address 72.52.244.220 1
iscsitadm modify target --tpgt 1 primary/xen

Create a local initiator name. The iqn can be found in /etc/iscsi/initiatorname.isci on linux hosts.

iscsitadm create initiator --iqn iqn.1993-08.org.debian:01:865944837ee3 pantokrator

Set user name and password for the initiator.

iscsitadm modify initiator --chap-name <name> <local_initiator>
iscsitadm modify initiator --chap-secret <local_initiator>

You will be prompted for the secret (password).

View targets:

iscsitadm list target

Mount iSCSI target

Set up authentication info:

iscsiadm modify initiator-node --CHAP-secret
iscsiadm modify initiator-node --CHAP-name <user_name>
iscsiadm modify initiator-node --authentication CHAP
svcadm enable iscsi_initiator
iscsiadm add discovery-address x.x.x.x
iscsiadm modify discovery --sendtargets enable
iscsiadm list target -S

List drives:

format < /dev/null

Links

http://docs.oracle.com/cd/E19253-01/817-5093/fmvcd/index.html

http://www.enterprisenetworkingplanet.com/linux_unix/article.php/3794816/Share-iSCSI-Volumes-With-Linux-Clients-via-ZFS.htm