Re: how to script with targetcli

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Thomas--this is basically where I'm at now, too.

The only difference is that I run each line one by one, and look for
the success messages that the particular command generates before
moving on to the next command (I'm calling this from an application
that needs to convey back to a client if it succeeded or failed)

Running each command, capturing it's output, and working it into code
was pretty  tedious, but I had only about 9 unique commands of
interest, so it ultimately it took me a few hours.  Just boring hours,
and code that's probably fragile.

Seth

On Sat, Oct 12, 2013 at 1:25 AM, Thomas Glanzmann <thomas@xxxxxxxxxxxx> wrote:
> Hello Seth,
> I currently use a perl script to generate the configuration and pipe
> that in targetcli/rtsadmin:
>
> set global auto_cd_after_create=false
> /backstores/fileio create shared-01.v101.campusvl.de /iscsi1/shared-01.v101.campusvl.de size=80G buffered=true
> /backstores/fileio create shared-02.v101.campusvl.de /iscsi2/shared-02.v101.campusvl.de size=80G buffered=true
>
> /iscsi create iqn.2013-03.de.campusvl.v101.storage:shared-01.v101.campusvl.de
> /iscsi/iqn.2013-03.de.campusvl.v101.storage:shared-01.v101.campusvl.de/tpgt1/portals create 10.101.0.4
> /iscsi/iqn.2013-03.de.campusvl.v101.storage:shared-01.v101.campusvl.de/tpgt1/portals create 10.101.0.5
> /iscsi/iqn.2013-03.de.campusvl.v101.storage:shared-01.v101.campusvl.de/tpgt1/luns create /backstores/fileio/shared-01.v101.campusvl.de lun=10
> /iscsi/iqn.2013-03.de.campusvl.v101.storage:shared-01.v101.campusvl.de/tpgt1/ set attribute authentication=0 emulate_tpu=1 emulate_tpws=1 demo_mode_discovery=1
>
> /iscsi create iqn.2013-03.de.campusvl.v101.storage:shared-02.v101.campusvl.de
> /iscsi/iqn.2013-03.de.campusvl.v101.storage:shared-02.v101.campusvl.de/tpgt1/portals create 10.101.0.4
> /iscsi/iqn.2013-03.de.campusvl.v101.storage:shared-02.v101.campusvl.de/tpgt1/portals create 10.101.0.5
> /iscsi/iqn.2013-03.de.campusvl.v101.storage:shared-02.v101.campusvl.de/tpgt1/luns create /backstores/fileio/shared-02.v101.campusvl.de lun=20
> /iscsi/iqn.2013-03.de.campusvl.v101.storage:shared-02.v101.campusvl.de/tpgt1/ set attribute authentication=0 emulate_tpu=1 emulate_tpws=1 demo_mode_discovery=1
> ...
>
> saveconfig
> yes
>
> Cheers,
>         Thomas
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux