Playground time - virtual PBS with iSCSI Backend

Funny you brought this up. I just set this up earlier in the week to try out at home.

My setup under PVE 6.3-3:
  • VM1: TrueNAS Core
    • RAIDZ2 pool with a dedicated HBA and hard drives.
    • iSCSI share on a dataset with thin provisioning and compression enabled
  • VM2: Proxmox Backup Server
  • VM....: Various other VM, servers, gaming machines, etc.
So far it's been doing backups regularly in the week and working. I'd like to keep an eye on this setup and see if it works well for a longer period. It would be good to know if anyone else does this and whether or not it's a good idea.

Some high level steps of what I did:

Connect the iSCSI target in your PBS server
  1. Setup TrueNAS iSCSI share. I created one using the iSCSI wizard, but once setup it should be broadcasting your server for clients to discover.
  2. Proxmox Backup Server already has iscsi-tools command line installed on it. You can use it to discover and attach the iSCSI share to PBS. Before doing so edit /etc/iscsi/iscsid.conf so that it automatically connects the iSCSI node when PBS starts up.
    Code:
    node.startup = automatic
  3. Run:
    Code:
    iscsiadm --mode discovery --portal YOUR_SERVER_HOST --type sendtargets
    It should output a list of iSCSI targets setup on TrueNAS using IQN notation. For example:
    Code:
    iqn.2021-04.com.example.myserver:myiscsi-drive
  4. Make note of the target name from the output. Login using:
    Code:
    iscsiadm -m node --targetname=iqn.2021-04.com.example.myserver:myiscsi-drive --login
    This will login and attach the iSCSI to PBS. It also saves this config so if you setup Step #2 to "automatic" it will use this config to reconnect each startup.
  5. Use iscsiadm -m session -P 3to check the status of any iSCSI drives connected. It will also help you see what device file is associated with it. Mine was 'sdb'

    1619756031114.png

    You can also use lsblk to verify this
Mount the iSCSI drive as a datastore

This part I had troubles with, and actually still not sure if it's setup properly. I couldn't do the setup in the web UI so had to rely on CLI tools to format and setup the drive. Refer to the PBS documentation: https://pbs.proxmox.com/docs/

  1. Use fdisk /dev/sdx to partition / format your drive. Replace the device letter with yours.
  2. Format it using ext4 mkfs.ext4 /dev/sdx1. Again, replace the device letter and number with your own.
  3. Mount the device. I chose to put it in /mnt/proxmox-backup but perhaps there is a better place to put it. I noticed that creating a datastore using the web UI will create a folder in /mnt/datastore.

    Code:
    mkdir /mnt/proxmox-backup
    mount /dev/sdx1 /mnt/proxmox-backup
  4. You'll also want to update your /etc/fstab so this drive is mounted on startup. What is important is the _netdev flag, This will ensure that the network stack is ready to connect the iSCSI drive during boot up.
    Code:
    /dev/sdx1 /mnt/proxmox-backup ext4 _netdev 0 0
  5. Finally create the PBS datastore using:
    Code:
    proxmox-backup-manager datastore create backups /mnt/proxmox-backup

    1619755960614.png
You should then be able to see the datastore in PBS. I couldn't get the iSCSI drive to appear in the "Storage / Disks" and do the setup there.

Add the PBS server as storage in Proxmox VE 6.3+

1619755866586.png

Again, not sure if this is the right way of setting this up. But hopefully this can get some conversation going. I'd also be interested to know if people have pros and cons with actually utilizing this kind of setup. I don't have much space for physical servers so it really lets me leverage this main VM server I have. I'm curious about the differences of using ZFS or creating LVMs for these datastores.
 
Code:
mkdir /mnt/proxmox-backup
mount /dev/sdx1 /mnt/proxmox-backup
  1. You'll also want to update your /etc/fstab so this drive is mounted on startup. What is important is the _netdev flag, This will ensure that the network stack is ready to connect the iSCSI drive during boot up.
    Code:
    /dev/sdx1 /mnt/proxmox-backup ext4 _netdev 0 0
Hi All,

Just as a heads-up: In case you have several iscsi targets (happens to the best :-) ) please use blkid / uuid in /etc/fstab - that way you don't have effects in case the sd-devices get renumbered on reboot.

Tobias
 
Hey there @zenopka , I created an account explicitly to say 'thank you' for this post. To expound on this, your steps pointed me in the right direction for using an NFS Mount as a datastore in PBS!

Thank you so much for the insight!
 
  • Like
Reactions: spetrillo
I am having trouble mounting the storage to my PVE server. Could someone let me know how to do this in the GUI?
 
Very helpful.

But iscsi-tools are also in newest 3.3 not available. Installing with

Code:
apt install open-iscsi

I've created the target as LVM module, increasing with additional LUNs is easier, then resizing the LUN.

Cheers.
 
  • Like
Reactions: richik75

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!