Iscsi im LXC container

pmoscode

New Member
Aug 31, 2022
3
0
1
Moin Zusammen,

ist es möglich innerhalb eines LXC containers den open-iscsi service zu starten und damit ein Block-Device mitels iscsiadm zu mounten?

Ich versuche es gerade, komme aber nicht weiter. So sieht es momentan aus:

Code:
root@k3s-worker-0:/etc/iscsi# service open-iscsi status
* open-iscsi.service - Login to default iSCSI targets
     Loaded: loaded (/lib/systemd/system/open-iscsi.service; enabled; vendor preset: enabled)
     Active: inactive (dead)
  Condition: start condition failed at Sat 2022-09-03 21:54:24 UTC; 2s ago
             |- ConditionDirectoryNotEmpty=|/etc/iscsi/nodes was not met
             `- ConditionDirectoryNotEmpty=|/sys/class/iscsi_session was not met
       Docs: man:iscsiadm(8)
             man:iscsid(8)

Sep 01 21:45:36 k3s-worker-0 systemd[1]: Condition check resulted in Login to default iSCSI targets being skipped.
Sep 03 19:38:07 k3s-worker-0 systemd[1]: Condition check resulted in Login to default iSCSI targets being skipped.
Sep 03 19:38:30 k3s-worker-0 systemd[1]: Condition check resulted in Login to default iSCSI targets being skipped.
Sep 03 20:02:12 k3s-worker-0 systemd[1]: Condition check resulted in Login to default iSCSI targets being skipped.
Sep 03 20:02:33 k3s-worker-0 systemd[1]: Condition check resulted in Login to default iSCSI targets being skipped.
Sep 03 21:54:24 k3s-worker-0 systemd[1]: Condition check resulted in Login to default iSCSI targets being skipped.

root@k3s-worker-0:/etc/iscsi# modprobe iscsi_tcp
modprobe: FATAL: Module iscsi_tcp not found in directory /lib/modules/5.15.35-1-pve

Im Proxmox selbst sind in der Datei /lib/modules-load.d/open-iscsi.conf die Werte iscsi_tcp und ib_iser nicht auskommentiert.

Wenn ich aber iscsiadm -m discovery -t sendtargets -p xxx.xxx.xxx.xxx ausführe (Mit der Iscsi Portal Adresse), dann kommt: cannot make connection to xxx.xxx.xxx.xxx: Connection refused
Aber da gehe ich von aus, dass das ein Folgefehler ist, weil der Service nicht gestartet ist. Ach ja, die beiden Ordner, die im Service die Condition nicht erfüllen, existieren.
Firewall ist nicht aktiv.

Was fehlt mir noch?


Grüße
 
Same problem here when trying to install Longhorn into k3s running inside LXC, open-iscsi is a prerequisite to Longhorn.
 
Im Proxmox selbst sind in der Datei /lib/modules-load.d/open-iscsi.conf die Werte iscsi_tcp und ib_iser nicht auskommentiert.
Aber sind die Module geladen? Das kann der Gast ja nicht veranlassen! lsmod muss das bestätigen. Eventuell hilft ein herzhaftes modprobe iscsi_tcp entsprechend der Fehlermeldung. (Nur geraten, ich verwende keine Container.)
 
iscsi_tcp is loaded inside LXC, I checked that via lsmod:

Code:
root@gns-lxc-jammy-0:~# lsmod|grep iscsi_tcp
iscsi_tcp              24576  0
libiscsi_tcp           32768  1 iscsi_tcp
libiscsi               65536  3 libiscsi_tcp,iscsi_tcp,ib_iser
scsi_transport_iscsi   131072  5 libiscsi_tcp,iscsi_tcp,ib_iser,libiscsi

These are the links I found on the subject:

All of these links lead nowhere, the conclusion is either "it is a known issue" or "no reason to support iscsi" inside LXC. For me the reason is very valid - to be able to run Kubernetes with persistent storage (Longhorn) inside LXC containers. I guess we'll have to wait a bit for this to be supported. For now I switch back to VMs for that particular usecase.
 
Last edited: