[stgt] Specify controller tid in targets.conf

Fredrik Åslund fredrik.aslund at adm.umu.se
Thu Jun 16 09:38:30 CEST 2011


On Thu, 16 Jun 2011, frederik.vos at linvirt.nl wrote:

> In our VMware environment, we're using the following configuration,  
> and it works (also with the vmware nmp multipathing method). It's  
> already possible to specify vendor and scsi_id (the scsi id will  
> become the T10 address), but you'll have to use the direct-store method
> 
> <target iqn.2004-01.nl.xtg:iscsi-server1>
>          direct-store /dev/sdb
>          initiator-address ALL
>          incominguser xxxx xxxx
>          scsi_id 00010001
>          vendor_id XTG
>          lun 12
> </target>
> 
I believe this may still result in several tgt servers running with the 
same scsi id and scsi sn.

What SCSI ID and SCSI SN do you get for LUN 0 of your targets for your 
different tgt servers? Run:

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

I get

  LUN: 0
    Type: controller
    SCSI ID: IET     00010000
    SCSI SN: beaf10

for the first target of all tgt servers. With the same scsi id and
scsi sn on several tgt servers, VMware believes they are different paths 
to the same controller.

/Fredrik

> MaxRecvDataSegmentLength 131072
> MaxXmitDataSegmentLength 131072
> MaxBurstLength 262144
> FirstBurstLength 262144
> TargetRecvDataSegmentLength=262144
> InitiatorRecvDataSegmentLength=262144
> MaxOutstandingUnexpectedPDUs=0
> MaxOutstandingR2T=1
> MaxCommands=128
> 
> DataPDUInOrder=Yes
> DataSequenceInOrder=Yes
> 
> HeaderDigest=None
> DataDigest=None
> InitialR2T=No
> ImmediateData=Yes
> DelayedAck=Yes
> 
> ErrorRecoveryLevel=0
> IFMarker=No
> OFMarker=No
> DefaultTime2Wait=2
> DefaultTime2Retain=0
> OFMarkInt=Reject
> IFMarkInt=Reject
> MaxConnections=4
> RDMAExtensions=No
> 
> 
> Quoting Fredrik Åslund <fredrik.aslund at adm.umu.se>:
> 
> > Is there a way to specify the tid of a target controller in targets.conf?
> >
> > By default, tid 1 is used by tgt-admin. This means that all instances of
> > tgtd at different servers will have the same SCSI ID (and SCSI SN),
> > confusing iSCSI initiators (as VMware).
> >
> > This patch will allow targets.conf to include:
> > --
> > <target iqn.2011-06.com.example:storage1>
> >         backing-store /dev/system/iscsi_storage1
> >         scsi_id storage1_
> >         scsi_sn storage1_
> >
> >         controller_tid 11
> > </target>
> > --
> >
> > --- /usr/sbin/tgt-admin 2010-08-27 00:58:10.000000000 +0200
> > +++ tgt-admin   2011-06-15 16:50:28.000000000 +0200
> > @@ -283,6 +283,10 @@
> >                                                 $target_options_ref  
> > = \%target_options;
> >                                                 $data_key =  
> > make_key($target_options_ref, "lun", "allow-in-use");
> >                                         }
> > +
> > +                                       if (defined  
> > $target_options{"controller_tid"}) {
> > +                                               $next_tid =  
> > $target_options{"controller_tid"};
> > +                                       }
> >
> >                                         if (not defined  
> > $target_options{"driver"}) {
> >                                                  
> > $target_options{"driver"} = $default_driver;
> >
> > Is there a better way to accomplish this?
> >
> > /Fredrik
> >
> > Fredrik Åslund
> > ----------------------------------
> > Systemadministratör
> > IT-stöd och systemutveckling (ITS)
> > Umeå universitet
> > 901 87 Umeå
> > ----------------------------------
> > Telefon: +46 (0)90 786 65 43
> > Mobil:   +46 (0)70 303 78 36
> > ----------------------------------
> > fredrik.aslund at adm.umu.se
> > www.its.umu.se
> 
> 
> 
> 

Fredrik Åslund
----------------------------------
Systemadministratör
IT-stöd och systemutveckling (ITS)
Umeå universitet
901 87 Umeå
----------------------------------
Telefon: +46 (0)90 786 65 43
Mobil:   +46 (0)70 303 78 36
----------------------------------
fredrik.aslund at adm.umu.se
www.its.umu.se


More information about the stgt mailing list