Page tree
Skip to end of metadata
Go to start of metadata

This page is to capture learnings and steps that can be used to improve the Yardstick Installation documents.

TEMP ADD for plugfest: Recommend Steps to run yardstick in plug fest :

Running yardstick in a vm from scratch

NOTE: The whole stepes are tested on a KVM vm. The vm's image is (May,9,2016)

Step 0: Openstack environment preparation

Before running yardstick you need to check your openstack environment:

1. Make sure Keystone, Nova, Neutron, Glance, Heat are installed correctly.
2. You need to know where to get basic openstack Keystone authorization info: OS_PASSWORD, OS_TENANT_NAME, OS_AUTH_URL, OS_USERNAME.
3. Make sure you vm can reach OS_AUTH_URL (maybe you can just run cmd `curl $OS_AUTH_URL` on the vm).
4. Make sure openstack external network is created, of course you need to know the external network's name.
5. If you know functest project, make sure you can pass functest vping_ssh test case. Otherwise you, make sure you can boot a vm, allocate a floating ip for it and then ssh login to the vm.
6. Make sure yardstick-flavor is created (e.g `nova flavor-create yardstick-flavor 100 512 3 1`)

Step 1: Install yardstick

Install dependent packages:

apt-get update && apt-get install -y \
wget \
git \
sshpass \
qemu-utils \
kpartx \
libffi-dev \
libssl-dev \
python \
python-dev \
libxml2-dev \
libxslt1-dev \
python-setuptools python-virtualenv libyaml-dev

Create a virtual environment

virtualenv ~/yardstick_venv
source ~/yardstick_venv/bin/activate
easy_install -U setuptools

Install yardstick from source file

git clone
cd yardstick
python install

Step 2: Export Openstack environment variables

Export OpenStack environment variables from the OpenStack openrc file (using the source command).

Credential environment variables in the openrc file have to include at least: OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_TENANT_NAME .

export the external network name, `export EXTERNAL_NETWORK="external-network-name"`, the default name for the external network is net04_ext.

e.g. (openstack installed by compass)

export OS_PASSWORD=console
export OS_TENANT_NAME=admin
export OS_AUTH_URL=
export OS_USERNAME=admin
export EXTERNAL_NETWORK=ext-net

Step 3: Building a guest image

Install dependent packages:

apt-get update && apt-get install -y \
qemu-utils \

Build image:

sudo ./tools/yardstick-img-modify tools/

The builed image is located in /tmp/workspace/yardstick/yardstick-trusty-server.img

Step 4: Load the builded image

The created image can be added to OpenStack using the glance image-create or via the OpenStack Dashboard.

Example command:

glance --os-image-api-version 1 image-create \
--name yardstick-trusty-server --is-public true \
--disk-format qcow2 --container-format bare \
--file /tmp/workspace/yardstick/yardstick-trusty-server.img

Step 5: [option]Create yardstick configure file

By default yardstick dump test result to /tmp/yardstick.out, you can configure the result file path in the configure file.

Sample configure to write test result to local file:

mkdir /etc/yardstick
cat << EOF >> /etc/yardstick/yardstick.conf
debug = True
dispatcher = file

file_name = <local/result/file/path>

Sample configure to write test result to community result-collection-api:

mkdir /etc/yardstick
cat << EOF >> /etc/yardstick/yardstick.conf
debug = True
dispatcher = http

timeout = 5
target = http://<result-collection-server-ip>/results


Sample configure to write test result to community influxdb:


mkdir /etc/yardstick
cat << EOF >> /etc/yardstick/yardstick.conf
debug = True
dispatcher = influxdb

timeout = 5
target = http://<influxdb-server-ip>:8086
db_name = yardstick
username = opnfv
password = 0pnfv2015

Step 6: Run test cases

Run single test:

yardstick task start samples/ping.yaml

or run a test suit:

yardstick task start --suite tests/opnfv/test_suites/opnfv_plugfest.yaml

Step 7: Catch the result

By default yardstick test result is stored in the file named /tmp/yardstick.out .

If you use community result collection api, you can get the test result by call rest api.  Refer to get more info about the api.

If you use influxdb to store test result, you can use influx sql cmd to find the test result or configure grafana for graphic result display.


* yardstick user guide:


  • No labels

1 Comment

  1. miss one step for creating a flavor for VM.  it could be executed after step 4.

    nova flavor-create yardstick-flavor 100 512 3 1