]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/doc/spdkcli.md
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / spdk / doc / spdkcli.md
1 # SPDK CLI {#spdkcli}
2
3 Spdkcli is a command-line management application for SPDK.
4 Spdkcli has support for a limited number of applications and bdev modules,
5 and should be considered experimental for the v18.04 release.
6 This experimental version was added for v18.04 to get early feedback
7 that can be incorporated as spdkcli becomes more fully-featured
8 for the next SPDK release.
9
10 ### Install needed dependencies
11
12 All dependencies should be handled by scripts/pkgdep.sh script.
13 Package dependencies at the moment include:
14 - configshell
15
16 ### Run SPDK application instance
17
18 ~~~{.sh}
19 ./scripts/setup.sh
20 ./app/vhost/vhost -c vhost.conf
21 ~~~
22
23 ### Run SPDK CLI
24
25 Spdkcli should be run with the same privileges as SPDK application.
26 In order to use SPDK CLI in interactive mode please use:
27 ~~~{.sh}
28 scripts/spdkcli.py
29 ~~~
30 Use "help" command to get a list of available commands for each tree node.
31
32 It is also possible to use SPDK CLI to run just a single command,
33 just use the command as an argument to the application.
34 For example, to view current configuration and immediately exit:
35 ~~~{.sh}
36 scripts/spdkcli.py ls
37 ~~~
38
39 ### Optional - create Python virtual environment
40
41 You can use Python virtual environment if you don't want to litter your
42 system Python installation.
43
44 First create the virtual environment:
45 ~~~{.sh}
46 cd spdk
47 mkdir venv
48 virtualenv-3 ./venv
49 source ./venv/bin/activate
50 ~~~
51
52 Then install the dependencies using pip. That way dependencies will be
53 installed only inside the virtual environment.
54 ~~~{.sh}
55 (venv) pip install configshell-fb
56 ~~~
57
58 Tip: if you are using "sudo" instead of root account, it is suggested to do
59 "sudo -s" before activating the environment. This is because venv might not work
60 correctly when calling spdkcli with sudo, like "sudo python spdkcli.py" -
61 some environment variables might not be passed and you will experience errors.