Extending Proxmox Disk Space with iSCSI Storage

edited March 2022 in LES Talk

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 - 98.76.54.32 :

# 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 12.34.56.78
     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 - 12.34.56.78 :

# apt-get install open-iscsi 
# systemctl --now enable open-iscsi
# reboot # if next command
# iscsiadm -m discovery -t sendtargets -p 98.76.54.32:3260  # should get next sample output
98.76.54.32: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/98.76.54.32\,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.

Refs:
https://www.howtoforge.com/tutorial/how-to-setup-iscsi-storage-server-on-ubuntu-2004-lts/
https://www.tecmint.com/setup-iscsi-target-and-initiator-on-debian-9/

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.

Comments

Sign In or Register to comment.