1 .. This work is licensed under a Creative Commons Attribution 4.0 International
3 .. http://creativecommons.org/licenses/by/4.0
4 .. (c) OPNFV, Ericsson AB, Huawei Technologies Co.,Ltd and others.
6 .. Convention for heading levels in Yardstick documentation:
8 ======= Heading 0 (reserved for the title in a document)
14 Avoid deeper levels because they do not render well.
16 ===================================
17 Installing a plug-in into Yardstick
18 ===================================
24 Yardstick provides a ``plugin`` CLI command to support integration with other
25 OPNFV testing projects. Below is an example invocation of Yardstick plugin
26 command and Storperf plug-in sample.
29 Installing Storperf into Yardstick
30 ----------------------------------
32 Storperf is delivered as a Docker container from
33 https://hub.docker.com/r/opnfv/storperf/tags/.
35 There are two possible methods for installation in your environment:
37 * Run container on Jump Host
38 * Run container in a VM
40 In this introduction we will install Storperf on Jump Host.
43 Step 0: Environment preparation
44 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 Running Storperf on Jump Host
49 * Docker must be installed
50 * Jump Host must have access to the OpenStack Controller API
51 * Jump Host must have internet connectivity for downloading docker image
52 * Enough floating IPs must be available to match your agent count
54 Before installing Storperf into yardstick you need to check your openstack
55 environment and other dependencies:
57 1. Make sure docker is installed.
58 2. Make sure Keystone, Nova, Neutron, Glance, Heat are installed correctly.
59 3. Make sure Jump Host have access to the OpenStack Controller API.
60 4. Make sure Jump Host must have internet connectivity for downloading docker
62 5. You need to know where to get basic openstack Keystone authorization info,
63 such as OS_PASSWORD, OS_PROJECT_NAME, OS_AUTH_URL, OS_USERNAME.
64 6. To run a Storperf container, you need to have OpenStack Controller
65 environment variables defined and passed to Storperf container. The best way
66 to do this is to put environment variables in a "storperf_admin-rc" file.
67 The storperf_admin-rc should include credential environment variables at
77 *Yardstick* has a ``prepare_storperf_admin-rc.sh`` script which can be used to
78 generate the ``storperf_admin-rc`` file, this script is located at
79 ``test/ci/prepare_storperf_admin-rc.sh``
84 # Prepare storperf_admin-rc for StorPerf.
85 AUTH_URL=${OS_AUTH_URL}
86 USERNAME=${OS_USERNAME:-admin}
87 PASSWORD=${OS_PASSWORD:-console}
89 # OS_TENANT_NAME is still present to keep backward compatibility with legacy
90 # deployments, but should be replaced by OS_PROJECT_NAME.
91 TENANT_NAME=${OS_TENANT_NAME:-admin}
92 PROJECT_NAME=${OS_PROJECT_NAME:-$TENANT_NAME}
93 PROJECT_ID=`openstack project show admin|grep '\bid\b' |awk -F '|' '{print $3}'|sed -e 's/^[[:space:]]*//'`
94 USER_DOMAIN_ID=${OS_USER_DOMAIN_ID:-default}
96 rm -f ~/storperf_admin-rc
97 touch ~/storperf_admin-rc
99 echo "OS_AUTH_URL="$AUTH_URL >> ~/storperf_admin-rc
100 echo "OS_USERNAME="$USERNAME >> ~/storperf_admin-rc
101 echo "OS_PASSWORD="$PASSWORD >> ~/storperf_admin-rc
102 echo "OS_PROJECT_NAME="$PROJECT_NAME >> ~/storperf_admin-rc
103 echo "OS_PROJECT_ID="$PROJECT_ID >> ~/storperf_admin-rc
104 echo "OS_USER_DOMAIN_ID="$USER_DOMAIN_ID >> ~/storperf_admin-rc
107 The generated ``storperf_admin-rc`` file will be stored in the root directory.
108 If you installed *Yardstick* using Docker, this file will be located in the
109 container. You may need to copy it to the root directory of the Storperf
112 Step 1: Plug-in configuration file preparation
113 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115 To install a plug-in, first you need to prepare a plug-in configuration file in
116 YAML format and store it in the "plugin" directory. The plugin configration
117 file work as the input of yardstick "plugin" command. Below is the Storperf
118 plug-in configuration file sample:
122 # StorPerf plugin configuration file
123 # Used for integration StorPerf into Yardstick as a plugin
124 schema: "yardstick:plugin:0.1"
132 In the plug-in configuration file, you need to specify the plug-in name and the
133 plug-in deployment info, including node ip, node login username and password.
134 Here the Storperf will be installed on IP 192.168.23.2 which is the Jump Host
135 in my local environment.
137 Step 2: Plug-in install/remove scripts preparation
138 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140 In ``yardstick/resource/scripts`` directory, there are two folders: an
141 ``install`` folder and a ``remove`` folder. You need to store the plug-in
142 install/remove scripts in these two folders respectively.
144 The detailed installation or remove operation should de defined in these two
145 scripts. The name of both install and remove scripts should match the plugin-in
146 name that you specified in the plug-in configuration file.
148 For example, the install and remove scripts for Storperf are both named
151 Step 3: Install and remove Storperf
152 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154 To install Storperf, simply execute the following command::
157 yardstick plugin install plugin/storperf.yaml
159 Removing Storperf from Yardstick
160 ++++++++++++++++++++++++++++++++
162 To remove Storperf, simply execute the following command::
165 yardstick plugin remove plugin/storperf.yaml
167 What yardstick plugin command does is using the username and password to log
168 into the deployment target and then execute the corresponding install or remove