How to setup Fibre Channel targets on OmniOS

Setup COMSTAR packages

Install the storage server package.

pkg install storage-server

View the state

svcs stmf

Enable the stmf service

svcadm enable stmf

Check stmf status

svcs stmf


Configure the QLogic Fibre Channel adapters for target mode

The qlc driver is for initiator mode.
The qlt driver is for target mode.

Display FC port bindings

mdb -k

::devbindings -q qlc


Change to target mode

update_drv -d -i ‘pciex1077,2432’ qlc

Note. The following error is normal:

Cannot unload module: qlc

Will be unloaded upon reboot.

update_drv -a -i ‘pciex1077,2432’ qlt

Note. The following error is normal:

devfsadm: driver failed to attach: qlt

Warning: Driver (qlt) successfully added to system but failed to attach

Reboot the system

init 6

Verify the HBA has switched to target mode.

stmfadm list-target -v

Create the zpool

Note. Single disk setup

Create the zpool.

zpool create SAN c0t0d0

Note. Use format command for list of hard drives.

Create ZFS volume.

zfs create -V 200g SAN/Volume1

Note. -V is used for block devices.

Create a logical unit using the volume.

sbdadm create-lu /dev/zvol/rdsk/SAN/Volume1

Get the GUID number for the LUN.

sbdadm list-lu

Add a view for the logical unit.

stmfadm add-view GUID-number