tgt needs restart to find LUN

Bug #1048008 reported by Dave Gilbert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tgt (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

I've got a KVM guest running Quantal server (as per CD install 2012-09-01) and it runs tgtd with a single target
(the target is an LVM lv - I'll attach any configs that apport hasn't attached)

If I just boot the vm, the guests don't see the disc - when they log in they just see the 'controller' (LUN 0),
if I restart tgtd then they see the disc (LUN 1).

I've edited /etc/init/tgt.conf to add the flag to specify two portals and to turn on debug.

Dave

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: tgt 1:1.0.17-1ubuntu2
ProcVersionSignature: Ubuntu 3.5.0-13.14-generic 3.5.3
Uname: Linux 3.5.0-13-generic x86_64
ApportVersion: 2.5.1-0ubuntu4
Architecture: amd64
Date: Sat Sep 8 21:55:14 2012
InstallationMedia: Ubuntu-Server 12.10 "Quantal Quetzal" - Alpha amd64 (20120901)
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: tgt
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.init.tgt.conf: 2012-09-08T21:51:30.593039

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :
Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

This is the tgt conf that specifies the target:

root@server1:/var/log# cat /etc/tgt/conf.d/dag.conf

# Sample target with one LUN only. Defaults to allow access for all initiators:
#
#iSNSServerIP 192.168.122.10
#iSNSServerPort 3205
#iSNSAccessControl On
#iSNS On

<target iqn.2008-09.com.example:server1.share1>
    backing-store /dev/mapper/server1-share1
</target>

Revision history for this message
James Page (james-page) wrote :

Hi Dave

Do you see any output during first boot which would indicate why tgt does not present the LUN? I think this may be some sort of race condition between tgt startup and the device mapper having detected all devices.

It would be good if you could also try using a file as a backing-store to see if you get the same problem.

Changed in tgt (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
James Page (james-page) wrote :

Dave

I've not been able to reproduce your issue using a quantal KVM instance.

Please could you run:

   sudo tgtadm --lld iscsi --mode target --op show

when you see the issue - hopefully this will tell us a bit more.

Thanks

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :
Download full text (4.0 KiB)

Hi James,
  I agree it's likely to be an lvm/udev race; some observations:
     1) It doesn't seem to happen with files
     2) With lvm, It doesn't always happen if the guest is configured with a single core; most of the time but not always
     3) With lvm it seems to happen (almost?) always when the guest has multiple cores.

output of tgtadm as requested:

----- lvm based, bad ---

Target 1: iqn.2008-09.com.example:server1.share1
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 1
            Initiator: iqn.2005-03.org.open-iscsi:2b2883cd283
            Connection: 0
                IP Address: 192.168.123.12
        I_T nexus: 2
            Initiator: iqn.2005-03.org.open-iscsi:2b2883cd282
            Connection: 0
                IP Address: 192.168.122.12
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET 00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
    Account information:
    ACL information:
        ALL

--- LVM based, after restarting tgt ---

Target 1: iqn.2008-09.com.example:server1.share1
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 1
            Initiator: iqn.2005-03.org.open-iscsi:2b2883cd283
            Connection: 0
                IP Address: 192.168.123.12
        I_T nexus: 2
            Initiator: iqn.2005-03.org.open-iscsi:2b2883cd282
            Connection: 0
                IP Address: 192.168.122.12
        I_T nexus: 3
            Initiator: iqn.2005-03.org.open-iscsi:2b2883cd283
            Connection: 0
                IP Address: 192.168.123.12
        I_T nexus: 4
            Initiator: iqn.2005-03.org.open-iscsi:2b2883cd282
            Connection: 0
                IP Address: 192.168.122.12
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET 00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 1
            Type: disk
            SCSI ID: IET 00010001
            SCSI SN: beaf11
            Size: 10737 MB, Block size: 512
            Online: Yes
            Removable media: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/mapper/server1-share1
            Backing store flags:
    Account information:
    ACL information:
        ALL

(can also see the client accessing it there)

--- file based, good ---

Target 1: iqn.2008-09.com.example:server1.share1
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 5
            Initiator: iqn.2005-03.org.open-iscsi:2b2883cd283
            Connection: 0
                IP Address: 192.168.123.12
        I_T ...

Read more...

Changed in tgt (Ubuntu):
status: Incomplete → New
Revision history for this message
Тимофей (nefelim4ag) wrote :

tgt-admin -e
for updating configuration

Changed in tgt (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.