Konfigurasi ISCSI di Ubuntu

    Internet Small Computer Systems Interface atau iSCSI adalah standar jaringan penyimpanan berbasis Internet Protocol untuk menghubungkan fasilitas penyimpanan data. iSCSI menyediakan akses tingkat blok. 

IP target iscsi/server = 10.23.2.93/22
IP initiator/client = 10.23.2.153/22

Konfigurasi di Server (Target)

1. Install package yang dibutuhkan
root@lab-ubuntu2:~# apt install targetcli-fb
2. Buat direktori yang akan dishare dan membuat disk disana
root@lab-ubuntu2:~# mkdir /var/lib/iscsi_disks/
3. Masuk ke konsol admin
root@lab-ubuntu2:~# targetcli
targetcli shell version 2.1.53
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

cd backstores/fileio
3. Membuat disk image dengan nama disk01 di direktori tadi yang sudah dibuat
create disk01 /var/lib/iscsi_disks/disk01.img 10G
cd /iscsi
4. Membuat target dengan format [ iqn.(tahun)-(bulan).(reverse domain):(nama bebas)]
create iqn.2022-10.com.zakaria:node01.initiator01
cd /iqn.2022-10.com.zakaria:node01.initiator01
5. Set UserID untuk autentikasi
/iscsi/iqn.20...1.initiator01> set auth userid=username
/iscsi/iqn.20...1.initiator01> set auth password=password
/iscsi/iqn.20...1.initiator01> exit
6. cek port target dengan perintah
root@lab-ubuntu2:~# ss -napt | grep 3260
LISTEN 0      256          0.0.0.0:3260      0.0.0.0:*                    


Konfigurasi di Client (Initiator)

1. install client iscsi 

root@vm-ubuntu:~# apt install open-iscsi
2. Konfigurasi initiatorname dengan menambahkan initiator yang tadi telah kita buat di target
# DO NOT EDIT OR REMOVE THIS FILE!
## If you remove this file, the iSCSI daemon will not start.
## If you change the InitiatorName, existing access control lists
## may reject this initiator.  The InitiatorName must be unique
## for each iSCSI initiator.  Do NOT duplicate iSCSI InitiatorNames.
#InitiatorName=iqn.1993-08.org.debian:01:a37be6b02ddb
InitiatorName=iqn.2022-10.com.zakaria:node01.initiator01
3. setelah itu konfigurasi iscsi.conf dan uncomment beberapa
## To enable CHAP authentication set node.session.auth.authmethod
# to CHAP. The default is None.
node.session.auth.authmethod = CHAP
# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
node.session.auth.username = username
node.session.auth.password = password

4. simpan dan restart service
root@vm-ubuntu:~# systemctl restart iscsi iscsid
5. identifikasi target
root@vm-ubuntu:~# iscsiadm -m discovery -t sendtargets -p 10.23.2.93
10.23.2.93:3260,1 iqn.2022-07.com.zakaria:www.target01
6. konfirmasi status setelah identifikasi target
root@vm-ubuntu:~# iscsiadm -m node -o show
# BEGIN RECORD 2.0-874
node.name = iqn.2022-07.com.zakaria:www.target01
.....
node.conn[0].iscsi.IFMarker = No
node.conn[0].iscsi.OFMarker = No
# END RECORD
7. kemudian login ke target dengan user yang telah dibuat sebelumnya

root@vm-ubuntu:~# iscsiadm -m node --login 
8. melihat disk yang telah masuk
root@vm-ubuntu:~# cat /proc/partitions
9. tambahkan disk baru (label,partition,format file system)
parted --script /dev/sdb "mklabel msdos"
mount /dev/sdb1 /mnt
df -hT







Komentar

Postingan populer dari blog ini

Konfigurasi DNS Server (Master Zone, Slave Zone, RPZ Zone) di RedHat

Bahas Firewalld di Redhat