2022-06-15 23:25:53 +00:00
|
|
|
# spdkcli {#spdkcli}
|
2018-03-23 10:40:31 +00:00
|
|
|
|
2022-06-15 23:25:53 +00:00
|
|
|
spdkcli is a command-line management application for SPDK.
|
|
|
|
spdkcli has support for most transport protocols and
|
|
|
|
bdev modules.
|
2018-03-23 10:40:31 +00:00
|
|
|
|
2022-06-15 23:25:53 +00:00
|
|
|
## Dependencies
|
2018-03-23 10:40:31 +00:00
|
|
|
|
2022-06-15 23:25:53 +00:00
|
|
|
Dependencies are installed by scripts/pkgdep.sh.
|
2018-03-23 10:40:31 +00:00
|
|
|
Package dependencies at the moment include:
|
2020-02-04 15:41:17 +00:00
|
|
|
|
2021-07-30 10:00:38 +00:00
|
|
|
- configshell
|
2018-03-23 10:40:31 +00:00
|
|
|
|
2022-06-15 23:25:53 +00:00
|
|
|
Some distributions name the package configshell_fb.
|
|
|
|
|
|
|
|
## Example usage
|
|
|
|
|
|
|
|
### Start SPDK application
|
2018-03-23 10:40:31 +00:00
|
|
|
|
|
|
|
~~~{.sh}
|
|
|
|
./scripts/setup.sh
|
2020-10-21 10:10:22 +00:00
|
|
|
./build/bin/vhost -c vhost.json
|
2018-03-23 10:40:31 +00:00
|
|
|
~~~
|
|
|
|
|
2022-06-15 23:25:53 +00:00
|
|
|
### Run spdkcli
|
|
|
|
|
|
|
|
spdkcli should be run with the same privileges as SPDK application.
|
2018-03-23 10:40:31 +00:00
|
|
|
|
2022-06-15 23:25:53 +00:00
|
|
|
To use spdkcli in interactive mode:
|
2018-03-23 10:40:31 +00:00
|
|
|
~~~{.sh}
|
|
|
|
scripts/spdkcli.py
|
|
|
|
~~~
|
|
|
|
Use "help" command to get a list of available commands for each tree node.
|
|
|
|
|
2022-06-15 23:25:53 +00:00
|
|
|
It is also possible to use spdkcli to run just a single command,
|
2018-03-23 10:40:31 +00:00
|
|
|
just use the command as an argument to the application.
|
|
|
|
For example, to view current configuration and immediately exit:
|
2021-07-30 10:00:38 +00:00
|
|
|
~~~{.sh}
|
2018-03-23 10:40:31 +00:00
|
|
|
scripts/spdkcli.py ls
|
|
|
|
~~~
|
|
|
|
|
2021-07-27 10:14:02 +00:00
|
|
|
## Optional - create Python virtual environment
|
2018-03-23 10:40:31 +00:00
|
|
|
|
|
|
|
You can use Python virtual environment if you don't want to litter your
|
|
|
|
system Python installation.
|
|
|
|
|
|
|
|
First create the virtual environment:
|
|
|
|
~~~{.sh}
|
|
|
|
cd spdk
|
|
|
|
mkdir venv
|
|
|
|
virtualenv-3 ./venv
|
|
|
|
source ./venv/bin/activate
|
|
|
|
~~~
|
|
|
|
|
2018-08-27 08:42:35 +00:00
|
|
|
Then install the dependencies using pip. That way dependencies will be
|
2018-03-23 10:40:31 +00:00
|
|
|
installed only inside the virtual environment.
|
|
|
|
~~~{.sh}
|
|
|
|
(venv) pip install configshell-fb
|
|
|
|
~~~
|
|
|
|
|
|
|
|
Tip: if you are using "sudo" instead of root account, it is suggested to do
|
|
|
|
"sudo -s" before activating the environment. This is because venv might not work
|
|
|
|
correctly when calling spdkcli with sudo, like "sudo python spdkcli.py" -
|
|
|
|
some environment variables might not be passed and you will experience errors.
|