	Minimal Directions OCS_FC_LIO Usage

1. You will need to build a 3.9.0 kernel. You will need to enable
CONFIG_TARGET_CORE and if you want to use a backend other than the ram
disk, you'll need to enable, for example, CONFIG_TCM_FILEIO.

2. You will need to install the user administrative framework that
includes configshell, rtslib, lio-utils and targetcli.

This needs to be built from GIT repos cloned from the Rising Tide website.

git clone git://risingtidesystems.com/configshell.git
git clone git://risingtidesystems.com/rtslib.git
git clone git://risingtidesystems.com/lio-utils.git
git clone git://risingtidesystems.com/targetcli.git

To build on CentOS 6.4, for example, first install:

 yum install http://mirror.cogentco.com/pub/linux/epel/6/x86_64/epel-release-6-8.noarch.rpm
 yum install rpmdevtools gcc make kernel-devel yum-utils epydoc rsync git python-devel python-simpleparse
 yum install python-netifaces python-ipaddr python-configobj net-snmp-devel

Do this as root.

To build configshell:
 issue: make cleanall
 issue: make rpm
 issue: yum install dist/python-configshell*.noarch.rpm
To build rtslib:
 issue: make cleanall
 issue: make rpm
 issue: yum install dist/python-rtslib-*.noarch.rpm
To build lio-utils:
 Copy RPMMACROS to ${HOME}/.rpmmacros and issue: rpmdev-setuptree
 Patch lio-utils by issuing: patch -p1 < LIO-UTILS.PATCH
 issue: rpmdev-setuptree
 issue: make clean
 issue: make user_rpms
 issue: yum install /usr/src/redhat/RPMS/x86_64/lio-utils*.rpm
build targetcli
 issue: make cleanall
 issue: make rpm
 issue: yum install dist/targetcli*.noarch.rpm

These will generate rpms that you can then install.

3. After RPM installation, copy ocs_fc_lio.spec to /var/target/fabric.

4. On CentOS you will need to issue the following somewhere after startup:

mount -t configfs configfs /sys/kernel/config

if you want targetcli to work.

5. On CentOS you will need to issue the following somewhere after startup:

mount -t debugfs debugfs /sys/kernel/debug

if you want to do dynamic debugging.


6. You must install elxsdkutil somewhere in root's path on
the system.

7. An example usage of targetcli is shown here:

Assuming ocs_fc_lio has been loaded, e.g. with
	insmod ocs_fc_lio.ko
or
	modprobe ocs_fc_lio

You can then run targetcli to find out the WWPN of the attached Emulex
HBA via, assuming you have the WWPNs of the initiators describe below
(modify as needed) 21:00:00:1b:32:8f:09:5d and 21:01:00:1b:32:af:09:5d.


r2d2.in1.lcl# targetcli
Welcome to the targetcli shell:

 Copyright (c) 2011 by RisingTide Systems LLC.

 For help on commands, type 'help'.

/> ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- block .................................................................................................... [0 Storage Object]
  | o- fileio ................................................................................................... [0 Storage Object]
  | o- pscsi .................................................................................................... [0 Storage Object]
  | o- ramdisk .................................................................................................. [0 Storage Object]
  o- ib_srpt ........................................................................................................... [Not found]
  o- iscsi .............................................................................................................. [0 Target]
  o- loopback ........................................................................................................... [0 Target]
  o- ocs_fc_lio ......................................................................................................... [0 Target]
  o- qla2xxx ........................................................................................................... [Not found]
  o- tcm_fc ............................................................................................................ [Not found]
/> /ocs_fc_lio info
Fabric module name: ocs_fc_lio
ConfigFS path: /sys/kernel/config/target/ocs_fc_lio
Allowed WWNs list (free type): 10:00:00:00:c9:fc:88:12, 10:00:00:00:c9:fc:88:13
Fabric module specfile: /var/lib/target/fabric/ocs_fc_lio.spec
Fabric module features: acls
Corresponding kernel module: ocs_fc_lio
/> /backstores/ramdisk create fred 100m
Created ramdisk fred with size 100m.
/> ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- block .................................................................................................... [0 Storage Object]
  | o- fileio ................................................................................................... [0 Storage Object]
  | o- pscsi .................................................................................................... [0 Storage Object]
  | o- ramdisk .................................................................................................. [1 Storage Object]
  |   o- fred ....................................................................................... [ramdisk (100.0M) deactivated]
  o- ib_srpt ........................................................................................................... [Not found]
  o- iscsi .............................................................................................................. [0 Target]
  o- loopback ........................................................................................................... [0 Target]
  o- ocs_fc_lio ......................................................................................................... [0 Target]
  o- qla2xxx ........................................................................................................... [Not found]
  o- tcm_fc ............................................................................................................ [Not found]
/> /ocs_fc_lio create 10:00:00:00:c9:fc:88:12
Created target 10:00:00:00:c9:fc:88:12.
/> /ocs_fc_lio/10:00:00:00:c9:fc:88:12/luns create /backstores/ramdisk/fred
Created LUN 0.
/> /ocs_fc_lio create 10:00:00:00:c9:fc:88:13
Created target 10:00:00:00:c9:fc:88:13.
/> /ocs_fc_lio/10:00:00:00:c9:fc:88:12/acls create 21:00:00:1b:32:8f:09:5d
Created Node ACL for 21:00:00:1b:32:8f:09:5d
Created mapped LUN 0.
/> /ocs_fc_lio/10:00:00:00:c9:fc:88:12/acls create 21:01:00:1b:32:af:09:5d
Created Node ACL for 21:01:00:1b:32:af:09:5d
Created mapped LUN 0.
/> /ocs_fc_lio/10:00:00:00:c9:fc:88:13/acls create 21:00:00:1b:32:8f:09:5d
Created Node ACL for 21:00:00:1b:32:8f:09:5d
/> /ocs_fc_lio/10:00:00:00:c9:fc:88:13/acls create 21:01:00:1b:32:af:09:5d
Created Node ACL for 21:01:00:1b:32:af:09:5d
/> ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- block .................................................................................................... [0 Storage Object]
  | o- fileio ................................................................................................... [0 Storage Object]
  | o- pscsi .................................................................................................... [0 Storage Object]
  | o- ramdisk .................................................................................................. [1 Storage Object]
  |   o- fred ......................................................................................... [ramdisk (100.0M) activated]
  o- ib_srpt ........................................................................................................... [Not found]
  o- iscsi .............................................................................................................. [0 Target]
  o- loopback ........................................................................................................... [0 Target]
  o- ocs_fc_lio ........................................................................................................ [2 Targets]
  | o- 10:00:00:00:c9:fc:88:12 ........................................................................................... [enabled]
  | | o- acls ............................................................................................................. [2 ACLs]
  | | | o- 21:00:00:1b:32:8f:09:5d .................................................................................. [1 Mapped LUN]
  | | | | o- mapped_lun0 .................................................................................. [lun0 ramdisk/fred (rw)]
  | | | o- 21:01:00:1b:32:af:09:5d .................................................................................. [1 Mapped LUN]
  | | |   o- mapped_lun0 .................................................................................. [lun0 ramdisk/fred (rw)]
  | | o- luns .............................................................................................................. [1 LUN]
  | |   o- lun0 ..................................................................................................... [ramdisk/fred]
  | o- 10:00:00:00:c9:fc:88:13 ........................................................................................... [enabled]
  |   o- acls ............................................................................................................. [2 ACLs]
  |   | o- 21:00:00:1b:32:8f:09:5d .................................................................................. [0 Mapped LUN]
  |   | o- 21:01:00:1b:32:af:09:5d .................................................................................. [0 Mapped LUN]
  |   o- luns .............................................................................................................. [0 LUN]
  o- qla2xxx ........................................................................................................... [Not found]
  o- tcm_fc ............................................................................................................ [Not found]
/> exit
Global pref auto_save_on_exit=true
Existing file /etc/target/saveconfig.json backed up to saveconfig.json.backup
Configuration saved to /etc/target/saveconfig.json
r2d2.in1.lcl#
