Configure Storage Server with iSCSI. A storage on a network is called iSCSI Target, a Client which connects to iSCSI Target is called iSCSI Initiator.
This example is based on the environment below.
[10.0.0.30] – iSCSI Target
[10.0.0.31] – iSCSI Initiator
This example configures to create LVM partition on iSCSI Target, so it need to have enough areas to use. If your iSCSI Target does not have enough areas, add new hard drive.
|||Configure iSCSI Target|
# create a phisical volume
Physical volume “/dev/sdb1” successfully created
# create a volume group named “vg_target00”
vgcreate -s 32M vg_target00 /dev/sdb1
Volume group “vg_target00” successfully created
# create a logical volume named “lv_target00”
lvcreate -L 80G -n lv_target00 vg_target00
Logical volume “lv_target00” created
yum -y install scsi-target-utils
# add at the last line
# if you set some devices, add – and set the same way with follows
# naming rule : [ iqn.yaer-month.domain:any name ]
# provided devicce as a iSCSI target
# iSCSI Initiator’s IP address you allow to connect
# authentication info ( set anyone you like for “username”, “password” )
incominguser username password
systemctl start tgtd.service
systemctl enable tgtd.service
tgtadm –mode target –op show
# make sure status
Target 1: iqn.2011-11.world.server:target00 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 Readonly: No Backing store type: null Backing store path: None Backing store flags: LUN: 1 Type: disk SCSI ID: IET 00010001 SCSI SN: beaf11 Size: 20401 MB, Block size: 512 Online: Yes Removable media: No Readonly: No Backing store type: rdwr Backing store path: /dev/vg_target00/lv_target00 Backing store flags: Account information: username ACL information: 10.0.0.31
Complete to configure iSCSI Target. See next step to configure iSCSI Initiator.