[PATCH RFC] nvmetcli: execute shell commands as arguments
Sagi Grimberg
sagi at grimberg.me
Thu Jan 23 14:28:38 PST 2025
On 21/01/2025 17:59, Maurizio Lombardi wrote:
> Hello,
>
> A few days ago I was trying to create a target with
> tens of subsystems and I found out that, AFACT, there
> is no straightforward way to do that with nvmetcli.
>
> It's iSCSI counterpart, targetcli, accepts shell commands
> as arguments and althought it's terribly slow, a similar
> feature for nvmetcli would allow the user to create simple
> scripts like the following one:
>
> nvmetcli ports/ create portid=1
> nvmetcli ports/1/ set addr adrfam=ipv4 traddr=10.8.2.212 trtype=tcp trsvcid=4420
>
> for i in $(seq 1 100); do
> nvmetcli subsystems/ create nqn=test-nqn$i
> nvmetcli subsystems/test-nqn$i/ set attr allow_any_host=1
> nvmetcli subsystems/test-nqn$i/namespaces create nsid=1
> nvmetcli subsystems/test-nqn$i/namespaces/1 set device path=/root/storage$i.img
> nvmetcli ports/1/subsystems/ create test-nqn$i
> nvmetcli subsystems/test-nqn$i/namespaces/1 enable
> done
>
> Should there be any interest, I can submit a formal patch.
Seems useful.
More information about the Linux-nvme
mailing list