XenServer/verify/How to verify the deployment of MOS+XS by using rally

Citrix has released XenServer plugin for Fuel, so that we can deploy Openstack on XenServer by using Mirantis Fuel. We can search on the page of Mirantis Fuel Plugin Catalog to get this plugin. This page is to show how to run tempest in the deployment of "MOS+XS" to do verification by using the benchmarking tool - Rally.

Setup lab env with Mirrantis Openstack
The first step is to setup a lab installed with Mirrantis Openstack by using fuel. You can follow the following blog to setup the environment on a single xenserver:

https://www.citrix.com/blogs/2015/10/23/deploying-mirantis-openstack-on-a-single-xenserver/

But please read the following notes before setting the env:

1). As Fuel 7 base has a bug(https://bugs.launchpad.net/fuel/+bug/1503638), we can't set Nova-network without vlan tag. So if you use "FlatDHCP Manager" on Fuel 7, please follow the following link to apply Mirantis OpenStack 7.0 Maintenance Update 1.

https://docs.mirantis.com/openstack/fuel/fuel-7.0/maintenance-updates.html

2). Ensure DNS server is available in the fuelmenu: the fuel master node depends on the configured DNS to resolve domain names and it runs a DNS service which is depended by the other Openstack Slave nodes. So please make sure the DNS server is available on the fuel master node. Otherwise it will meet the repo unavailable error in network configuration verification step.

3). As the tempest test will consume much disk space with cinder testing, please ensure the volume of cinder has enough space. Suggest its size is bigger than 50GB.

4). As the rally test will be done automatically, we need a pre-generated key and certificate to enable TLS for OpenStack public endpoints. To make it simpler, let's disable the "Public TLS" when set up the testing environments with FUEL GUI.

5). Fix for console log file generation and rotation to pass console log relative cases

Bug: https://bugs.launchpad.net/fuel-plugin-xenserver/+bug/1521483

Workaround:

wget --no-check-certificate https://raw.githubusercontent.com/openstack/nova/master/tools/xenserver/rotate_xen_guest_logs.sh		chmod +x rotate_xen_guest_logs.sh		echo '* * * * * /root/rotate_xen_guest_logs.sh' >/var/spool/cron/root *6). By default, nova quota function is disabled. Please enable it firstly to pass the relative cases：

On Controller node, change fuel plugin to set /etc/nova/nova.conf with: quota_driver=nova.quota.DBQuotaDriver; restart the relative services; and then update DB to trigger quota usage refresh:



install Rally on Controller node
a. Upgrade the special package of pbr: Rally depends on the model of pbr_json which is not a part of the installed pbr. We need upgrade pbr firstly

easy_install -U pbr

b. Install Rally

wget -q -O- https://raw.githubusercontent.com/openstack/rally/master/install_rally.sh

Note: It may failed at the first time due to lack of some required packages. Just follow the instruction from the error messages to install all of the needed packages. And then re-install Rally.



Configure Rally
a. The default image is with the disk_format as qcow2 which is not supported by XenServer. So we need to specify the image url, disk format and container format for the vhd image.

Due to the following bug, we need to cherry pick the fixing patch to make the field of cirros_img_url to take effective.

https://bugs.launchpad.net/rally/+bug/1530075

https://review.openstack.org/#/c/262636/

b. "admin" is the default swift operator role created by the way applied in the Openstack deployment step; but the rally default conf is Member. So it will have role mismatching issue. We need change the rally conf as what's showing by the following snapshot.



Install tempest
rally verify install

Filter out the known failed cases
cd /root/.rally/tempest/base/tempest_base*

sudo git fetch https://review.openstack.org/openstack/tempest refs/changes/88/187688/1

sudo git cherry-pick FETCH_HEAD

wget -O .excluded_tests https://raw.githubusercontent.com/openstack/xenapi-os-testing/master/tempest_exclusion_list

Create a deployment in Rally on the Controller node
source openrc admin

rally deployment create --fromenv --name=mycloud

Start testing
rally verify start

Check Tempest Results
a. Show verify list:

root@node-1:~# rally verify list

+--+--+--+---+--+++---+

| UUID                                        | Deployment UUID                  | Set name | Tests | Failures | Created at                 | Duration       | Status    |

+--+--+--+---+--+++---+

| fb808122-b4f6-4b11-bb8d-d8e85580a211 | 2a0766b5-885d-4b0e-a041-963d1c6ea429 | full|	1694|68|2015-12-08 11:06:57.617510|	finished|

+--+--+--+---+--+++---+

b. Show test case list and the result for the specific verify

root@node-1:~# rally verify show fb808122-b4f6-4b11-bb8d-d8e85580a211

c. Show more details include traceback for failures.

rally verify show --detailed fb808122-b4f6-4b11-bb8d-d8e85580a211