RETIRED, Fuel DevOps tools for managing virtual environments
Go to file
Alexey Stepanov bdb20d5439 Add coverage reporting
Tox target: cover
Exclude:
    tests
    dummy driver
    migrations
    configs
Report: console and html
Threshold: 65%
Current state: 70%

Change-Id: I3d0bb682ed499167e169789d7a222e8ce4637457
2016-05-16 15:04:12 +03:00
bin Add creation date column to snapshot list 2015-06-17 10:31:50 +00:00
devops Merge "Prepare for non voting pylint target" 2016-05-12 15:06:06 +00:00
docs Update unit tests 2016-04-06 14:28:43 +00:00
samples Move SSHClient to separate file 2016-04-12 11:54:30 +03:00
.coveragerc Add coverage reporting 2016-05-16 15:04:12 +03:00
.gitignore Update .gitignore 2015-06-08 07:47:15 +00:00
.gitreview Update .gitreview for new namespace 2015-10-17 22:13:18 +00:00
.pylintrc Prepare for non voting pylint target 2016-05-12 13:20:18 +03:00
.pylintrc_gerrit Prepare for non voting pylint target 2016-05-12 13:20:18 +03:00
LICENSE LICENCE added 2014-06-05 00:40:36 +04:00
MAINTAINERS Add new maintainer to fuel-devops 2016-04-18 10:30:43 +00:00
manage.py Django 1.8 2016-04-25 18:52:38 +03:00
README.md Update Readme.md with usage and install info 2015-12-08 13:11:58 +02:00
run_tests.sh Cleanup in running pep8 tests 2015-06-08 07:57:13 +00:00
setup.py keystoneauth for getting nodes 2016-05-10 11:26:12 +03:00
test-requirements.txt Split requirements for test and main for setup 2016-05-04 14:25:16 +03:00
tox.ini Add coverage reporting 2016-05-16 15:04:12 +03:00

fuel-devops

Fuel-Devops is a sublayer between application and target environment(all of supported by libvirt currently).

This application is used for testing purposes like grouping virtual machines to environments, booting KVM VM's 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.

Installation

The installation procedure can be implemented via PyPI in Python virtual environment (suppose you are using Ubuntu 12.04 or Ubuntu 14.04):

Before using it, please install the following required dependencies:

sudo apt-get install git \
postgresql \
postgresql-server-dev-all \
libyaml-dev \
libffi-dev \
python-dev \
python-libvirt \
python-pip \
qemu-kvm \
qemu-utils \
libvirt-bin \
libvirt-dev \
ubuntu-vm-builder \
bridge-utils

sudo apt-get update && sudo apt-get upgrade -y

Install packages needed for building python eggs

sudo apt-get install python-virtualenv libpq-dev libgmp-dev

In case you are using Ubuntu 12.04 lets update pip and virtualenv, otherwise you can skip this step

sudo pip install pip virtualenv --upgrade
hash -r

Create virtualenv for the devops project

virtualenv --system-site-packages <path>/fuel-devops-venv

Note

Activate virtualenv and install devops package using PyPI.

source  <path>/fuel-devops-venv/bin/activate
pip install git+https://github.com/openstack/fuel-devops.git@<version> --upgrade

Configuration

Basically fuel-devops requires that the following system-wide settings are configured:

  • Default libvirt storage pool is active (called default)
  • Current user must have permission to run KVM VMs with libvirt
  • PostgreSQL server running with appropriate grants and schema for devops
  • [Optional] Nested Paging is enabled
  • [Optional] Network filter for host bridges should be disabled: http://wiki.libvirt.org/page/Net.bridge-nf-call_and_sysctl.conf.

Usage

Run dos.py -h to see full list of supported actions

Operation commands:
list                Show virtual environments
show                Show VMs in environment
erase               Delete environment
start               Start VMs
destroy             Destroy(stop) VMs
suspend             Suspend VMs
resume              Resume VMs
revert              Apply snapshot to environment
snapshot            Make environment snapshot
sync                Synchronization environment and devops
snapshot-list       Show snapshots in environment
snapshot-delete     Delete snapshot from environment
net-list            Show networks in environment
time-sync           Sync time on all env nodes
revert-resume       Revert, resume, sync time on VMs
version             Show devops version
create              Create a new environment
slave-add           Add a node
slave-change        Change node VCPU and memory config
slave-remove        Remove node from environment
admin-setup         Setup admin node
admin-change        Change admin node VCPU and memory config
node-start          Start node in environment
node-destroy        Destroy (power off) node in environment
node-reset          Reset (restart) node in environment

Use dos.py -h to see help for specific command

positional arguments:
ENV_NAME              environment name

optional arguments:
-h, --help            show this help message and exit
--vcpu VCPU_COUNT     Set node VCPU count
--node-count NODE_COUNT, -C NODE_COUNT
                    How many nodes will be created
--ram RAM_SIZE        Set node RAM size
--net-pool NET_POOL, -P NET_POOL
                    Set ip network pool (cidr)
--iso-path ISO_PATH, -I ISO_PATH
                    Set Fuel ISO path
...

Testing

There are next test targets that can be run to validate the code.

tox -e pep8 - style guidelines enforcement
tox -e py27 - unit and integration testing