]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
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: | |
f67539c2 | 14 | |
11fdf7f2 TL |
15 | - configshell |
16 | ||
17 | ### Run SPDK application instance | |
18 | ||
19 | ~~~{.sh} | |
20 | ./scripts/setup.sh | |
f67539c2 | 21 | ./build/bin/vhost -c vhost.conf |
11fdf7f2 TL |
22 | ~~~ |
23 | ||
24 | ### Run SPDK CLI | |
25 | ||
26 | Spdkcli should be run with the same privileges as SPDK application. | |
27 | In order to use SPDK CLI in interactive mode please use: | |
28 | ~~~{.sh} | |
29 | scripts/spdkcli.py | |
30 | ~~~ | |
31 | Use "help" command to get a list of available commands for each tree node. | |
32 | ||
33 | It is also possible to use SPDK CLI to run just a single command, | |
34 | just use the command as an argument to the application. | |
35 | For example, to view current configuration and immediately exit: | |
36 | ~~~{.sh} | |
37 | scripts/spdkcli.py ls | |
38 | ~~~ | |
39 | ||
40 | ### Optional - create Python virtual environment | |
41 | ||
42 | You can use Python virtual environment if you don't want to litter your | |
43 | system Python installation. | |
44 | ||
45 | First create the virtual environment: | |
46 | ~~~{.sh} | |
47 | cd spdk | |
48 | mkdir venv | |
49 | virtualenv-3 ./venv | |
50 | source ./venv/bin/activate | |
51 | ~~~ | |
52 | ||
53 | Then install the dependencies using pip. That way dependencies will be | |
54 | installed only inside the virtual environment. | |
55 | ~~~{.sh} | |
56 | (venv) pip install configshell-fb | |
57 | ~~~ | |
58 | ||
59 | Tip: if you are using "sudo" instead of root account, it is suggested to do | |
60 | "sudo -s" before activating the environment. This is because venv might not work | |
61 | correctly when calling spdkcli with sudo, like "sudo python spdkcli.py" - | |
62 | some environment variables might not be passed and you will experience errors. |