<commit_before>[![Build Status](https://travis-ci.org/enovance/infra-virt.svg?branch=master)](https://travis-ci.org/enovance/infra-virt)

# About

Tools to deploy a virtual infrastructure based on a YAML description file. It supports
the following features:

- PXE or boot on image (QCOW2)
- network configuration (bonding, 802.1Q, Jumbo Frame)
- Nested KVM
- snapshot support

## A set of components

- virtualizor.py: create the infrastructure from the YAML file
- virtualize.sh: helper designed to deploy an OpenStack [SpinalStack](http://spinal-stack.readthedocs.org/en/latest/)
- collector.py: create automatically the infrastructure YAML from an existing SpinalStack environment directory.
- scenarios: light scripts to replay/validate an OpenStack upgrade

# Prerequisites

On the local machine:

You must install libvirt-python first.

```sh
pip install -r requirements.txt
```

On the Hypervisor:

We use a Fedora 21 with the following extra packages:

- libvirt
- mtools
- qemu-kvm
- iptables-services

You will need to disable firewalld and enable libvirt:

```sh
sudo systemctl enable libvirtd
sudo systemctl start libvirtd

sudo service iptables save
sudo systemctl disable firewalld
sudo systemctl enable iptables
sudo systemctl stop firewalld
sudo systemctl start iptables
```

## User account

At this point, you must create the user on the Hypervisor this way:

* sudo with no password. e.g: `joe     ALL=(ALL)       NOPASSWD: ALL`
* ssh-key with no password `ssh-keygen`
* ssh-key registred in the /root/.ssh/authorized_keys file<commit_msg>[DOC] add kvm_intel nested flag in Prerequisites section<commit_after>[![Build Status](https://travis-ci.org/enovance/infra-virt.svg?branch=master)](https://travis-ci.org/enovance/infra-virt)

# About

Tools to deploy a virtual infrastructure based on a YAML description file. It supports
the following features:

- PXE or boot on image (QCOW2)
- network configuration (bonding, 802.1Q, Jumbo Frame)
- Nested KVM
- snapshot support

## A set of components

- virtualizor.py: create the infrastructure from the YAML file
- virtualize.sh: helper designed to deploy an OpenStack [SpinalStack](http://spinal-stack.readthedocs.org/en/latest/)
- collector.py: create automatically the infrastructure YAML from an existing SpinalStack environment directory.
- scenarios: light scripts to replay/validate an OpenStack upgrade

# Prerequisites

On the local machine:

You must install libvirt-python first.

```sh
pip install -r requirements.txt
```

On the Hypervisor:

We use a Fedora 21 with the following extra packages:

- libvirt
- mtools
- qemu-kvm
- iptables-services

You will need to disable firewalld and enable libvirt:

```sh
sudo systemctl enable libvirtd
sudo systemctl start libvirtd

sudo service iptables save
sudo systemctl disable firewalld
sudo systemctl enable iptables
sudo systemctl stop firewalld
sudo systemctl start iptables
```

Ensure you have loaded kvm_intel module with nested virtualization support.

```sh
cat /sys/module/kvm_intel/parameters/nested
```

In case not, add the nested flag in the kvm-intel module loading line.

```sh
vi /etc/modprobe.d/kvm.conf
options kvm-intel nested=y
```

## User account

At this point, you must create the user on the Hypervisor this way:

* sudo with no password. e.g: `joe     ALL=(ALL)       NOPASSWD: ALL`
* ssh-key with no password `ssh-keygen`
* ssh-key registred in the /root/.ssh/authorized_keys file
{'fraction_non_alphanumeric': 0.08160886039055669, 'fraction_numerical': 0.004080443019527835, 'mean_word_length': 4.430379746835443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6212607', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1022, 'n_words': 400}