On Sat, Nov 28, 2009 at 11:28 AM, Mark Harvey <markh794@xxxxxxxxx> wrote: > Bingo.. > > Found the problem. > > tgtd: tgt_mgmt(336) 184 0 2 5 1 0 4 targetOps > mode_page=0x1d:0:0x12:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0, 2491 > > This page is the 'Element Address Assignment' page and should be filled in: > > byte 1: Parameter Len 0x12 > byte 2-3: Medium Transport Element Address > byte 4-5: Number of medium transport elements > byte 6-7: First Storage Element > byte 8-9: Number of Storage Elements > bytes 10-11: First Import/Export element address > bytes 12-13: Number Import/Export elements > bytes 14-15: First data transfer element address > bytes 16-17: Number of data transfer elements > bytes 18-19: Reserved (0) > So, when the MODE PAGE 0x1d "tgtd: tgt_mgmt(336) 184 0 2 5 1 0 4 targetOps mode_page=0x1d:0:0x12:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0, 2491" is sent AFTER the setup sequence of: tgtadm --lld iscsi --op update --mode logicalunit --tid 1 --lun=4 --params "element_type=4,start_address=500,quantity=3,media_home=/root/btapes" tgtadm --lld iscsi --op update --mode logicalunit --tid 1 --lun=4 --params "element_type=4,address=500,tid=1,lun=1" tgtadm --lld iscsi --op update --mode logicalunit --tid 1 --lun=4 --params "element_type=4,address=500,tid=1,lun=2" tgtadm --lld iscsi --op update --mode logicalunit --tid 1 --lun=4 --params "element_type=4,address=500,tid=1,lun=3" All the values are 'reset' to 0.. I'll add a check for null values and throw a warning (Tomo, should I call assert() ??) if it occurs. Cheers Mark > > On Sat, Nov 28, 2009 at 11:03 AM, FUJITA Tomonori > <fujita.tomonori@xxxxxxxxxxxxx> wrote: >> On Fri, 27 Nov 2009 21:08:26 +0100 >> Albert Pauw <albert.pauw@xxxxxxxxx> wrote: >> >>> On 11/27/2009 10:49 AM, Tomasz Chmielewski wrote: >>> > Albert Pauw wrote: >>> > >>> >> The most obvious difference is that the mode_pages are set up before >>> >> defining the element types in my script, while the >>> >> targets.conf version does it the other way round. The other thing is >>> >> that the script defines one separate media_home, while >>> >> the targets.conf version defines the same media_home for every >>> >> element_type. >>> > >>> > Could you check what makes a difference here? >>> > >>> > 1. In the output generated by tgt-admin, set mode_page before defining >>> > element types >>> Bingo, moved the following before the mode page in my manual script, >>> just like tgt-admin does: >> >> Your targets.conf defines 'mode_page' before 'params'. So if tgt-admin >> calls 'update' in the order of definitions, then it should be fine. >> >> Tomasz, is it possible to change tgt-admin in that way? >> -- >> To unsubscribe from this list: send the line "unsubscribe stgt" in >> the body of a message to majordomo@xxxxxxxxxxxxxxx >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> > -- To unsubscribe from this list: send the line "unsubscribe stgt" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html