OpenSource For You

OpenStack: Testing Tempest and REST API

Large pools of compute, storage and networking resources exist in data centres and in enterprise­s. To manage them, the ideal tool would be OpenStack, which gives administra­tive control via a dashboard. In this article, we will explore the configurat­ion of

-

In today’s fast-paced world, resource sharing and resource optimisati­on are two big game changers, as these not only simplify infrastruc­ture planning but also hold promise in the area of cloud computing. Cloud computing has several advantages. It helps to save on capital and operationa­l expenditur­e, and is easy to use. Cloud computing involves a big pool of hardware systems connected in private or public networks, to provide scalable infrastruc­ture for applicatio­n, data and file storage.

OpenStack

OpenStack is a cloud operating system that controls large pools of compute, storage and networking resources through a data centre used for developing private and public clouds. Being an open source platform, it gives administra­tors control through a dashboard (usually Horizon or a custom-built one using REST APIs), while empowering users to provision resources through a Web interface.

The OpenStack Foundation, a non-profit organisati­on, oversees both developmen­t and community-building around these projects, and is backed by some of the biggest companies in software developmen­t and hosting.

Generally speaking, OpenStack fits between the PaaS and IaaS layers, though not compulsori­ly so. It lets users deploy virtual machines (VMs) and other instances, which handle different tasks that manage a cloud environmen­t, on-the-fly. It makes horizontal scaling easier, which means that tasks which benefit from running concurrent­ly can easily serve more or fewer users on-the-fly by just spinning up more instances as and when required.

OpenStack was initially incubated and developed by NASA, CERN and Rackspace. It is backed by thousands of developers around the world, who are ready to help build a strong, robust and secure environmen­t. OpenStack has well integrated features and components to carry out all cloud related activities like provisioni­ng, orchestrat­ion, pricing, billing, etc.

This free and open source cloud computing platform could reach an estimated market size of US$ 1.7 billion by the end of 2016, according to a report from the analyst firm 451 Research.

A recent announceme­nt at OpenStack.org stated: “OpenStack is enterprise ready.” In fact, OpenStack is revolution­ising the way we approach computing, storage and networking.

DevStack

DevStack is an opinionate­d script to help you quickly create an OpenStack developmen­t environmen­t. It can also be used to demonstrat­e how to start and run OpenStack services, and provides examples of using them from a command line.

DevStack, as the name itself suggests, is used specifical­ly for developmen­t work on OpenStack. The OpenStack/ DevStack environmen­t is set up after running stack.sh (a script to start DevStack configurat­ion). From Git repositori­es we can download the latest version of DevStack.

DevStack has evolved to support many configurat­ion options, alternativ­e platforms and support services. In this article, I have considered Ubuntu 14.04, CentOS 7.0 and

Fedora 21. More on DevStack and its configurat­ions will be described later.

Some well-known features of OpenStack/DevStack are: Neutron, Cinder, Keystone, Glance, Swift, Nova and Horizon. Not all the features are covered and explained here.

The basic Tempest reference architectu­re

Tempest is an OpenStack integratio­n test suite based on the unittest2 framework and currently uses the Nosetest runner.

Tempest is a set of integratio­n tests to be run against any live OpenStack/DevStack cluster. It has a collection of tests for OpenStack API validation, different scenarios and other specific tests that are useful in validating OpenStack deployment. Tempest also drives some load in the OpenStack cloud environmen­t, so that some part of load testing is also covered. This is possible because it runs all API validation tests in parallel.

Overall, all Tempest does is run tests against OpenStack service endpoints by exercising REST API calls and validate the responses.

Tempest is not exactly tied to any single test runner, but ‘testr_’ is the most commonly used tool. Once all the required configurat­ion is done, Tempest can be run in various ways: 1) Tests can be run in parallel.

2) Tests can be run by selecting individual components

serially.

3) Using the ‘tox’ command, tests can be run again in two ways.

• tox –efull: This will run the same set of tests as the OpenStack gate. tox –esmoke: This is to run the tests tagged as ‘smoke’.

4) Tempest also has a set of unit tests that test the Tempest code itself. These tests can be run by the run_tempest.sh command.

The various types of tests that can be executed using

Tempest are:

Smoke tests

Positive tests

Negative tests

Stress tests

White box tests

Tempest is based on httplib2 and built using the REST framework.

The bare minimum hardware required for OpenStack/

DevStack installati­on is given below:

Troublesho­oting

1. Whenever you create the localrc file as the root user and try to run the stack.sh command from the stack user, the error shown in Figure 5 will be encountere­d.

Solution: When such an error is encountere­d, change the ownership of devstack directory to stack user, using the command given in Figure 6.

2. If you are using a proxy, while running the stack.sh command you may get the error shown in Figure 7. Solution: The best practice is to have an Internet connection without a proxy, which will help you avoid most of the issues. 3. When we clone ‘nova’ manually to /opt/stack/nova from the Git repository and try to execute the command ‘stack. sh’, the following exception will be encountere­d:

raise Exception (“Versioning for this project requires either an sdist”

Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?

Solution: To avoid the above exception, copy the .git directory from the cloned devstack directory to the /opt/ stack/nova directory.

4. For downloadin­g the earlier stable DevStack version from the Git repository, use the commands given below. Solution: Choose the stable version from the Git, for example, ‘kilo’ or any latest (‘liberty’) release. $ git clone -b stable/kilo https://github.com/OpenStack-dev/ devstack.git Cloning into ‘devstack’... remote: Counting objects: 28160, done. remote: Compressin­g objects: 100% (14/14), done. remote: Total 28160 (delta 3), reused 0 (delta 0), packreused 28146

Receiving objects: 100% (28160/28160), 9.59 MiB | 6.00 KiB/s, done.

Resolving deltas: 100% (19543/19543), done.

DevStack installati­on on Ubuntu 14.04 LTS

After successful­ly installing Ubuntu 14.04 on the selected hardware, the following steps will configure and install DevStack and Tempest.

Step 1: To get the latest version of Ubuntu packages, run the following command:

# apt-get update

Step 2: Install the Git package for downloadin­g devstack files. Run the following command to install the Git package on the host machine:

#apt-get install git

 ??  ?? Figure 1: Tempest
Figure 1: Tempest
 ??  ?? Figure 3: Basic Tempest reference architectu­re
Figure 3: Basic Tempest reference architectu­re
 ??  ?? Figure 2: Detailed Tempest reference architectu­re
Figure 2: Detailed Tempest reference architectu­re
 ??  ?? Figure 4: Tempest test suite
Figure 4: Tempest test suite
 ??  ??
 ??  ??
 ??  ?? To check the virtualisa­tion support for the processor, use the following commands:
To check the virtualisa­tion support for the processor, use the following commands:
 ??  ?? Figure 7: Proxy error
Figure 7: Proxy error
 ??  ?? Figure 6: Ownership of stack user
Figure 6: Ownership of stack user
 ??  ?? Figure 5: Localrc permission denied
Figure 5: Localrc permission denied

Newspapers in English

Newspapers from India