Configure Opensolaris host to have HBAs in target mode (COMSTAR)

Configuring Opensolaris host to have HBAs in target mode (COMSTAR) will effectively turn your Opensolaris host into host that will act as a storage array. Most of the Emulex 2GB and up and Qlogic 4GB HBAs and up are supported to work in target mode in Comstar project, se this thread for more info about supported HBAs http://opensolaris.org/jive/thread.jspa?threadID=81627

We start checking installed HBAs:

root@opensolaris:~# fcinfo hba-port
HBA Port WWN: 10000000c9328447
Port Mode: Initiator
Port ID: 0
OS Device Name: Not Applicable
Manufacturer: Emulex
Model: LP9002L
Firmware Version: 3.93a0 (C2D3.93A0)
FCode/BIOS Version: none
Serial Number: 0000C9328447
Driver Name: emlxs
Driver Version: 2.50i (2009.11.10.12.30)
Type: unknown
State: offline
Supported Speeds: 1Gb 2Gb
Current Speed: not established
Node WWN: 20000000c9328447
HBA Port WWN: 10000000c9328448
Port Mode: Initiator
Port ID: 0
OS Device Name: Not Applicable
Manufacturer: Emulex
Model: LP9002L
Firmware Version: 3.93a0 (C2D3.93A0)
FCode/BIOS Version: none
Serial Number: 0000C9328448
Driver Name: emlxs
Driver Version: 2.50i (2009.11.10.12.30)
Type: unknown
State: offline
Supported Speeds: 1Gb 2Gb
Current Speed: not established
Node WWN: 20000000c9328448

We need to change port mode to target, that is done by editing emlxs driver config file (/kernel/drv/emlxs.conf), you need to change target-mode from 0 to 1:

# target-mode: Controls COMSTAR target mode support for an adapter port.
#
# 0 = Disables target mode support. Enables initiator mode support.
# 1 = Enables target mode support. Disables initiator mode support.
#
# Usage examples:
# target-mode=1; Sets global default for target mode
# emlxs0-target-mode=0; emlxs0 will be an initiator port
# emlxs1-target-mode=1; emlxs1 will be a target port
#
# Range: Min:0 Max:1 Default:0
#
target-mode=1;

and in the next section you need to remove comment in the ddi-forceattach line, so you’ll have

ddi-forceattach=1;

In order for driver settings to take effect, you need to reboot.

After reboot make sure that Comstar services are running:

# svcs stmf
# svcadm enable stmf

And now we can see that there are 2 targets:

root@opensolaris:~# stmfadm list-target
Target: wwn.10000000C9328448
Target: wwn.10000000C9328447

Which is also confirmed by fcinfo command:

root@opensolaris:~# fcinfo hba-port
HBA Port WWN: 10000000c9328447
Port Mode: Target
Port ID: 0
OS Device Name: Not Applicable
Manufacturer: Emulex
Model: LP9002L
Firmware Version: 3.93a0 (C2D3.93A0)
FCode/BIOS Version: none
Serial Number: 0000C9328447
Driver Name: emlxs
Driver Version: 2.50i (2009.11.10.12.30)
Type: unknown
State: offline
Supported Speeds: 1Gb 2Gb
Current Speed: not established
Node WWN: 20000000c9328447
HBA Port WWN: 10000000c9328448
Port Mode: Target
Port ID: 0
OS Device Name: Not Applicable
Manufacturer: Emulex
Model: LP9002L
Firmware Version: 3.93a0 (C2D3.93A0)
FCode/BIOS Version: none
Serial Number: 0000C9328448
Driver Name: emlxs
Driver Version: 2.50i (2009.11.10.12.30)
Type: unknown
State: offline
Supported Speeds: 1Gb 2Gb
Current Speed: not established
Node WWN: 20000000c9328448

Leave a Reply

Spam Protection by WP-SpamFree