Setting up COMSTAR and iSCSI target
COMSTAR is a framework designed to turn an OpenSolaris or Nexenta host into an iSCSI target.
1. Enabling COMSTAR service
Check if the service is running:
svcs | grep iscs
To enable it, run:
svcadm enable -s stmf svcadm enable -s iscsi/target
2. Create ZPOOL
zpool create tank raidz ... ... ...
3. Create ZFS volumes
This command creates a 500MB volume called "zvol1" on pool "tank".
zfs create -V 500m tank/zvol1
4. Creating a logical unit
sbdadm create-lu /dev/zvol/rdsk/tank/zvol1
To get a list of all GUID, run
sbdadm list-lu
Found 1 LU(s)
GUID DATA SIZE SOURCE
-------------------------------- ------------------- ----------------
600144f0bb8dc70000004bb607cb0001 524288000 /dev/zvol/rdsk/tank/zvol1
or use the command
stmfadm list-lu -v
LU Name: 600144F0BB8DC70000004BB607CB0001
Operational Status: Online
Provider Name : sbd
Alias : /dev/zvol/rdsk/tank/zvol1
View Entry Count : 1
Data File : /dev/zvol/rdsk/tank/zvol1
Meta File : not set
Size : 524288000
Block Size : 512
Management URL : not set
Vendor ID : NEXENTA
Product ID : COMSTAR
Serial Num : not set
Write Protect : Disabled
Writeback Cache : Enabled
Access State : Active
5. Create a iSCSI target
stmfadm add-view 600144f0bb8dc70000004bb607cb0001 itadm create-target
6. List iSCSI targets
To list existing targets, run
itadm list-target TARGET NAME STATE SESSIONS iqn.1986-03.com.sun:02:12ae2d06-0422-ccb2-b6a1-ba9b68010df6 online 0 iqn.1986-03.com.sun:02:a866ca6d-42d5-6c5f-e404-da279962f62e online 0
7. Web-UI
If you do not like to manage iSCSI/Comstar via CLI, you could also use napp-it web-UI and set Comstar and FCOE Settings via your Browser. Napp-it supports Logical Units, Targets with Authentication, Views, Target Groups, Target Portal Groups, Host-Groups, Initiators and FCOE with online help and explanation.