ISCSI LUN is not exported after restart

Help with issues regarding installation of Debian

ISCSI LUN is not exported after restart

Postby DonCanalie » 2020-04-29 21:11

Hi,

I have a problem with tgt on Debian Buster. Namely, a target, which works normally, after a restart of tgt or after

tgt-admin --update ALL

will not automatically be exported.

Code: Select all
root@myhost:/# tgtadm --lld iscsi --op show --mode target
Target 1: iqn.2020-2.local.mydomain.myhost:lun2
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            SWP: No
            Thin-provisioning: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
    Account information:
    ACL information:
        192.168.220.0/29
        192.168.221.0/29
        192.168.200.0/24


It only works if I export the LUN manually

Code: Select all
root@myhost:/# tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /dev/sda
root@myhost:/# tgtadm --lld iscsi --op show --mode target
Target 1: iqn.2020-2.local.mydomain.myhost:lun2
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            SWP: No
            Thin-provisioning: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 2046283 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            SWP: No
            Thin-provisioning: No
            Backing store type: rdwr
            Backing store path: /dev/sda
            Backing store flags:
    Account information:
    ACL information:
        192.168.220.0/29
        192.168.221.0/29
        192.168.200.0/24


Here is my configuration

Code: Select all
root@myhost:/# tgt-admin --dump
default-driver iscsi

<target iqn.2020-2.local.mydomain.myhost:lun2>
        backing-store /dev/sda
        initiator-name 192.168.220.0/29
        initiator-name 192.168.221.0/29
        initiator-name 192.168.200.0/24
</target>


Does anyone know what this is and what needs to be done so that the LUN is automatically exported after a restart?
DonCanalie
 
Posts: 5
Joined: 2014-10-20 11:53

Re: ISCSI LUN is not exported after restart

Postby DonCanalie » 2020-04-30 01:36

I solved it.

It works if you add

allow-in-use yes

to the target-config. That's what you get when you execute

tgt-admin -e -v
DonCanalie
 
Posts: 5
Joined: 2014-10-20 11:53


Return to Installation

Who is online

Users browsing this forum: No registered users and 10 guests

fashionable