LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-05-2015, 10:06 PM   #1
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Rep: Reputation: Disabled
Difficulty setting up iscsi target


CentOS release 6.6 (Final)

[root@centos66 ~]# tgtadm --lld iscsi --mode target --op new --tid 1 --targetname iqn.2015-01.com.foobar:target01

[root@centos66 ~]# tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /dev/iscsi_lv/lun0_lv
tgtadm: invalid request

[root@centos66 ~]# tgtadm --lld iscsi --mode target --op show
Target 1: iqn.2015-01.com.foobar:target01
System information:
Driver: iscsi
State: ready
I_T nexus information:
LUN information:
LUN: 0
Type: controller
SCSI ID: IET 00010000
SCSI SN: beaf10
Size: 0 MB, Block size: 1
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
Backing store type: null
Backing store path: None
Backing store flags:
Account information:
ACL information:
 
Old 02-06-2015, 08:21 AM   #2
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Original Poster
Rep: Reputation: Disabled
Based on other reading, it may be that my kernel in CentOS 6.6 doesn't support iscsi target management, even though I installed the SW.

Does anyone know if it's possible to add the iscsi target management to the kernel, how it's done or which versions of CentOS support this feature?
 
Old 02-07-2015, 06:58 AM   #3
manoj_hanse
Member
 
Registered: Mar 2008
Posts: 48

Rep: Reputation: 1
http://opentodo.net/2012/10/setup-is...r-on-centos-6/

this problem has nothing to do we kernel. stay calm and read the above link.

and follow step by step procedure. and still if you face any problem reply back.
 
Old 02-07-2015, 01:42 PM   #4
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Original Poster
Rep: Reputation: Disabled
[root@centos66 ~]# yum install -y scsi-target-utils
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: linux.mirrors.es.net
* extras: centos.mirror.lstn.net
* updates: centos-distro.cavecreek.net
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 2.1 MB 00:00
Resolving Dependencies
--> Running transaction check
---> Package scsi-target-utils.x86_64 0:1.0.24-16.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================== ============
Package Arch Version Repository Size
==================================================================================================== ============
Installing:
scsi-target-utils x86_64 1.0.24-16.el6 base 176 k

Transaction Summary
==================================================================================================== ============
Install 1 Package(s)

Total download size: 176 k
Installed size: 459 k
Downloading Packages:
scsi-target-utils-1.0.24-16.el6.x86_64.rpm | 176 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : scsi-target-utils-1.0.24-16.el6.x86_64 1/1
Verifying : scsi-target-utils-1.0.24-16.el6.x86_64 1/1

Installed:
scsi-target-utils.x86_64 0:1.0.24-16.el6

Complete!
[root@centos66 ~]# lvscan
ACTIVE '/dev/iscsi_vg/main0_lv' [2.00 GiB] inherit
ACTIVE '/dev/iscsi_vg/temp0_lv' [4.00 GiB] inherit
ACTIVE '/dev/iscsi_vg/user0_lv' [10.00 GiB] inherit
ACTIVE '/dev/root_vg/swap_lv' [1.00 GiB] inherit
ACTIVE '/dev/root_vg/root_lv' [2.51 GiB] inherit
[root@centos66 ~]# cat /etc/tgt/targets.conf
default-driver iscsi
<target iqn.2015-01.com.usao:target01>
<backing-store /dev/iscsi_vg/main0_lv>
lun 1
</backing-store>
<backing-store /dev/iscsi_vg/temp0_lv>
lun 2
</backing-store>
<backing-store /dev/iscsi_vg/user0_lv>
lun 3
</backing-store>
</target>
[root@centos66 ~]# cat /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW,ESTABLISHED -m tcp -p tcp --sport 860 -j ACCEPT
-A INPUT -m state --state NEW,ESTABLISHED -m tcp -p tcp --dport 3260 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
[root@centos66 ~]# service tgtd start
[root@centos66 ~]# chkconfig tgtd on
[root@centos66 ~]# tgtadm --mode target --op show
[root@centos66 ~]#


Last edited by usao; 02-07-2015 at 01:43 PM.
 
Old 02-10-2015, 11:54 AM   #5
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by manoj_hanse View Post
http://opentodo.net/2012/10/setup-is...r-on-centos-6/

this problem has nothing to do we kernel. stay calm and read the above link.

and follow step by step procedure. and still if you face any problem reply back.
Hello? I did as you requested. Can you review and advise?
 
Old 02-11-2015, 01:42 AM   #6
manoj_hanse
Member
 
Registered: Mar 2008
Posts: 48

Rep: Reputation: 1
well Done.

You did the server part.

Now you have to access the Luns / target from iscsi client.

install iscsi-initiator-utils on client.

Aceesing iscsi target from client:

1. add the iqn name to the file /etc/iscsi/initiatorname.iscsi file:

iqn.2015-01.com.usao:target01

2. enable the iscsi service to start on boot using chkconfig or systemctl

3. start the iscsi service using service or systemctl command. Check if the service is running.

4. command 1: (on client): iscsiadm -m discovery -t st -p ip-address-of-server

5. you should get some output: namely the iqn name of server (e.g. iqn.2015-01.com.example.com:server1)

6. now use this command: (on client) iscsiadm -m node -T server-iqn-name-from previous-output -p server-address -l

7. if you dont get upto here you will have to add some new -lines to the target.conf file on server.

namely: initiator-address client-ip-address after the Lun #.
 
Old 02-11-2015, 08:59 AM   #7
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Original Poster
Rep: Reputation: Disabled
AFAIK there is no point proceeding, since the target failed to create. The 'tgtadm --mode target --op show' command didn't show anything.
Using the initial commands, I could at least get a target created, but couldn't get the lun to add to the target.
 
Old 02-11-2015, 11:30 PM   #8
manoj_hanse
Member
 
Registered: Mar 2008
Posts: 48

Rep: Reputation: 1
Hi Usao,

Till now i was thinking that 6.6 is compatible with 6 but i guess its not. it is compatible with centos 7 and rhel 7.

So the commands has changed a little bit. tgtadm may not work on 6.6.

use targetcli when creating Luns.

install targetcli: yum install targetcli

and then follow these steps.: http://www.ksovi.eu/2014/09/red-hat-...-with-lio.html

If even this doesn't work, then you can stop trying and there's no point in going ahead.

or use this link : www.youtube.com/watch?v=Y0WgvdeNAuA

I could myself write the steps, but if already written then we can use them. Believe me its much much easy than in 6.

Thanks bye. have a nice day.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iSCSI target configuration help usao CentOS 9 08-31-2014 05:53 PM
[SOLVED] Iscsi target on Freenas 7 or 8 jefro *BSD 5 01-03-2011 04:39 PM
changes on other iscsi nodes attached to an ext3 iscsi target not being seen sldahlin Linux - Server 1 06-07-2008 02:02 AM
setting up iscsi initiator and target gauthamk Linux - Software 0 10-05-2007 09:16 AM
iSCSI target software from Ardis pliva Linux - Software 2 05-13-2006 01:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration