numam-spdk/doc/spdkcli.md
wawryk e96beb9374 markdownlint: enable rule MD006
MD006 - Consider starting bulleted lists at the beginning of the line
Fixed all errors

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: Id9a50447160ca14c3fd3117957ba2263cdb00471
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8997
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-05 07:42:35 +00:00

1.8 KiB

SPDK CLI

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

./scripts/setup.sh
./build/bin/vhost -c vhost.json

Run SPDK CLI

Spdkcli should be run with the same privileges as SPDK application. In order to use SPDK CLI in interactive mode please use:

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:

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:

cd spdk
mkdir venv
virtualenv-3 ./venv
source ./venv/bin/activate

Then install the dependencies using pip. That way dependencies will be installed only inside the virtual environment.

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