This past week,thefirstreleasecandidatesof a number of OpenStack projects was released. From this point until theOpenStack Design Summit, we are pretty much focused on testing the release candidates. One way you can help out is to test the release candidate code, and this article will walk you through doing that with the Devstack and Tempest projects.
Setting up an OpenStack Essex RC1 Environment with Devstack
Before you test, you need an OpenStack environment. The easiest way to get an OpenStack environment up and running on a single machine[1]is to useDevstack. To get a version of Devstack that is designed to run against the release candidate branches of the OpenStack projects, simply clone the main repo of Devstack, like so:
git clone git://github.com/openstack-dev/devstack
Setting Up Your Devstackstackrc
to pull RC1 branches of OpenStack Projects
Devstack contains a file calledstackrc
that is sourced by the mainstack.sh
script to create your OpenStack environment. Thestackrc
file
contains environment variables that tellstack.sh
which repositories and branches of OpenStack projects to clone. We will need to change the branches in the stackrc file from master to milestone-proposed to grab
the release candidate branches. You will want to change the target branches for Nova, Glance, Keystone, and their respective client libraries. Here is what the default stackrc will look like:
And here is what it should look like after you change the master branches to milestone-proposed branches appropriately:
Setting Up Your Devstacklocalrc
for Running Tempest
There are a couple things you will want to put into your Devstack’s localrc file before actually creating your OpenStack environment for testing with Tempest. So, open up your editor of choice and make sure that you have at least the following in yourlocalrc
file
in Devstack’s root source directory. (If the file does not exist, simply create it)
API_RATE_LIMIT=False MYSQL_PASSWORD=pass RABBIT_PASSWORD=pass SERVICE_PASSWORD=pass ADMIN_PASSWORD=pass SERVICE_TOKEN=servicetoken
The first line instructs devstack to disable the default ratelimit middleware in the Nova API server. We need to do this because Tempest issues hundreds of API requests in a short amount of time as it runs its tests. If we don’t do this, Tempest will take a much longer time to run and you will likely get test failures with a bunch of overLimitFault messages.
The other lines simply set the various passwords to an easy-to-remember password “pass” for testing. And the final line is needed currently to set up some services but should be deprecated fairly soon…
Installing the OpenStack RC1 Environment
Now that you’ve got your devstack scripts cloned and yourlocalrc
installed, it’s time to run the mainstack.sh
script that will install OpenStack on your test machine.
It’s as easy as running thestack.sh
script. After running &mdash and be patient, on a first run the script can take ten or more minutes to complete — you will see a bunch of output and then something like this:
$> ./stack.sh <snip lots and lots of output...> The default users are: admin and demo The password: pass This is your host ip: 192.168.1.98 stack.sh completed in 517 seconds.
At this point, feel free to run theinfo.sh
script to verify all went well:
jpipes@librebox:~/repos/devstack$ ./tools/info.sh git|glance|milestone-proposed[f4a7035] git|horizon|milestone-proposed[97fc4f8] git|keystone|milestone-proposed[f3ce326] git|nova|milestone-proposed[4e02ba1] git|noVNC|master[22b9a75] git|python-keystoneclient|milestone-proposed[bf13df1] git|python-novaclient|milestone-proposed[aa0e87f] os|vendor=Ubuntu os|release=11.10 pkg|pep8|0.6.1-2ubuntu1 pkg|pylint|0.23.0-1 pkg|python-pip|1.0-1 <snip a whole bunch of package versions...> pip|pika|0.9.5 localrc|API_RATE_LIMIT=False localrc|HOST_IP=192.168.1.98 localrc|SERVICE_TOKEN=servicetoken
At this point, you have a fully functioning OpenStack RC1 environment. You can do the following to check into the logs (actually just the daemon output in a screen window):
$> screen -x
Switch screen windows using the<Ctrl>-a NUM
key combination, whereNUM
is the number of the screen window you see at the bottom of your console. Type<Ctrl>-a
d
to detach from your screen session. The screenshot below shows what your screen session may look like. In the screenshot, I’ve hit<Ctrl>-a 4
to switch to then-api
screen
window which is showing the Nova API server daemon output.
Testing the OpenStack Essex RC1 Environment with Tempest
TheTempestproject is an integration test suite for the OpenStack projects. Personally, in my testing setup at home, I run Tempest from a different machine on my local network than the machine that I run devstack on. However, you are free to run Tempest on the same machine you just installed Devstack on.
Grab Tempest by cloning the canonical repo:
$> git clone git://github.com/openstack/tempest
Once cloned, change directory into tempest.
Creating Your Tempest Configuration File
Tempest needs some information about your OpenStack environment to run properly. Because Tempest executes a series of API commands against the OpenStack environment, it needs to know where to find the main Compute API endpoint or where it can find the Keystone server that can return a service catalog. In addition, Tempest needs to know the UUID of the base image(s) that Devstack downloaded and installed in the Glance server.
Create the tempest configuration file by copying the sample config file included in Tempest$tempest_dir/etc/tempest.conf.sample
.
$> cp etc/tempest.conf.sample etc/tempest.conf
Next, you will want to query the Glance API server to get the UUID of the base AMI image used in testing. To do this, issue a call like so:
jpipes@uberbox:~/repos/tempest$ glance -I admin -K pass -T admin -N http://192.168.1.98:5000/v2.0 -S keystone index | grep ami | cut -f1 | awk '{print $1}' 99a48bc4-d356-4b4d-95d4-650f707699c2
Of course, you will want to replace the appropriate parts of the call above with your own environment. In my case above, my devstack environment is running on a host 192.168.1.98 and I’m accessing Glance with an “admin” user in an “admin” tenant with a password of “pass”. Copy the UUID identifier of the image that is returned from the command above (in my case, that UUID is99a48bc4-d356-4b4d-95d4-650f707699c2).
Now go ahead and open up the configuration file you just created by copying thetempest.conf.sample
file. You will see something like this:
[identity] use_ssl=False host=127.0.0.1 port=5000 api_version=v2.0 path=tokens user=admin password=admin-password tenant_name=admin-project strategy=keystone [compute] # Reference data for tests. The ref and ref_alt should be # distinct images/flavors. image_ref=e7ddc02e-92fa-4f82-b36f-59b39bf66a67 image_ref_alt=346f4039-a81e-44e0-9223-4a3d13c92a07 flavor_ref=1 flavor_ref_alt=2 ssh_timeout=300 build_interval=10 build_timeout=600 catalog_type=compute create_image_enabled=true resize_available=true [image] username=admin password=******** tenant=admin auth_url=http://localhost:5000/v2.0
You will want to replace the various configuration option values with ones that correspond to your environment. For the image_ref and image_ref_alt values in the [compute] scetion of the config file, use the UUID you copied from above.
Here is what my fully-replaced config file looks like. Keep in mind, my Devstack environment is running on 192.168.1.98. I’ve highlighted the values different from the sample config…
[identity] use_ssl=False host=192.168.1.98 port=5000 api_version=v2.0 path=tokens user=demo password=pass tenant_name=demo strategy=keystone [compute] # Reference data for tests. The ref and ref_alt should be # distinct images/flavors. image_ref=99a48bc4-d356-4b4d-95d4-650f707699c2 image_ref_alt=99a48bc4-d356-4b4d-95d4-650f707699c2 flavor_ref=1 flavor_ref_alt=2 ssh_timeout=300 build_interval=10 build_timeout=600 catalog_type=compute create_image_enabled=true resize_available=true [image] username = demo password = pass tenant= demo auth_url=http://192.168.1.98:5000/v2.0
Fire Away
The only thing left to do is fire Tempest at your OpenStack environment. Below, I’m executing Tempest in verbose mode.Nosetestsis our standard test runner.
jpipes@uberbox:~/repos/tempest$ nosetests -v tempest
All public and private addresses for ... ok
Providing a network type should filter ... ok
<snip a whole bunch of tests>
An access IPv6 address must match a valid address pattern ... ok
Use an unencoded file when creating a server with personality ... ok
Create a server with name parameter empty ... ok
----------------------------------------------------------------------
Ran 131 tests in 798.125s
OK (SKIP=5)
After you’re done running Tempest — and hopefully everything runs OK — feel free to hit your Devstack Horizon dashboard and log in as your demo user. Unless you made some changes when installing Devstack above, your Horizon dashboard will be available athttp://$DEVSTACK_HOST_IP
.
If you encounter any test failures or issues, please be sure to log bugs for the appropriate project!
Known Issues
You can try running Tempest with the--processes=N
option which uses thenosetest
multiprocessing plugin. You might get a successful test run … but probably not
Likely, you will hit two issues: the first is that you will likely hit the quote limits for your demo user because multiple processes will be creating instances and volumes. You can remedy this by altering the quotas for the tenant you are running the compute tests with.
Secondly, you may run into error output that looks like this:
====================================================================== ERROR: An image for the provided server should be created ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jpipes/repos/tempest/tempest/tests/test_images.py", line 38, in test_create_delete_image self.servers_client.wait_for_server_status(server['id'], 'ACTIVE') File "/home/jpipes/repos/tempest/tempest/services/nova/json/servers_client.py", line 147, in wait_for_server_status raise exceptions.BuildErrorException(server_id=server_id) BuildErrorException: Server 2e0b78fc-cc98-485b-8471-753778bee472 failed to build and is in ERROR status
And in your nova-compute log (or screen output) you might notice something like this:
libvirtError: operation failed: cannot restore domain 'instance-0000001f' uuid 2453b24b-87e1-4f85-9c25-ce3706a8c1d1 from a file which belongs to domain 'instance-0000001f' uuid deb8e941-4693-4768-90cc-03ad98444c85
I’ve not quite gotten to the bottom of this, but there seems to be a race condition that gets triggered in the Compute API when a similar request is received nearly simulataneously. I can reliably reproduce the above error by simply adding--processes=2
to
my invocation of Tempest. I believe there is an issue with the seeding of identifiers, but it’s just a guess. I still have to figure it out. But in the meantime, be aware of the issue.
1.You can certainly use devstack to install a multi-node OpenStack environment, but this tutorial sticks to a single-node environment for simplicity reasons.
相关推荐
开发环境的搭建 nova模块调用介绍 nova源码模块功能介绍 ###添加Nova-api自定义模块 ###数据库表结构的扩展 nova表结构的扩展 keystone表结构的扩展 resetful接口服务的扩展 ###nova数据库调用接口服务的扩展 ...
定制研发:在学习openstack源码级深度解析培训后,你能了解openstack源码的体系结构,并能根据需要进行定制开发,满足您在实际生产环境中OpenStack的各种疑问和不满足的功能。 ------------------------课程内容---...
定制研发:在学习openstack源码级深度解析培训后,你能了解openstack源码的体系结构,并能根据需要进行定制开发,满足您在实际生产环境中OpenStack的各种疑问和不满足的功能。 ------------------------课程内容---...
学习要求: 熟悉基本的linux命令 具备... 定制研发:在学习openstack源码级深度解析培训后,你能了解openstack源码的体系结构,并能根据需要进行定制开发,满足您在实际生产环境中OpenStack的各种疑问和不满足的功能。
你将会学到如何选择和设置虚拟服务器和物理服务器,如何实现软件定义网络以及在企业内部设计、部署和运营一个OpenStack云的技术细节,还会探索如何针对自己的环境对OpenStack部署做出zui佳的定制。zui后,你还会学到...
本篇文章主要介绍了详解Openstack组件部署 — Overview和前期环境准备,具有一定的参考价值,感兴趣的小伙伴们可以参考一下。
OpenStack 包含两个主要模块:Nova 和 Swift,前者是 NASA 开发的虚拟服务器部署和业务计算模块;后者是 Rackspace开发的分布式云存储模块,两者可以一起用,也可以分开单独用。OpenStack除了有 Rackspace 和 NASA 的...
这是一篇OpenStack源代码学习的文档,部署其开发环境
在部署OpenShift环境由一套复制主OpenShift的虚拟机门前由load_balancer的。 这既提供了单点访问又提供了一些HA功能。 这些应用程序在一个或多个OpenShift节点VM上运行。 它们通过专用软件定义网络(SDN)连接,该...
该文档来自CCTC 2016中国云计算技术大会。九州云99Cloud OpenStack开发工程师张雷发表的题为“生产环境中使用Docker自动化部署升级OpenStack的运维实践”的主题演讲,欢迎下载!
你将会学到如何选择和设置虚拟服务器和物理服务器,如何实现软件定义网络以及在企业内部设计、部署和运营一个OpenStack云的技术细节,还会探索如何针对自己的环境对OpenStack部署做出zui佳的定制。zui后,你还会学到...
本教程介绍和解释了如何使用Docker容器和...第五部分是汇总,演示了如何部署和升级配备OpenContrail的OpenStack。为了便于阅读,我们把五部分内容分为两篇博文,第一篇涵盖了创建持续的开发运维工作流和容器构建。咋看
你将会学到如何选择和设置虚拟服务器和物理服务器,如何实现软件定义网络以及在企业内部设计、部署和运营一个OpenStack云的技术细节,还会探索如何针对自己的环境对OpenStack部署做出zui佳的定制。zui后,你还会学到...
OpenStack 包含两个主要模块:Nova 和 Swift,前者是 NASA 开发的虚拟服务器部署和业务计算模块;后者是 Rackspace开发的分布式云存储模块,两者可以一起用,也可以分开单独用。OpenStack除了有 Rackspace 和 NASA 的...
目前的OpenStack的部署工具已经很完备了,尤其是Kolla,至少可以满足目前的各种需求。在部署安装的问题解决后,我们对日后如何用好OpenStack就需要做一下研究。这里整理一下目前所关注和思考的问题,也...对于开发环境
本书从OpenStack终端用户的角色出发,以面向生产系统的OpenStack高可用集群建设为主线,对部署OpenStack高可用集群所依赖的各个基础技术栈和OpenStack核心组件进行了详细的原理讲解,并以实战部署的形式演示了...