Merge "Devops documentation cleanup"

This commit is contained in:
Jenkins 2014-04-17 15:01:33 +00:00 committed by Gerrit Code Review
commit 426e2c40cc
2 changed files with 139 additions and 80 deletions

View File

@ -247,38 +247,8 @@ Building the Fuel ISO
Running the FuelWeb Integration Test
------------------------------------
#. Install libvirt and Devops library dependencies::
sudo apt-get install libvirt-bin python-libvirt python-ipaddr python-paramiko
sudo pip install xmlbuilder django==1.4.3
#. Configure permissions for libvirt and relogin or restart your X for
the group changes to take effect (consult /etc/libvirt/libvirtd.conf
for the group name)::
GROUP=`grep unix_sock_group /etc/libvirt/libvirtd.conf|cut -d'"' -f2`
sudo useradd `whoami` kvm
sudo useradd `whoami` $GROUP
chgrp $GROUP /var/lib/libvirt/images
chmod g+w /var/lib/libvirt/images
#. Clone the Mirantis Devops virtual environment manipulation library
from GitHub and install it where FuelWeb Integration Test can find
it::
git clone git@github.com:Mirantis/devops.git
cd devops
python setup.py build
sudo python setup.py install
#. Configure and populate the Devops DB::
SETTINGS=/usr/local/lib/python2.7/dist-packages/devops-2.0-py2.7.egg/devops/settings.py
sed -i "s/'postgres'/'devops'/" $SETTINGS
echo "SECRET_KEY = 'secret'" >> $SETTINGS
sudo -u postgres createdb devops
sudo -u postgres createuser -SDR devops
django-admin.py syncdb --settings=devops.settings
For fuel-devops configuration info please refer to [Devops
Guide](http://docs.mirantis.com/fuel-dev/devops.html) article.
#. Run the integration test::
@ -291,10 +261,11 @@ Running the FuelWeb Integration Test
connected to 3 virtual networks)::
cd fuel-main
export PYTHONPATH=$(pwd)
export ENV_NAME=fuelweb
export PUBLIC_FORWARD=nat
export ISO_PATH=`pwd`/build/iso/fuelweb-centos-6.5-x86_64.iso
nosetests -w fuelweb_test -s fuelweb_test.integration.test_admin_node:TestAdminNode.test_cobbler_alive
./fuelweb_tests/run_tests.py --group=test_cobbler_alive
#. The test harness creates a snapshot of all nodes called 'empty'
before starting the tests, and creates a new snapshot if a test

View File

