Add controller_tid option to targets.conf to allow admins to configure SCSI ID and SCSI SN for controller (lun 0), making them unique across tgt servers. Signed-off-by: Fredrik Åslund <fredrik.aslund at ladok.umu.se> --- tgt-1.0.17/conf/examples/targets.conf.example | 17 +++++++++++++--- tgt-1.0.17/scripts/tgt-admin | 4 +++ 2 files changed, 18 insertions(+), 3 deletions(-) diff -uprN tgt-1.0.17.orig/conf/examples/targets.conf.example tgt-1.0.17/conf/examples/targets.conf.example --- tgt-1.0.17.orig/conf/examples/targets.conf.example 2011-05-30 02:54:07.000000000 +0200 +++ tgt-1.0.17/conf/examples/targets.conf.example 2011-06-21 08:44:49.000000000 +0200 @@ -181,6 +181,8 @@ default-driver iscsi # Outgoing user outgoinguser userA secretpassA + # TID of controller + controller_tid 10 </target> @@ -211,20 +213,29 @@ default-driver iscsi allow-in-use yes </target> +# Specify controller TID of target +# Must be unique for all targets +# To reduce risk of duplicating controller TIDs, specify TID for all targets +# or none +<target iqn.2008-09.com.example:server.target9> + backing-store /dev/LVM/somedevice + allow-in-use yes + controller_tid 10 +</target> # Not supported configurations, and therefore, commented out: -#<target iqn.2008-09.com.example:server.target9> +#<target iqn.2008-09.com.example:server.badtarget1> # backing-store /dev/LVM/somedevice1 # backing-store /dev/LVM/somedevice2 # lun 10 # lun 11 #</target> -#<target iqn.2008-09.com.example:server.target10> +#<target iqn.2008-09.com.example:server.badtarget2> # <direct-store /dev/sdd> # vendor_id VENDOR1 # </direct-store> @@ -234,7 +245,7 @@ default-driver iscsi # This one will break the parser: -#<target iqn.2008-09.com.example:server.target11> +#<target iqn.2008-09.com.example:server.badtarget3> # <direct-store /dev/sdd> # vendor_id VENDOR1 # </direct-store> diff -uprN tgt-1.0.17.orig/scripts/tgt-admin tgt-1.0.17/scripts/tgt-admin --- tgt-1.0.17.orig/scripts/tgt-admin 2011-05-30 02:54:07.000000000 +0200 +++ tgt-1.0.17/scripts/tgt-admin 2011-06-21 08:45:31.000000000 +0200 @@ -284,6 +284,10 @@ sub add_targets { $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; } /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 |