From owner-freebsd-stable@FreeBSD.ORG Sun Jul 13 18:19:46 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 589721065677 for ; Sun, 13 Jul 2008 18:19:46 +0000 (UTC) (envelope-from sven@dmv.com) Received: from smtp-gw-cl-d.dmv.com (smtp-gw-cl-d.dmv.com [216.240.97.42]) by mx1.freebsd.org (Postfix) with ESMTP id 23F6E8FC14 for ; Sun, 13 Jul 2008 18:19:45 +0000 (UTC) (envelope-from sven@dmv.com) Received: from mail-gw-cl-b.dmv.com (mail-gw-cl-b.dmv.com [216.240.97.39]) by smtp-gw-cl-d.dmv.com (8.12.10/8.12.10) with ESMTP id m6DHr5N0042720 for ; Sun, 13 Jul 2008 13:53:05 -0400 (EDT) (envelope-from sven@dmv.com) Received: from [192.168.0.101] (c-71-200-111-79.hsd1.md.comcast.net [71.200.111.79]) (authenticated bits=0) by mail-gw-cl-b.dmv.com (8.12.9/8.12.9) with ESMTP id m6DHr3ee055244 for ; Sun, 13 Jul 2008 13:53:05 -0400 (EDT) (envelope-from sven@dmv.com) Message-ID: <487A40FE.7030102@dmv.com> Date: Sun, 13 Jul 2008 13:53:02 -0400 From: Sven W User-Agent: Thunderbird 2.0.0.14 (X11/20080508) MIME-Version: 1.0 To: freebsd-stable@freebsd.org X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.48 on 216.240.97.42 X-Scanned-By: MIMEDefang 2.48 on 216.240.97.39 Subject: Using iscsi with multiple targets X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2008 18:19:46 -0000 FreeBSD 7.0 I have 2 machines with identical configurations/hardware, let's call them A (master) and B (slave). I have installed iscsi-target from ports and have set up 3 targets representing the 3 drives I wish to be connected to from A. The Targets file: # extents file start length extent0 /dev/da1 0 465GB extent1 /dev/da2 0 465GB extent2 /dev/da3 0 465GB # target flags storage netmask target0 rw extent0 192.168.0.1/24 target1 rw extent1 192.168.0.1/24 target2 rw extent2 192.168.0.1/24 I then start up iscsi_target and all is good. Now on A I have set up my /etc/iscsi.conf file as follows: # cat /etc/iscsi.conf data1 { targetaddress=192.168.0.252 targetname=iqn.1994-04.org.netbsd.iscsi-target:target0 initiatorname=iqn.2005-01.il.ac.huji.cs::BSD-2-1.sven.local } data2 { targetaddress=192.168.0.252 targetname=iqn.1994-04.org.netbsd.iscsi-target:target1 initiatorname=iqn.2005-01.il.ac.huji.cs::BSD-2-1.sven.local } data3 { targetaddress=192.168.0.252 targetname=iqn.1994-04.org.netbsd.iscsi-target:target2 initiatorname=iqn.2005-01.il.ac.huji.cs::BSD-2-1.sven.local } So far so good, now come the issues. First of all, it would appear that with iscontrol one can only start one "named" session at a time; for example /sbin/iscontrol -n data1 /sbin/iscontrol -n data2 /sbin/isconrtol -n data3 I guess that is ok, except that each invocation of iscontrol resets the other sessions. Here is the camcontrol and dmesg output from running the above 3 commands. # camcontrol devlist at scbus0 target 0 lun 0 (pass0,da0) at scbus0 target 1 lun 0 (pass1,da1) at scbus0 target 2 lun 0 (pass2,da2) at scbus0 target 3 lun 0 (pass3,da3) at scbus1 target 0 lun 0 (da5,pass5) at scbus1 target 1 lun 0 (da6,pass6) at scbus1 target 2 lun 0 (da4,pass4) [ /sbin/iscontrol -n data1 ] da4 at iscsi0 bus 0 target 0 lun 0 da4: Fixed Direct Access SCSI-3 device [ /sbin/iscontrol -n data2 ] (da4:iscsi0:0:0:0): lost device (da4:iscsi0:0:0:0): removing device entry da4 at iscsi0 bus 0 target 0 lun 0 da4: Fixed Direct Access SCSI-3 device da5 at iscsi0 bus 0 target 1 lun 0 da5: Fixed Direct Access SCSI-3 device [ /sbin/iscontrol -n data3 ] (da4:iscsi0:0:0:0): lost device (da4:iscsi0:0:0:0): removing device entry (da5:iscsi0:0:1:0): lost device (da5:iscsi0:0:1:0): removing device entry da4 at iscsi0 bus 0 target 2 lun 0 da4: Fixed Direct Access SCSI-3 device da5 at iscsi0 bus 0 target 0 lun 0 da5: Fixed Direct Access SCSI-3 device da6 at iscsi0 bus 0 target 1 lun 0 da6: Fixed Direct Access SCSI-3 device It would appear that rather than appending the new device to the end of the "da" devices, it starts to do some type of naming queue after the second device. If I am to use these devices in any type of automated setup, how can make sure that after these commands, "da6" will always be target 1 (i.e. /dev/da2 on the slave machine). Next, there is no "startup" script for iscontrol - would that simply have to be added the system or is there a way with sysctl that it could be done. The plan here is use gmirror such that /dev/da1 on A is mirrored with the /dev/da1 on B using iscsi. Sven