@ -13,79 +13,167 @@ This application is used for testing purposes like grouping virtual machines to
environments, booting KVM VMs locally from the ISO image and over the network
via PXE, creating, snapshotting and resuming back the whole environment in
single action, create virtual machines with multiple NICs, multiple hard drives
and many other customizations with a few lines of code in system tests. For
sources please refer to https://github.com/stackforge/fuel-devops.
and many other customizations with a few lines of code in system tests.
For sources please refer to [fuel-devops@github](https://github.com/stackforge/fuel-devops)
Dependencies ::
sudo apt-get install postgresql python-psycopg2 python-ipaddr python-libvirt
sudo apt-get install python-paramiko python-django git python-xmlbuilder
sudo apt-get install python-libvirt python-django-south
git clone https://github.com/stackforge/fuel-devops.git
cd fuel-devops/
export PYTHONPATH=$PYTHONPATH:$(pwd)
sudo apt-get install postgresql \
python-psycopg2 \
python-ipaddr \
python-libvirt \
python-paramiko \
python-django \
git \
python-xmlbuilder \
python-libvirt \
python-django-south
**NOTE** Depending from your distro some of these packages could not exists in your distro upstream repositories. In this case please refer to *Devops installation in virtualenv* chapter.
Devops Installation from packages
---------------------------------
Here is nothing strange just do:
sudo apt-get install postgresql \
python-psycopg2 \
python-ipaddr \
python-libvirt \
python-paramiko \
python-django \
git \
python-xmlbuilder \
python-libvirt \
python-django-south
then clone fuel-devops repo and run setup.py:
git clone git://github.com/stackforge/fuel-devops.git
cd fuel-devops
python ./setup.py
Devops installation in virtualenv
---------------------------------
First let's install packages required for that way:
apt-get install postgresql-server-dev-all python-libvirt python-dev python-django
Then create virtualenv:
virtualenv --system-site-packages devops-venv
And install devops inside it:
. devops-venv/bin/activate
pip install git+https://github.com/stackforge/fuel-devops.git --upgrade
setup.py in fuel-devops repository does everything required.
System wide settings required for devops
----------------------------------------
Basicly devops requires the following:
* Existent libvirt's pool(called 'default' by default)
* Permissions to run KVM VMs with libvirt
* Alive Postgresql database with grants and devops schema
* Optionally, Nested Paging enabled
libvirt pool
~~~~~~~~~~~~
sudo virsh pool-define-as --type=dir --name=default --target=/var/lib/libvirt/images
sudo virsh pool-autostart default
sudo virsh pool-start default
Permissions to run KVM VMs with libvirt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo usermod $(whoami) -a -G libvirtd,sudo
Alive Postgresql database with grants and devops schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo sed -ir 's/peer/trust/' /etc/postgresql/9.1/main/pg_hba.conf
sudo service postgresql restart
django-admin syncdb --settings=devops.settings
django-admin migrate devops --settings=devops.settings
django-admin.py syncdb --settings=devops.settings
django-admin.py migrate devops --settings=devops.settings
**NOTE** Depending from your distro django-admin.py may refer to system-wide django installed from package.
In this case you could get an exception means devops.settings module is not resolvable. To fix this run django-admin.py (or django-admin) with full path:
./bin/django-admin syncdb --settings=devops.settings
./bin/django-admin migrate devops --settings=devops.settings
Optionally, Nested Paging enabled
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This option enables in BIOS and turns on by kvm kernel module by default.
To load kernel module run
kvm-ok
it will show something like
INFO: /dev/kvm exists
KVM acceleration can be used
Then run
cat /sys/module/kvm_intel/parameters/nested
There will be Y letter.
Environment creation via Devops + Fuel_main
-------------------------------------------
If you want to install a Fuel node + bootstrap for slave nodes, you will
need to run the following commands::
sudo apt-get install python-pip postgresql-server-dev-all python-dev git
sudo apt-get install python-libvirt libvirt-bin virt-manager postgresql
sudo apt-get install qemu-utils qemu-kvm pm-utils python-virtualenv
Clone fuel-main ::
Clone fuel-main:
git clone https://github.com/stackforge/fuel-main
cd fuel-main/
Create pool 'default' ::
Install requirements:
sudo virsh pool-define-as --type=dir --name=default --target=
/var/lib/libvirt/images
sudo virsh pool-autostart default
sudo virsh pool-start default
sudo usermod $USER -a -G libvirtd,sudo
sudo reboot
pip install -r ./fuelweb_test/requirements.txt --upgrade
Check for KVM support (the output should be 'KVM acceleration can be used') ::
If you don't have a Fuel ISO and wanna build it please refer to
[building-fuel-iso](http://docs.mirantis.com/fuel-dev/develop/env.html#building-the-fuel-iso) section.
kvm-ok
Should be 'Y' ::
cat /sys/module/kvm_intel/parameters/nested
cd fuel-main/
virtualenv venv/fuelweb_test --system-site-packages
. venv/fuelweb_test/bin/activate
pip install -r fuelweb_test/requirements.txt
sudo sed -ir 's/peer/trust/' /etc/postgresql/9.1/main/pg_hba.conf
sudo service postgresql restart
django-admin.py syncdb --settings devops.settings
Please refer to
`building-fuel-iso <http://docs.mirantis.com/fuel-dev/develop/env.html#building-the-fuel-iso>`_
section.
Next, you need to define several variables for the future environment ::
Next, you need to define several variables for the future environment:
export ISO_PATH=<path_to_iso>
export NODES_COUNT=<number_nodes>
export ENV_NAME=<name_of_env>
Alternatively, you can edit this file ::
Alternatively, you can edit this file to set them as a default values:
fuelweb_test/settings.py
Start tests by running this command::
Start tests by running this command:
utils/jenkins/system_tests.sh -t test -w $(pwd) -j fuelweb_test -i
$ISO_PATH -V $(pwd)/venv/fuelweb_test -o --group=setup
export PYTHONPATH=$(pwd)
./utils/jenkins/system_tests.sh -t test -w $(pwd) -j fuelweb_test -i $ISO_PATH -o --group=setup
For more information about how tests work, read the usage information ::
"utils/jenkins/system_tests.sh" -h
"./utils/jenkins/system_tests.sh" -h
Important notes for Savanna and Murano tests
--------------------------------------------
* Don't recommend to start tests without kvm
* Put Savanna image savanna-0.3-vanilla-1.2.1-ubuntu-13.04.qcow2 (md5 9ab37ec9a13bb005639331c4275a308d) to /tmp/ before start for best performance. If Internet available the image will download automatically.
* Put Murano image cloud-fedora.qcow2 (md5 6e5e2f149c54b898b3c272f11ae31125) to /tmp/ before start. Murano image available only internally.
* Murano tests without Internet connection on the instances will be failed
* For Murano tests execute 'export SLAVE_NODE_MEMORY=5120' before tests run.
* To get heat autoscale tests passed put image F17-x86_64-cfntools.qcow2 in /tmp before start
Run single OSTF tests several times
-----------------------------------
* Export environment variable OSTF_TEST_NAME. Example: export OSTF_TEST_NAME='Request list of networks'
* Export environment variable OSTF_TEST_RETRIES_COUNT. Example: export OSTF_TEST_RETRIES_COUNT=120
* Execute test_ostf_repetable_tests from tests_strength package
sh "utils/jenkins/system_tests.sh" -t test -w $(pwd) -j "fuelweb_test" -i "$ISO_PATH" -V $(pwd)/venv/fuelweb_test -o --group=create_delete_ip_n_times_nova_flat