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 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 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