Re: how to script with targetcli

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

 



Hi Seth,

On Fri, 2013-10-11 at 10:09 -0500, Seth Call wrote:
> I'm porting an application which runs on OpenIndiana.  In OpenIndiana,
> we just invoke itadm and stmfadm to create and destroy ISCSI targets.
> 
> The command targetcli, however, seems a bit unfriendly to scripting in
> this fashion, seeing how it's interactive and all.
> 
> I found this patch, and applied it, and it's allowed me to invoke
> targetcli as a one-liner, like:
> 
> targetcli /iscsi create iqn.a.b.c:x
> 
> Unfortunately, if the command fails, the exit code is still always 0.
> patch: http://www.spinics.net/lists/target-devel/msg01554.html
> 
> But forget my approach for a second--I feel I might be missing how
> this is usually done. Does anyone script using targetcli, or do they
> use some other command instead?
> 

For doing complex scripting things with the target, I'd recommend using
the underlying python rtslib library directly in order to have much
finer control over what's going on.

There are some examples to get started using rtslib directly in Chaper
10 RTSlib – Storage Management Library and API, of the admin manual
here:

http://www.linux-iscsi.org/Doc/RTS%20OS%20Admin%20Manual.pdf

Also, the full rtslib API reference should have been included in the
distro package your using.  This can also be generated directly by
building from rtslib.git directly here:

https://github.com/Datera/rtslib

--nab

--
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