Seungweon's Blog

in Portland, Oregon

Introduction

Tips: When you install SLES 11 to iSCSI target, use options "withiscsi=1 netsetup=1".

I've been testing to use iSCSI for Intel NICs, and the base package of open-iscsi that was included in SUSE Linux 11.0 looked interesting. However, it just did not work. So, I started to find out why SUSE 11 doesn't boot correctly after changing to alternative network port of INTEL Server Dual Ports at the system installed SLES 11. After many hours of troubleshooting, it seems like causing problem from SLES 11 distros problem.

They do not change iSCSI settings dynamically using the network information found in the "iSCSI Boot Firmware Table (iBFT)". SLES 11 reads the iBFT data and only items like Target name, LUN ID, etc. which are used dynamically. In order to work properly, it needs to modify the setting but I have no idea at this time. I will look into that more later.

The problem seems like that the installed port's MAC address is hardcoded into the initial script in SLES 11 and they only bring up the interface associated with that MAC address. When a MAC address, which is different from the one when SLES 11 is installed, is changed, the init script is not updated to reflect this.

Prerequisites

The base platform to use with this how-to is of course a working setup of SUSE Linux... More precisely, you will need the following

* SUSE Linux 11 system (with a NIC).
* Access to SUSE installation CDs/DVD or online installation source.
* A functional and online iSCSI target.

Download the open-iSCSI software for iSCSI target.

* Change working directory to your sources directory, usually /usr/src: cd /usr/src

* We use the svn command to download the source code from the repositary. If you want to learn more about svn, use man svn. The open-iscsi repositary is located on Berlios' servers. To check out the files, issue the command svn co svn://svn.berlios.de/open-iscsi/

You should now see something like this happen on your screen (Only first and last lines showed)


labb:/usr/src # svn co svn://svn.berlios.de/open-iscsi/
A open-iscsi/test
A open-iscsi/test/regression.dat
A open-iscsi/test/regression.sh
A open-iscsi/test/README
(...)
A open-iscsi/etc/initd/initd.redhat
A open-iscsi/Makefile
A open-iscsi/README
Checked out revision 593.
labb:/usr/src #


To be able to compile the open-iscsi modules, we need to prepare the kernel source.

* Change working directory to your kernel sources directory, usually /usr/src/linux: cd /usr/src/linux

* When building external modules the kernel is expected to be prepared. This includes the precense of certain binaries, the kernel configuration and the symlink to include/asm. We will make clone of the current kernel configuration, and prepare the modules for compilation of external modules. To do this, issue the command: make cloneconfig && make modules_prepare

* You should now see a long screen output scroll away in front of you, like this


labb:/usr/src/linux # make cloneconfig && make modules_prepare
Cloning configuration file /proc/config.gz
Linux Kernel Configuration
Code maturity level options
Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [Y/n/?] y
General setup
(...)
HOSTLD scripts/mod/modpost
HOSTCC scripts/kallsyms
HOSTCC scripts/conmakehash
HOSTCC scripts/bin2c
labb:/usr/src/linux #


Build and install open-iscsi

* Open up your favorite text editor and load the file Makefile located in the base open-iscsi directory (/usr/src/open-iscsi)
* Locate the line exec_prefix = /usr and change it to look like this:


DESTDIR ?=
prefix = /usr
exec_prefix = /
sbindir = $(exec_prefix)/sbin
bindir = $(exec_prefix)/bin
mandir = $(prefix)/share/man


Compile open-iscsi


labb:/usr/src/open-iscsi # make
make -C usr
make[1]: Entering directory `/usr/src/open-iscsi/usr'
cc -O2 -g -Wall -Wstrict-prototypes -I../include -DLinux -DNETLINK_ISCSI=8 -c -o util.o util.c
cc -O2 -g -Wall -Wstrict-prototypes -I../include -DLinux -DNETLINK_ISCSI=8 -c -o io.o io.c
(...)
make[1]: Leaving directory `/usr/src/open-iscsi/kernel'

Compilation complete Output file
----------------------------------- ----------------
Built iSCSI Open Interface module: kernel/scsi_transport_iscsi.ko
Built iSCSI library module: kernel/libiscsi.ko
Built iSCSI over TCP kernel module: kernel/iscsi_tcp.ko
Built iSCSI daemon: usr/iscsid
Built management application: usr/iscsiadm

Read README file for detailed information.


Install the open-iscsi modules and apps


labb:/usr/src/open-iscsi # make install
make -C kernel install_kernel
make[1]: Entering directory `/usr/src/open-iscsi/kernel'
(...)
install -m 755 etc/initd/initd.suse \
/etc/init.d/open-iscsi
make[1]: Leaving directory `/usr/src/open-iscsi'


Add the sysconfig entry

* Open your text editor, and create the file: /etc/sysconfig/open-iscsi


## Path: Network/iSCSI/Client
## Description: iSCSI Default Portal
## Type: string
## Default: ""
#
# The iSCSI Default Portal to use on startup. Use either the hostname
# or IP number of the machine providing the iSCSI Targets to use
#
ISCSI_PORTAL=""

## Type: list(sendtargets,isns,slp)
## Default: sendtargets
#
# The iSCSI discovery method to use. Currently only 'sendtargets' is
# implemented.
#
ISCSI_DISCOVERY="sendtargets"


Add the initiatorname config file

* We must have a config file with the initiator name for the daemon to use, without this, it cannot start.
* Open your text editor, and create the new file: /etc/initiatorname.iscsi
* You need to create a name for your initiator, and the name has to follow certain standards. You can read about iSCSI naming in IETF RFC 3721.


## DO NOT EDIT OR REMOVE THIS FILE!
## If you remove this file, the iSCSI daemon will not start.
## If you change the InitiatorName, existing access control lists
## may reject this initiator. The InitiatorName must be unique
## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.
InitiatorName=iqn.2009-06.spark:spark


Installation Done !!

0 comments:

Post a Comment