:::: Openfiler configuration:::::
1. open firefox on linux box with below URL
https://192.168.18.133:446 (Ip of openfiler server : port number)
Or
Use https://openfiler.home.com:446
(DNS NAME and port Number if its configured on your DNS server)
2. Use username : openfiler
passsword : password
3. Go to System Menu
go down : network access configuration
** ADD your client server name and ip
Name ip network type
rac1 192.168.2.1 255.255.255.255 shared
Update more if required
4. go to Volumes groups
create new physical volume use below of disks
Block Device Management
Edit Disk Type Description Size Label type Partitions
/dev/hda IDE VMware Virtual IDE Hard Drive 8.00 GB msdos 6 (view)
/dev/sda SCSI VMware, VMware Virtual S 19.99 GB msdos 1 (view)
/dev/sdb SCSI VMware, VMware Virtual S 19.99 GB msdos 1 (view)
/dev/sdc SCSI VMware, VMware Virtual S 19.99 GB msdos 0 (view)
/dev/sdd SCSI VMware, VMware Virtual S 19.99 GB msdos 0 (view)
/dev/sde SCSI VMware, VMware Virtual S 19.99 GB msdos 0 (view)
Edit partitions in /dev/sdc (2610 cylinders with "msdos" label)
Mode Partition Type Starting cylinder Ending cylinder Size Create Reset
Primary physical volume
Create
5. go to volume groups
volume group name < VOL1 >
/dev/sda
Add Volume group
6. Use volume group name <VOL1> change
Volume Name Linux1
description SCSi
Create
7. ISCSI target
-----> Target configuration : give LUN name and update it.
Target IQN Add
iqn.2006-01.com.openfiler:tsn.ff77104d727a
(LUN NAME)
Update
-----> Lun mapping : map selected volumes
Map New LUN to Target: "iqn.2006-01.com.openfiler:LINUX2"
Name LUN Path R/W Mode SCSI Serial No. SCSI Id. Transfer Mode Map LUN
LINUX-SCSI /dev/vol1/linux1 kvKX5n-GWP5-2rtZ kvKX5n-GWP5-2rtZ Map
-----> Network ACL :
Name Network/Host Netmask Access
test1.home.com 192.168.18.134 255.255.255.255 allow
test2.home.com 192.168.18.135 255.255.255.255 allow
Update
8. Service : Start iscsi service
9. configure iscsi disk in Linux Server
a. Open terminal on Linux box.
b. install required package for iscsi service ( scsi-initiator-utils )
[root@openfiler1 ~]# service iscsi-target restart
Stopping iSCSI target service: [ OK ]
Starting iSCSI target service: [ OK ]
[root@linux3 ~]# chkconfig iscsid on
[root@linux3 ~]# chkconfig iscsi on
c. Now that the iSCSI service is started, use the iscsiadm command-line interface to discover all available targets on the network storage server:
[root@linux3 ~]# iscsiadm -m discovery -t sendtargets -p openfiler1-san( can use ip instead of openfiler-san name)
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:scsi.linux3-data-1
d. Manually login targets.
[root@linux3 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:scsi.linux3-data-1 -p 192.168.2.195 --login
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]
Login to [iface: default, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]: successful
e. Configure Automatic Login
The next step is to make certain the client will automatically login to the target(s) listed above when the machine is booted (or the iSCSI initiator service is started/restarted):
[root@linux3 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:scsi.linux3-data-1 -p 192.168.2.195 --op update -n node.startup -v automatic
F.NOW We can see iscsi disk as /sda in linux server
[root@linux3 ~]# (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:scsi.linux3-data-1 -> ../../sda
Current iSCSI Target Name to local SCSI Device Name Mappings iSCSI Target Name SCSI Device Name
iqn.2006-01.com.openfiler:scsi.linux3-data-1 /dev/sda
g. As you can see, it is impractical to rely on using the local SCSI device names like /dev/sda or /dev/sdb given there is no way to predict the iSCSI target mappings after a reboot.
What we need is a consistent device name we can reference like /dev/iscsi/linux3-data-1 that will always point to the appropriate iSCSI target through reboots. This is where the Dynamic Device Management tool named udev comes in. udev provides a dynamic device directory using symbolic links that point to the actual device using a configurable set of rules. When udev receives a device event (for example, the client logging in to an iSCSI target), it matches its configured rules against the available device attributes provided in sysfs to identify the device. Rules that match may provide additional device information or specify a device node name and multiple symlink names and instruct udev to run additional programs (a SHELL script for example) as part of the device event handling process.
The first step is to create a new rules file. This file will be named /etc/udev/rules.d/55-openiscsi.rules and contain only a single line of name=value pairs used to receive events we are interested in. It will also define a call-out SHELL script (/etc/udev/scripts/iscsidev.sh) to handle the event.
Create the following rules file /etc/udev/rules.d/55-openiscsi.rules on the client node linux3:
# /etc/udev/rules.d/55-openiscsi.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"
Next, create the UNIX SHELL script that will be called when this event is received. Let's first create a separate directory on the linux3 node where udev scripts can be stored:
[root@linux3 ~]# mkdir -p /etc/udev/scripts
Finally, create the UNIX shell script /etc/udev/scripts/iscsidev.sh:
#!/bin/sh
# FILE: /etc/udev/scripts/iscsidev.sh
BUS=${1}
HOST=${BUS%%:*}
[ -e /sys/class/iscsi_host ] || exit 1
file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"
target_name=$(cat ${file})
# This is not an open-scsi drive
if [ -z "${target_name}" ]; then
exit 1
fi
# Check if QNAP drive
check_qnap_target_name=${target_name%%:*}
if [ $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then
target_name=`echo "${target_name%.*}"`
fi
echo "${target_name##*.}"
After creating the UNIX SHELL script, change it to executable:
[root@linux3 ~]# chmod 755 /etc/udev/scripts/iscsidev.sh
Now that udev is configured, restart the iSCSI initiator service:
[root@linux3 ~]# service iscsi stop
Logging out of session [sid: 3, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]
Logout of [sid: 3, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]: successful
Stopping iSCSI daemon: /etc/init.d/iscsi: line 33: 5143 Killed /etc/init.d/iscsid stop
[root@linux3 ~]# service iscsi start
iscsid dead but pid file exists
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]
Login to [iface: default, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]: successful
[ OK ]
[root@linux3 ~]# ls -l /dev/iscsi/
total 0
drwxr-xr-x 2 root root 60 Apr 7 01:57 linux3-data-1
[root@linux3 ~]# ls -l /dev/iscsi/linux3-data-1/
total 0
lrwxrwxrwx 1 root root 9 Apr 7 01:57 part -> ../../sda