This tutorial describes how to setup an iscsi partion and add it to the Proxmox storage pool.
The main use case for this setup is to mix and extend storage options due to low local disk space, adding fast Nvme or slow cheap HDD for iso’s,templates etc …
While Proxmox cp does provide a GUI to add iscsi storage my experience with server restarts did not recover connectivity with the target disk.
In this tutorial i will walk though mostly a command line setup between two servers.
Note: It is recommend to use a private network between the two servers and if possible a 10GB connection would be ideal.
Terms to know
Target – “is the server providing the disk/partion to share” Initiator – “the proxmox server consuming the target”
The next diagram depicts the main commands and files to touch:
are you ready; here we go:
A – Setting up the Target example ip – 220.127.116.11 :
# apt-get install tgt # cat <<EOF > /etc/tgt/conf.d/target01.conf <target iqn.2021-03.kvm:lun1> backing-store /dev/mapper/vgstore-lviscsi initiator-address 18.104.22.168 incominguser iscsi-user password </target> EOF # systemctl --now enable tgt # systemctl status tgt ### make sure its running ; you may need to reboot
in the above conf file i am setting the free partition /dev/mapper/vgstore-lviscsi make sure you add the correct partition available to you.
# tgtadm -o show -m target
you may need to reboot to get tgtadm show tartget details.
B – Setting up the Initiator example ip – 22.214.171.124 :
# apt-get install open-iscsi # systemctl --now enable open-iscsi # reboot # if next command # iscsiadm -m discovery -t sendtargets -p 126.96.36.199:3260 # should get next sample output 188.8.131.52:3260,1 iqn.2021-03.kvm:lun1
next is to change the target conf file
# ## use tab after nodes to auto complete the name nano /etc/iscsi/nodes/iqn.2021-03.kvm\:lun1/184.108.40.206\,3260\,1/default
find the key and edit value according to the following
node.startup = automatic node.session.auth.authmethod = CHAP node.session.auth.username = iscsi-user node.session.auth.password = password
# systemctl restart open-iscsi # iscsiadm -m node --login # should return successful
now lets check if the partition is added
Now its time to create the volume and display it
# pvcreate /dev/sda # vgcreate vgiscsi /dev/sda # vgs
C – Add the vg group to proxmox
next create and use the new lvm for creating a container like
and its done.
This was my experince of extending storage on a proxmox using iscsi. I hope you will have fun as much as i did.
Final notes: I would like to mention @gleert from https://www.naranja.tech/ for providing a great kvm with a lot of bandwidth. I promised him that if my install worked and ran smoothly for a while i will add this note.