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 ===================================
7 Installing a plug-in into Yardstick
8 ===================================
14 Yardstick provides a ``plugin`` CLI command to support integration with other
15 OPNFV testing projects. Below is an example invocation of Yardstick plugin
16 command and Storperf plug-in sample.
19 Installing Storperf into Yardstick
20 ==================================
22 Storperf is delivered as a Docker container from
23 https://hub.docker.com/r/opnfv/storperf/tags/.
25 There are two possible methods for installation in your environment:
27 * Run container on Jump Host
28 * Run container in a VM
30 In this introduction we will install Storperf on Jump Host.
33 Step 0: Environment preparation
34 -------------------------------
36 Running Storperf on Jump Host
39 * Docker must be installed
40 * Jump Host must have access to the OpenStack Controller API
41 * Jump Host must have internet connectivity for downloading docker image
42 * Enough floating IPs must be available to match your agent count
44 Before installing Storperf into yardstick you need to check your openstack
45 environment and other dependencies:
47 1. Make sure docker is installed.
48 2. Make sure Keystone, Nova, Neutron, Glance, Heat are installed correctly.
49 3. Make sure Jump Host have access to the OpenStack Controller API.
50 4. Make sure Jump Host must have internet connectivity for downloading docker
52 5. You need to know where to get basic openstack Keystone authorization info,
53 such as OS_PASSWORD, OS_PROJECT_NAME, OS_AUTH_URL, OS_USERNAME.
54 6. To run a Storperf container, you need to have OpenStack Controller
55 environment variables defined and passed to Storperf container. The best way
56 to do this is to put environment variables in a "storperf_admin-rc" file.
57 The storperf_admin-rc should include credential environment variables at
67 *Yardstick* has a ``prepare_storperf_admin-rc.sh`` script which can be used to
68 generate the ``storperf_admin-rc`` file, this script is located at
69 ``test/ci/prepare_storperf_admin-rc.sh``
74 # Prepare storperf_admin-rc for StorPerf.
75 AUTH_URL=${OS_AUTH_URL}
76 USERNAME=${OS_USERNAME:-admin}
77 PASSWORD=${OS_PASSWORD:-console}
79 # OS_TENANT_NAME is still present to keep backward compatibility with legacy
80 # deployments, but should be replaced by OS_PROJECT_NAME.
81 TENANT_NAME=${OS_TENANT_NAME:-admin}
82 PROJECT_NAME=${OS_PROJECT_NAME:-$TENANT_NAME}
83 PROJECT_ID=`openstack project show admin|grep '\bid\b' |awk -F '|' '{print $3}'|sed -e 's/^[[:space:]]*//'`
84 USER_DOMAIN_ID=${OS_USER_DOMAIN_ID:-default}
86 rm -f ~/storperf_admin-rc
87 touch ~/storperf_admin-rc
89 echo "OS_AUTH_URL="$AUTH_URL >> ~/storperf_admin-rc
90 echo "OS_USERNAME="$USERNAME >> ~/storperf_admin-rc
91 echo "OS_PASSWORD="$PASSWORD >> ~/storperf_admin-rc
92 echo "OS_PROJECT_NAME="$PROJECT_NAME >> ~/storperf_admin-rc
93 echo "OS_PROJECT_ID="$PROJECT_ID >> ~/storperf_admin-rc
94 echo "OS_USER_DOMAIN_ID="$USER_DOMAIN_ID >> ~/storperf_admin-rc
97 The generated ``storperf_admin-rc`` file will be stored in the root directory.
98 If you installed *Yardstick* using Docker, this file will be located in the
99 container. You may need to copy it to the root directory of the Storperf
102 Step 1: Plug-in configuration file preparation
103 ----------------------------------------------
105 To install a plug-in, first you need to prepare a plug-in configuration file in
106 YAML format and store it in the "plugin" directory. The plugin configration
107 file work as the input of yardstick "plugin" command. Below is the Storperf
108 plug-in configuration file sample:
112 # StorPerf plugin configuration file
113 # Used for integration StorPerf into Yardstick as a plugin
114 schema: "yardstick:plugin:0.1"
122 In the plug-in configuration file, you need to specify the plug-in name and the
123 plug-in deployment info, including node ip, node login username and password.
124 Here the Storperf will be installed on IP 192.168.23.2 which is the Jump Host
125 in my local environment.
127 Step 2: Plug-in install/remove scripts preparation
128 --------------------------------------------------
130 In ``yardstick/resource/scripts`` directory, there are two folders: an
131 ``install`` folder and a ``remove`` folder. You need to store the plug-in
132 install/remove scripts in these two folders respectively.
134 The detailed installation or remove operation should de defined in these two
135 scripts. The name of both install and remove scripts should match the plugin-in
136 name that you specified in the plug-in configuration file.
138 For example, the install and remove scripts for Storperf are both named
141 Step 3: Install and remove Storperf
142 -----------------------------------
144 To install Storperf, simply execute the following command::
147 yardstick plugin install plugin/storperf.yaml
149 Removing Storperf from yardstick
150 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152 To remove Storperf, simply execute the following command::
155 yardstick plugin remove plugin/storperf.yaml
157 What yardstick plugin command does is using the username and password to log
158 into the deployment target and then execute the corresponding install or remove