Update Servers & Workflows/Linux/Virtualization/Proxmox/ZFS-Over-iSCSI.md

This commit is contained in:
Nicole Rappe
2024-03-08 23:38:00 -07:00
parent 4ecb91763d
commit 126f6ee22f

View File

@ -52,36 +52,38 @@ The first step is creating SSH trust between the ProxmoxVE cluster nodes and the
**Note**: I will be writing the SSH configuration with the name `192.168.101.100` for simplicity so I know what server the identity belongs to. You could also name it something else like `storage.bunny-lab.io_id_rsa`. **Note**: I will be writing the SSH configuration with the name `192.168.101.100` for simplicity so I know what server the identity belongs to. You could also name it something else like `storage.bunny-lab.io_id_rsa`.
``` sh ``` sh
apt-get install librest-client-perl git unzip # (4)
mkdir /etc/pve/priv/zfs mkdir /etc/pve/priv/zfs
ssh-keygen -f /etc/pve/priv/zfs/192.168.101.100_id_rsa # (1) ssh-keygen -f /etc/pve/priv/zfs/192.168.101.100_id_rsa # (1)
ssh-copy-id -i /etc/pve/priv/zfs/192.168.101.100_id_rsa.pub root@192.168.101.100 # (2) ssh-copy-id -i /etc/pve/priv/zfs/192.168.101.100_id_rsa.pub root@192.168.101.100 # (2)
ssh -i /etc/pve/priv/zfs/192.168.101.100_id_rsa root@192.168.101.100 # (3) ssh -i /etc/pve/priv/zfs/192.168.101.100_id_rsa root@192.168.101.100 # (3)
iscsiadm --mode discovery --op update --type sendtargets --portal 192.168.101.100
iscsiadm -m node -T iqn.2005-10.org.moon-storage-01.ctl:proxmox-zfs-storage -p 192.168.101.100 -l
iscsiadm -m node # (5)
iscsiadm -m session # (6)
``` ```
1. Do not set a password. It will break the automatic functionality. 1. Do not set a password. It will break the automatic functionality.
2. Send the SSH key to the TrueNAS server. 2. Send the SSH key to the TrueNAS server.
3. Connect to the TrueNAS server at least once to finish establishing the connection. 3. Connect to the TrueNAS server at least once to finish establishing the connection.
4. Some prerequisites that need to be installed.
5. Making sure that it's actually communicating with the iSCSI target successfully or not.
6. Making sure that it's actually communicating with the iSCSI target successfully or not.
### Install & Configure Storage Provider ### Install & Configure Storage Provider
Now you need to set up the storage provider in TrueNAS via a series of "patches" provided by the community. You will run the commands below within a ProxmoxVE shell, then when finished, log out of the ProxmoxVE WebUI, clear the browser cache for ProxmoxVE, then log back in. This will have added a new storage provider called `FreeNAS-API` under the `ZFS over iSCSI` storage type. Now you need to set up the storage provider in TrueNAS via a series of "patches" provided by the community. You will run the commands below within a ProxmoxVE shell, then when finished, log out of the ProxmoxVE WebUI, clear the browser cache for ProxmoxVE, then log back in. This will have added a new storage provider called `FreeNAS-API` under the `ZFS over iSCSI` storage type.
``` sh ``` sh
cd /tmp keyring_location=/usr/share/keyrings/ksatechnologies-truenas-proxmox-keyring.gpg
wget https://github.com/TheGrandWazoo/freenas-proxmox/archive/refs/tags/v2.2.zip curl -1sLf 'https://dl.cloudsmith.io/public/ksatechnologies/truenas-proxmox/gpg.284C106104A8CE6D.key' | gpg --dearmor >> ${keyring_location}
unzip v2.2.zip
cd freenas-proxmox #################################################################
patch -b /usr/share/pve-manager/js/pvemanagerlib.js < pve-manager/js/pvemanagerlib.js.patch cat << EOF > /etc/apt/sources.list.d/ksatechnologies-repo.list
patch -b /usr/share/perl5/PVE/Storage/ZFSPlugin.pm < perl5/PVE/Storage/ZFSPlugin.pm.patch # Source: KSATechnologies
patch -b /usr/share/pve-docs/api-viewer/apidoc.js < pve-docs/api-viewer/apidoc.js.patch # Site: https://cloudsmith.io
cp perl5/PVE/Storage/LunCmd/FreeNAS.pm /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm # Repository: KSATechnologies / truenas-proxmox
# Description: TrueNAS plugin for Proxmox VE - Production
deb [signed-by=${keyring_location}] https://dl.cloudsmith.io/public/ksatechnologies/truenas-proxmox/deb/debian any-version main
EOF
#################################################################
apt update
apt install freenas-proxmox
apt full-upgrade
systemctl restart pvedaemon systemctl restart pvedaemon
systemctl restart pveproxy systemctl restart pveproxy
systemctl restart pvestatd systemctl restart pvestatd