LinuxQuestions.org
Register a domain and help support LQ
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 04-06-2010, 02:06 AM   #1
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 833

Rep: Reputation: 91
Managing a test iSCSI target server


Hi all, hope this is the right forum to post this,

I am using a RHEL5 server with a few hard drives, and tgtd as the iscsi target software. I am looking for a way to allocate and deallocate space and targets with that space, without restarting my system, or harming other LUNs.

Currently, all my HDDs are PVs in a single VG, and I lvcreate/lvremove as required, and then export the allocated LVs using a tgt script:

Code:
usr/sbin/tgtadm --lld iscsi --op new --mode target --tid=1 --targetname iqn.2001-04.com.lab.gss:300gb
/usr/sbin/tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/mapper/iscsi_vg-iscsi_300Gb
/usr/sbin/tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

/usr/sbin/tgtadm --lld iscsi --op new --mode target --tid=2 --targetname iqn.2001-04.com.lab.gss:200gb
/usr/sbin/tgtadm --lld iscsi --op new --mode logicalunit --tid 2 --lun 1 -b /dev/mapper/iscsi_vg-iscsi_200Gb
/usr/sbin/tgtadm --lld iscsi --op bind --mode target --tid 2 -I ALL

/usr/sbin/tgtadm --lld iscsi --op new --mode target --tid=3 --targetname iqn.2001-04.com.lab.gss:100gb
/usr/sbin/tgtadm --lld iscsi --op new --mode logicalunit --tid 3 --lun 1 -b /dev/mapper/iscsi_vg-iscsi_100Gb
/usr/sbin/tgtadm --lld iscsi --op bind --mode target --tid 3 -I ALL

tgtadm --mode target --op show
So in order to remove a LUN, I stop the tgtd service, lvremove the lv, and remove the entry from the iscsi target script
When I add a lun, I run lvcreate, and then add an entry to the script and run it.

This is not quite optimal, since restarting the service is a bad idea while other LUNs are busy, so I am looking for a more scalable and safer way, without moving to ietd (lots of bad experience with it) or anything based on ietd (like openfiler)

Thanks
 
Old 04-07-2010, 09:53 PM   #2
mweed
Member
 
Registered: Mar 2006
Posts: 33

Rep: Reputation: 17
You already know how to do all the steps. Time to bust out the scripting skills. Link all the steps together in a script.

Make a configuration file that your script uses to know what is supposed to be there. have your script update that file when it makes a change.

Otherwise look for a ready built administration utility. It should probably be able to do what you want to do, but maybe not the exact way you want it to.

Why are you restarting tgtd? I am not familiar with it, but it seems like tgtadm should be able to remove targets without restarting tgtd.
 
Old 04-08-2010, 05:10 AM   #3
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 833

Original Poster
Rep: Reputation: 91
Quote:
Originally Posted by mweed View Post
You already know how to do all the steps. Time to bust out the scripting skills. Link all the steps together in a script.
I am actually looking for a nice and acceptable way of doing this, instead of manually scripting anything. There are ready build distros (openfiler) but they use ietd, which is seriously behind tgtd performance and stability-wise. So I was hoping I missed another ready solution, and someone might point me towards one


Quote:
Make a configuration file that your script uses to know what is supposed to be there. have your script update that file when it makes a change.
I'lll probably end up trying to write a webmin module for tgtd, when I have the time

Quote:
Otherwise look for a ready built administration utility. It should probably be able to do what you want to do, but maybe not the exact way you want it to.
as I said, those are all either based on ietd or proprietary


Quote:
Why are you restarting tgtd? I am not familiar with it, but it seems like tgtadm should be able to remove targets without restarting tgtd.
hmm, you might have a point there, I'll look into the man pages, thanks
 
  


Reply

Tags
iscsi, management, rhel


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 image sizing nowlinuxed Linux - General 1 10-19-2009 02:05 AM
Can you map a folder as an iSCSI target? Duren Linux - Server 0 08-18-2008 12:49 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 not makes up with fedora 6 nirmaltom Linux - Software 1 02-26-2007 04:29 AM


All times are GMT -5. The time now is 05:09 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration