Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xakrume/0c5712934c86d448bf354d4cee4309eb to your computer and use it in GitHub Desktop.
Save xakrume/0c5712934c86d448bf354d4cee4309eb to your computer and use it in GitHub Desktop.
setup iscsi share on smartos
#!/bin/bash -x
# based on: http://superuser.com/questions/386506/hosting-iscsi-on-smartos
GROUPNAME=iscsi-1
TARGETNAME=iqn.2010-08.org.illumos:02:$GROUPNAME
LOCAL_ADDRESS=192.168.1.2
svcadm enable stmf
svcadm enable -r svc:/network/iscsi/target:default
sbdadm create-lu /dev/zvol/rdsk/zones/iscsi-1
GUID=$(sbdadm list-lu | tail -n 1 | cut -f1 -d' ')
stmfadm add-view $GUID
itadm create-tpg "$GROUPNAME" $LOCAL_ADDRESS
itadm create-target -t "$GROUPNAME" -n $TARGETNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment