From 0b52a47e99db78d67fd2eb92503555c123d92d5e Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Wed, 14 Feb 2024 19:01:18 -0700 Subject: [PATCH] Add Servers & Workflows/Linux/Virtualization/Proxmox/ZFS-Over-iSCSI.md --- .../Virtualization/Proxmox/ZFS-Over-iSCSI.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Servers & Workflows/Linux/Virtualization/Proxmox/ZFS-Over-iSCSI.md diff --git a/Servers & Workflows/Linux/Virtualization/Proxmox/ZFS-Over-iSCSI.md b/Servers & Workflows/Linux/Virtualization/Proxmox/ZFS-Over-iSCSI.md new file mode 100644 index 0000000..cb8275c --- /dev/null +++ b/Servers & Workflows/Linux/Virtualization/Proxmox/ZFS-Over-iSCSI.md @@ -0,0 +1,34 @@ +**Purpose**: There is a way to incorporate ProxmoxVE and TrueNAS more deeply using SSH, simplifying the deployment of virtual disks/volumes passed into GuestVMs in ProxmoxVE. Using ZFS over iSCSI will give you the following non-exhaustive list of benefits: + +- Automatically make Zvols in a ZFS Storage Pool +- Automatically bind device-based iSCSI Extents/LUNs to the Zvols +- Allow TrueNAS to handle VM snapshots directly +- Simplify the filesystem overhead of using TrueNAS and iSCSI with ProxmoxVE + +!!! note "Environment Assumptions" + This document assumes you are running at least 2 ProxmoxVE nodes. For the sake of the example, it will assume they are named `proxmox-node-01` and `proxmox-node-02`. We will also assume you are using TrueNAS Core. TrueNAS SCALE (should work) in the same way, but there may be minor operational / setup differences between the two different deployments of TrueNAS. + +## Configure SSH Key Exchange +The first step is creating SSH trust between the ProxmoxVE cluster nodes and the TrueNAS storage appliance. You will leverage the ProxmoxVE `shell` to run the following commands. +``` sh +mkdir /etc/pve/priv/zfs +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 -i /etc/pve/priv/zfs/192.168.101.100_id_rsa root@192.168.101.100 # (3) +apt-get install librest-client-perl git # (4) +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 # (5) +``` + + 1. Do not set a password. It will break the automatic functionality. + 2. Send the SSH key to the TrueNAS server. + 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. + + +| **IP Address** | **Hostname** | **Additional Notes** | +| :--- | :--- | :--- | +| 192.168.5.1 | PFSENSE | pfSense Firewall | \ No newline at end of file