[Stgt-devel] [PATCH] iscsi: add assign_lun script

Erez Zilber erezz
Tue Jan 1 12:50:07 CET 2008


FUJITA Tomonori wrote:
> From: Erez Zilber <erezz at voltaire.com>
> Subject: [Stgt-devel] [PATCH] iscsi: add assign_lun script
> Date: Sun, 30 Dec 2007 10:51:16 +0200
>
>   
>> Add a script that will create a target, add a device to
>> the target and define the initiator that can connect to it.
>>     
>
> Can you move this to usr/scripts? I guess that this could be improved
> to handle other protocols later on.
>   

I will.

> There would be a better name since this script does more than
> assigning a logical unit, that is, creates a new target, add a lun,
> and enable an initiator to access to the target.
>   

In the (near) future I would like to enhance this script, so it will not
always create a new target (e.g. add a device to a target that already
exists if the user wants). So, the main thing that this script does is
to setup a lun. How about "setup_lun"? Do you have other ideas?

>
>   
>> Signed-off-by: Erez Zilber <erezz at voltaire.com>
>> ---
>>  usr/iscsi/scripts/assign_lun |  127 ++++++++++++++++++++++++++++++++++++++++++
>>  1 files changed, 127 insertions(+), 0 deletions(-)
>>  create mode 100755 usr/iscsi/scripts/assign_lun
>>     
>
> (snip)
>
>
>   
>> +#!/bin/bash
>> +
>> +verify_params()
>> +{
>> +	# Make sure that the device exists
>> +	if ! [ -b $dev ]; then
>> +		echo "$dev is not a device";
>> +		exit 1;
>>     
>
> Hmm, would be better to have:
>
>         if ! [ -b $dev -o -f $dev ]; then
>
> We can use a regular file as a logical unit.
>   

OK



More information about the stgt mailing list