iSCSI
Server
Create Volume
zfs create [-ps] [-b blocksize] [-o property=value] … -V size volume
Creates a volume of the given size.
The volume is exported as a block device in /dev/zvol/{dsk,rdsk}/path,
where path is the name of the volume in the ZFS namespace
$ zfs create -ps -b 4096 -V 8192 sdd/template
Create Target
scstadmin -add_target -driver
Add a target to a target driver.
$ scstadmin -add_target tamplate -driver iscsi
Open Disk
scstadmin -open_dev -handler -attributes <p=v,…>
Create a new SCST device using the specified device handler and attributes.
$ scstadmin -open_dev tamplate -handler vdisk_blockio -attributes filename=/dev/zvol/sdd/tamplate
Create Group
scstadmin -add_group -driver -target
Add an initiator group to the specified target.
scstadmin -add_group tamplate -driver iscsi -target tamplate
Create LUN
scstadmin -add_lun -driver -target [-group ]
-device -attributes <p=v,…>
Add a LUN to a target or initiator group.
scstiadmin -add_lun 0 -driver iscsi -target tamplate -group template -device tamplate
Add Init
scstadmin -add_init -driver -target -group
Add an initiator to an initiator group. is either an explicit initiatorname or an initiator name pattern. The wildcard characters ‘*’, ‘?’ and '!'are supported.
scstadmin -add_init **iqn.1991-05.com.microsoft:ftp** -driver iscsi -target tamplate -group template
Enable Target
scstadmin -enable_target -driver
Enable a target.
scstadmin -enable_target template -driver iscsi
Set Enable
-set_drv_attr -attributes <p=v,…>
Set the value of one or more target driver attributes.
-noprompt
Do not prompt for confirmation before modifying the SCST state.
scstadmin -set_drv_attr template -driver iscsi -attributes enabled=1 -noprompt
Save Config
scstadmin -write_config
Save the current configuration to the specified file.
scstadmin -write_config /etc/scst.conf
Client-Windows
Start Service
sc config MSiSCSI start= auto
net start MSiSCSI
Add Target Portal
iscsicli AddTarget
iscsicli AddTargetPortal 192.168.2.120 3260
Login target
iscsicli QLoginTarget template