Spdk/doc/spdkcli.md
Karol Latecki 83795a1600 spdkcli: initial version with bdev management
Initial version for SPDKCli
Possible basic management of:
- Bdevs: malloc, nvme, aio, lvol
	create / delete operations.
- Lvol stores:
	create / delete operations.

Adding dependency to pkgdep.sh.

Change-Id: I1a03d7660dad0335e25734b8ffb90592a5b337c2
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/405039
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2018-04-20 13:25:21 -04:00

62 lines
1.8 KiB
Markdown

# SPDK CLI {#spdkcli}
Spdkcli is a command-line management application for SPDK.
Spdkcli has support for a limited number of applications and bdev modules,
and should be considered experimental for the v18.04 release.
This experimental version was added for v18.04 to get early feedback
that can be incorporated as spdkcli becomes more fully-featured
for the next SPDK release.
### Install needed dependencies
All dependencies should be handled by scripts/pkgdep.sh script.
Package dependencies at the moment include:
- configshell
### Run SPDK application instance
~~~{.sh}
./scripts/setup.sh
./app/vhost/vhost -c vhost.conf
~~~
### Run SPDK CLI
Spdkcli should be run with the same priviliges as SPDK application.
In order to use SPDK CLI in interactive mode please use:
~~~{.sh}
scripts/spdkcli.py
~~~
Use "help" command to get a list of available commands for each tree node.
It is also possible to use SPDK CLI to run just a single command,
just use the command as an argument to the application.
For example, to view current configuration and immediately exit:
~~~{.sh}
scripts/spdkcli.py ls
~~~
### Optional - create Python virtual environment
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
~~~
Then install the dependencies using pip. That way depedencies will be
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.