Saturday 7 May 2011

configure iSCSI targets and initiators

TARGET SYSTEM

[root@localhost ~]# yum install iscsi-target-utils -y

[root@localhost ~]# chkconfig tgtd on

[root@localhost ~]# service tgtd start

#Create a target
[root@localhost ~]# tgtadm --lld iscsi --mode target --op new --tid 1 --targetname iqn.2011-05.com.example:disk1

#Add a disk to the target
[root@localhost ~]# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --backing-store /dev/sdb1

#Make the config persistent
[root@localhost ~]# tgt-admin -dump >> /etc/tgt/targets.conf

#List the targets on local system
[root@localhost ~]# tgt-admin -s

REMOTE SYSTEM

#List targets from remote system
[root@localhost ~]# iscsiadm -m discovery -t sendtargets -p 172.16.101.132

#Login to target
[root@localhost iscsi]# iscsiadm -m node -T iqn.2011-05.com.example:disk1 -p 172.16.101.132:3260,1 -l




No comments:

Post a Comment