Proxmox ISCSI Anbindung: Unterschied zwischen den Versionen
| Zeile 1: | Zeile 1: | ||
| − | = Einrichtung von ZFS over iSCSI in Proxmox mit LIO auf | + | = Einrichtung von ZFS over iSCSI in Proxmox mit LIO auf Debian = |
== Einleitung == | == Einleitung == | ||
| − | Diese Anleitung beschreibt die vollständige Einrichtung | + | Diese Anleitung beschreibt die vollständige Einrichtung eines iSCSI-Servers mit ZFS-Backend unter Debian 12 mithilfe von LIO (Linux-IO Target) sowie die Integration in Proxmox VE als "ZFS over iSCSI"-Speicher. |
| − | == | + | == Repository vorbereiten (contrib aktivieren) == |
| − | + | Bearbeite die Paketquellen: | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | Bearbeite die | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| − | + | nano /etc/apt/sources.list | |
</syntaxhighlight> | </syntaxhighlight> | ||
| − | Füge | + | Füge contrib zu den Hauptzeilen hinzu: |
<syntaxhighlight> | <syntaxhighlight> | ||
| − | deb http:// | + | deb http://deb.debian.org/debian bookworm main contrib |
</syntaxhighlight> | </syntaxhighlight> | ||
| − | + | Aktualisiere die Paketliste: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| − | + | apt update | |
</syntaxhighlight> | </syntaxhighlight> | ||
| − | == ZFS und | + | == ZFS und LIO installieren == |
| − | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| − | + | apt install zfsutils-linux targetcli-fb | |
</syntaxhighlight> | </syntaxhighlight> | ||
| − | == ZFS-Pool und | + | == ZFS-Pool und zvol erstellen == |
| − | Erstelle einen ZFS-Pool: | + | Erstelle einen ZFS-Pool auf einer freien Partition oder Disk: |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| − | zpool create pool1 /dev/ | + | zpool create pool1 /dev/sdb1 |
</syntaxhighlight> | </syntaxhighlight> | ||
| − | + | Erzeuge ein zvol (blockbasiertes Volume): | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| − | zfs create -V 10G pool1/ | + | zfs create -V 10G pool1/vol1 |
</syntaxhighlight> | </syntaxhighlight> | ||
== iSCSI-Target mit LIO einrichten == | == iSCSI-Target mit LIO einrichten == | ||
| − | Starte die | + | Starte die Konfiguration: |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
targetcli | targetcli | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | + | Backstore aus dem zvol erstellen: | |
| − | <syntaxhighlight | + | <syntaxhighlight> |
| + | cd /backstores/block | ||
| + | create zfsvol /dev/zvol/pool1/vol1 | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | iSCSI-Target erstellen: | ||
| + | <syntaxhighlight> | ||
cd /iscsi | cd /iscsi | ||
| − | create iqn. | + | create iqn.2025-07.net.example:storage |
| + | </syntaxhighlight> | ||
| + | |||
| + | Backstore als LUN zuweisen: | ||
| + | <syntaxhighlight> | ||
| + | cd /iscsi/iqn.2025-07.net.example:storage/tpg1/luns | ||
| + | create /backstores/block/zfsvol | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | + | ACL für Proxmox-Initiator erstellen: | |
| − | <syntaxhighlight | + | <syntaxhighlight> |
| − | + | cd /iscsi/iqn.2025-07.net.example:storage/tpg1/acls | |
| − | + | create iqn.2025-07.net.proxmox:initiator | |
| − | cd /iscsi/iqn. | ||
| − | create | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | + | TargetCLI verlassen: | |
| − | + | <syntaxhighlight> | |
| − | <syntaxhighlight | + | exit |
| − | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | + | == SSH-Schlüssel für Proxmox vorbereiten == | |
| + | Auf dem Proxmox-Host: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| + | ssh-keygen -f /etc/pve/priv/zfs/10.0.10.210:3260_id_rsa | ||
ssh-copy-id -i /etc/pve/priv/zfs/10.0.10.210:3260_id_rsa.pub root@10.0.10.210 | ssh-copy-id -i /etc/pve/priv/zfs/10.0.10.210:3260_id_rsa.pub root@10.0.10.210 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | == | + | == Proxmox: Speicher hinzufügen == |
| − | + | In der Proxmox-Oberfläche: | |
| + | Datacenter → Storage → Add → ZFS over iSCSI | ||
| − | * ID: | + | Einstellungen: |
| − | * Portal: 10.0.10.210 | + | * ID: zfs-iscsi |
| − | * Pool: pool1 | + | * Portal: 10.0.10.210 |
| − | * Target: iqn. | + | * Pool: pool1 |
| + | * Target: iqn.2025-07.net.example:storage | ||
* Target Portal Group: 1 | * Target Portal Group: 1 | ||
| + | * iSCSI Provider: LIO | ||
| + | * Blocksize: 4k | ||
| + | * Write Cache: aktiviert | ||
| + | * Thin Provisioning: optional | ||
== Testen == | == Testen == | ||
| − | Erstelle eine VM oder | + | Erstelle eine neue VM oder Container auf dem ZFS-iSCSI-Speicher. |
| + | Verifiziere Snapshots, Clones und Performance. | ||
| − | + | == Fehlerbehebung == | |
| + | * systemctl status rtslib-fb-targetctl | ||
| + | * targetcli ls | ||
| + | * Port 3260 erreichbar? (Firewall) | ||
Version vom 8. Juli 2025, 15:37 Uhr
Einrichtung von ZFS over iSCSI in Proxmox mit LIO auf Debian
Einleitung
Diese Anleitung beschreibt die vollständige Einrichtung eines iSCSI-Servers mit ZFS-Backend unter Debian 12 mithilfe von LIO (Linux-IO Target) sowie die Integration in Proxmox VE als "ZFS over iSCSI"-Speicher.
Repository vorbereiten (contrib aktivieren)
Bearbeite die Paketquellen:
nano /etc/apt/sources.list
Füge contrib zu den Hauptzeilen hinzu:
deb http://deb.debian.org/debian bookworm main contribAktualisiere die Paketliste:
apt update
ZFS und LIO installieren
apt install zfsutils-linux targetcli-fb
ZFS-Pool und zvol erstellen
Erstelle einen ZFS-Pool auf einer freien Partition oder Disk:
zpool create pool1 /dev/sdb1
Erzeuge ein zvol (blockbasiertes Volume):
zfs create -V 10G pool1/vol1
iSCSI-Target mit LIO einrichten
Starte die Konfiguration:
targetcli
Backstore aus dem zvol erstellen:
cd /backstores/block
create zfsvol /dev/zvol/pool1/vol1iSCSI-Target erstellen:
cd /iscsi
create iqn.2025-07.net.example:storageBackstore als LUN zuweisen:
cd /iscsi/iqn.2025-07.net.example:storage/tpg1/luns
create /backstores/block/zfsvolACL für Proxmox-Initiator erstellen:
cd /iscsi/iqn.2025-07.net.example:storage/tpg1/acls
create iqn.2025-07.net.proxmox:initiatorTargetCLI verlassen:
exitSSH-Schlüssel für Proxmox vorbereiten
Auf dem Proxmox-Host:
ssh-keygen -f /etc/pve/priv/zfs/10.0.10.210:3260_id_rsa
ssh-copy-id -i /etc/pve/priv/zfs/10.0.10.210:3260_id_rsa.pub root@10.0.10.210
Proxmox: Speicher hinzufügen
In der Proxmox-Oberfläche: Datacenter → Storage → Add → ZFS over iSCSI
Einstellungen:
- ID: zfs-iscsi
- Portal: 10.0.10.210
- Pool: pool1
- Target: iqn.2025-07.net.example:storage
- Target Portal Group: 1
- iSCSI Provider: LIO
- Blocksize: 4k
- Write Cache: aktiviert
- Thin Provisioning: optional
Testen
Erstelle eine neue VM oder Container auf dem ZFS-iSCSI-Speicher. Verifiziere Snapshots, Clones und Performance.
Fehlerbehebung
- systemctl status rtslib-fb-targetctl
- targetcli ls
- Port 3260 erreichbar? (Firewall)