OS: Centos 6
But firstly, we need to configure ISCSI on target server which means my scsi_disk_server (Server that we configured raid 0) which is the target host under client server’s point of view.
Install packages ;
On target server, owner of the disk: yum install scsi-target-utils
Systemctl start target
Start targetcli then go into /backstores/block (where our disks to share will be shown) now we have no lun created, check with ls command, you will see nothing.
We created our raid 0 array /dev/md0
So, let’s use this disk as block storage object. Then we will generate an iqn name automatically by typing only create command. Alternatively you can write your own iqn address by respecting the correct syntax.
Now we need to create an ACL so only our iscsi initiatior on client side can access the disk.
We will create a LUN from the disk that we’ve used to create a block storage object.
The final step is to create a portal; we will give our target server’s (current machine) ip address in order to publish the LUN over network.
Remember if you have a default portal like I have, check with ls command you must firstly delete it before creating a new portal.
We are ready to configure iscsi initiator on client side.
Yum install iscsi-initiator-utils
Replace the initiator name allowed for client:
Restart iscsi service, systemctl restart iscsid iscsi
If service is not started by systemctl or service commands try to discover the target by iscsiadm command, it will be started automatically.
Now, you use traditional ways to create a PV then allocate your space to other volume groups. I’ll create one VG but 2 different LV with 1GB each.
Format the FS with ext4 or xfs as tou wish.
create mount points as you wish. I’ll create data1 and data2.
Your FS with raid level 0 is ready to use. The logic remains same for other raid levels.