We have Longhorn working in our clusters but only recently. I am by no means an expert. I will share my config notes, in the hopes it helps you. We run RKE2 on-top of Ubuntu VMs in vSphere.
Disk Pre-Requisites :
Add second virtual hard disk to Ubuntu node
Prep the drive as follows
lsblk (get /dev/sd* from this list)
mkdir -p /mnt/longhorn
• parted /dev/sdb mklabel gpt (or whatever the free device was from lsblk)
• parted -a opt /dev/sdb mkpart primary ext4 0% 100%
• lsblk
• mkfs.ext4 -L longhorn /dev/sdb1
• lsblk -o NAME,FSTYPE,LABEL,UUID,MOUNTPOINT
Add entry to fstab to maintain persistence across reboots :
LABEL=longhorn /mnt/longhorn ext4 defaults 0 2
mount -a
• df -Th (make sure volume is mounted)
Ubuntu Pre-Requisites :
Make sure the following packages are installed
• open-iscsi and nfs-common
Disable multipathd :
• systemctl stop multipathd && systemctl disable multipathd
Load dm_crypt kernel module :
• lsmod | grep dm_crypt (if no output load the module from steps below)
• modprobe dm-crypt
• echo dm-crypt | tee -a /etc/modules (for persistence)
Load iscsi_tcp kernel module :
• modprobe iscsi_tcp
• lsmod | grep iscsi_tcp (check if it loaded)
• echo iscsi_tcp | tee -a /etc/modules (for persistence)
Mount volume to Longhorn :
From Rancher, access the Longhorn GUI. Repeat steps below for each node
Select Node from the top menu bar
• Select Edit Node and Disks from the Operations Dropdown
Disable Scheduling for the default-disk
The Garbage Can icon will become selectable. Click it to delete this volume
Click Add Disk
Accept default Name and Disktype
• Enter /mnt/longhorn under Path
Enable Scheduling
Click Save
Wait for all nodes to show Schedulable under Status
• Click Dashboard in the top menu bar and make sure there are no errors