Tuesday, March 20, 2012

ISCSI TARGET ON RHEL 6


ISCSI TARGET SERVER HOW TO ON REDHAT6-----------------------------------------------------------
(THIS Practical is created in vmware machine )

lab setup :-

server : ip add 192.168.0.10
hostname = server.example.com

client= ip add 192.168.0.100
hostname= client1.exmaple.com

-------------------------------------------********************************-------------------------------------------------------
# install following package
# yum -y install scsi*
then
# chkconfig tgtd on

step 2 add vitual hardisk and create lvm on that hardisk
and mount it the


step 3
# vim /etc/tgt/targets.conf
And add this line at end of the file
<target iqn.2011-2012.com.exmaple:server.target1>

backing-store /dev/wgroup/whare

</target>


then test discover the iSCSI target from the target server itself, using the following command:
#iscsiadm -m discovery -t sendtargets -p 192.168.0.10
  192.168.0.10:3260,1 iqn.2011-2012.com.exmaple:server.target1

then u succseefully created ISCSI TARGET SERVER
 ------------------------------------------------------------------------------------------------------------
Client side := 1st step Run follwing command

 # iscsiadm -m discovery -t st -p 192.168.0.10(serverip)


 192.168.0.10:3260,1 iqn.2011-2012.com.exmaple:server.target1


 then copy only for (iqn.2011-2012.com.exmaple:server.target1)


 and past it like this


 # iscsiadm -m node -T iqn.2011-2012.com.exmaple:server.target1 –login

 it will give mesg successful


# then run the fdisk -l itwill show u server side disk thats it



2 comments:

  1. Hey dude.. do we need to restart tgtd service after step 3 ?? Bcoz in my setup, luns are not visible in client servers.

    ReplyDelete
  2. Have to force reload the tgtd service, it will make the lun visible in client,

    [root@tgtsrv ~]# /etc/init.d/tgtd force-reload
    Force-updating SCSI target daemon configuration: [ OK ]
    [root@tgtsrv ~]


    After force reload try fdisk -l (or) /etc/init.d/iscsi status

    In client,

    1.) fdisk -l will list the lun as the new hard disk
    2.) By "/etc/init.d/iscsi status", you will be able to see the number of lun & disk name



    Attached SCSI devices:
    ************************
    Host Number: 1 State: running
    scsi1 Channel 00 Id 0 Lun: 0
    scsi1 Channel 00 Id 0 Lun: 1
    Attached scsi disk sda State: running

    ReplyDelete