Yardstick on openSUSE
Yardstick is a project in the OPNFV community and its goal is to verify the infrastructure compliance when running VNF applications. The project web-page is https://wiki.opnfv.org/display/yardstick/Yardstick
This short blog-post guides the user to the installation and setup of Yardstick on SUSE distribution and how to modify existing samples to use different guest-images.
Devstack
Create the user stack on the system
$ sudo useradd -m -p stack stack
Add the user stack to the list of sudoers
$ sudo echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
Change user and working directory
$ su stack $ cd ~/> git clone https://git.openstack.org/openstack-dev/devstack
In the devstack directory, edit the file lib/nova
~/> cd devstack ~/devstack> vim lib/nova
and remove the DifferentHostFilter from the FILTERS list
Create a local.conf file (see below for content)
~/devstack> vim local.conf
Content of the file:
[ [ local | localrc ] ] ADMIN_PASSWORD=secret DATABASE_PASSWORD=$ADMIN_PASSWORD RABBIT_PASSWORD=$ADMIN_PASSWORD SERVICE_PASSWORD=$ADMIN_PASSWORD #Enable heat services enable_service h-eng h-api h-api-cfn h-api-cw #Enable heat plugin enable_plugin heat https://git.openstack.org/openstack/heat
Finally, export the Openstack environment variables and run the Devstack installation
~/devstack> source openrc ~/devstack> export OS_USERNAME=admin ~/devstack> export FORCE=yes ~/devstack> ./stack.sh
Create the predefined Openstack flavour used by few Yardstick examples (ID: 100, RAM: 512 MB, DISK: 3 GB, vCPU: 1)
~/devstack> nova flavor-create yardstick-flavor 100 512 3 1
Download the predefined guest-image used by few Yardstick examples
~/devstack> cd /tmp ~/tmp> wget http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img
Create an Openstack image with the downloaded cirros image
~/devstack> openstack image create --public \ --disk-format qcow2 \ --container-format bare \ --file /tmp/cirros-0.3.3-x86_64-disk.img \ cirros-0.3.3
Installation
The steps listed below are the ones required to install and run Yardstick on openSUSE distribution (tested on Leap 42.2, Leap 42.3 and Tumbleweed).
Dependencies
~/devstack> zypper -n install -y gcc \ wget \ git \ sshpass \ qemu-tools \ kpartx \ libffi-devel \ libopenssl-devel \ python \ python-devel \ python-virtualenv \ libxml2-devel \ libxslt-devel \ python-setuptools-git
Virtual environment
~> virtualenv ~/yardstick_venv ~> source ~/yardstick_venv/bin/activate (yardstick_venv) ~> easy_install -U setuptools
Cloning and setup
(yardstick_venv) ~> git clone https://gerrit.opnfv.org/gerrit/yardstick (yardstick_venv) ~> cd yardstick (yardstick_venv) ~/yardstick> python setup.py install (yardstick_venv) ~/yardstick> pip install -r requirements.txt
Install missing python modules
(yardstick_venv) ~/yardstick> pip install pyyaml \ oslo_utils \ oslo_serialization \ oslo_config \ paramiko \ python.heatclient \ python.novaclient \ python.glanceclient \ python.neutronclient \ scp \ jinja2
Expose Openstack environment to Yardstick
source DEVSTACK_DIRECTORY/openrc
Export the Openstack external network. The default installation of Devstack names the external network public
export EXTERNAL_NETWORK=public export OS_USERNAME=demo
Change the API version used by Yardstick to v2.0 (the devstack openrc sets it to v3)
export OS_AUTH_URL=http://PUBLIC_IP_ADDRESS:5000/v2.0
At this point it should be possible to execute Yardstick and a sample test.
Let’s try to see yardstick help menu:
(yardstick_venv) ~/yardstick> yardstick -h
and now, let’s run the ping example:
(yardstick_venv) ~/yardstick> yardstick task start samples/ping.yaml
How to use a different guest-image
Let’s imagine we want to use the openSUSE Leap 42.3 Openstack cloud image.
~/devstack> cd /tmp ~/tmp> wget http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.3/images/openSUSE-Leap-42.3-OpenStack.x86_64.qcow2
Create a variation of the default Yardstick flavour since the openSUSE image is bigger than the cirros one (ID: 101, RAM: 4096 MB, DISK: 15 GB, vCPU: 4).
~/devstack> nova flavor-create yardstick-flavor-bigger 101 4096 15 4
Create the Openstack image for the downloaded image
~/devstack> openstack image create --public \ --disk-format qcow2 \ --container-format bare \ --file /tmp/openSUSE-Leap-42.3-OpenStack.x86_64.qcow2 \ openSUSE-Leap-42.3-OpenStack
Now, we are ready to edit the sample test YAML file.
~> virtualenv ~/yardstick_venv ~> source ~/yardstick_venv/bin/activate (yardstick_venv) ~> cd yardstick (yardstick_venv) ~/yardstick> vim samples/ping.yaml
Modify the image, flavor and user parameters to the one we have created before (and as below)
image: opensuse-leap-42.3-openstack flavor: yardstick-flavor-bigger user: root
Yardstick results
All Yardstick sample test generates a yardstick.out file in the /tmp folder. The file content is of JSON format and so it can always be possible to copy/paste its content to a JSON viewer (e.g. http://jsonviewer.stack.hu/).
However, another way is to integrate Yardstick with InfluxDB and Grafana hence storing data into a database and have Grafana plotting the results. In this regards, the existing OPNFV wiki-page is up-to-date and can be leveraged for the setup.
See http://artifacts.opnfv.org/yardstick/colorado/2.0/docs/userguide/index.html section to deploy and configure InfluxDB and Grafana locally.
The only extra steps, to be performed before following the wiki page above, are:
(yardstick_venv) ~/:[127]# sudo zypper -n install -y docker
(yardstick_venv) ~/:[1]# service docker start
No comments yet