Git Product home page Git Product logo

infra-virt's Introduction

Build Status

Virtualization

The virtualization directory contains the tools which aims to standardize the way we test an architecture in a virtual environment.

Prerequisites

On the local machine:

You must install libvirt-python first.

pip install -r requirements.txt

On the Hypervisor:

We use a Fedora 21 with the following extra packages:

  • libvirt
  • mtools
  • qemu-kvm

You will need to disable firewalld and enable libvirt:

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

Collector

$ ./collector.py --help
usage: collector.py [-h] [--config-dir CONFIG_DIR] [--output-dir OUTPUT_DIR]
                    --sps-version SPS_VERSION [--qcow]

Collect architecture information from the edeploy directory as generated by
config-tools/download.sh.

optional arguments:
  -h, --help            show this help message and exit
  --config-dir CONFIG_DIR
                        The config directory absolute path.
  --output-dir OUTPUT_DIR
                        The output directory of the virtual configuration.
  --sps-version SPS_VERSION
                        The SpinalStack version.
  --qcow                Boot on qcow image.

Virtualizor

usage: virtualizor.py [-h] [--replace] [--pub-key-file PUB_KEY_FILE]
                      [--prefix PREFIX] [--public_network PUBLIC_NETWORK]
                      input_file target_host

Deploy a virtual infrastructure.

positional arguments:
  input_file            the YAML input file, as generated by collector.py.
  target_host           the name of the libvirt server. The local user must be
                        able to connect to the root account with no password
                        authentification.

optional arguments:
  -h, --help            show this help message and exit
  --replace             existing conflicting resources will be remove
                        recreated.
  --pub-key-file PUB_KEY_FILE
                        the path to the SSH public key file that must be
                        injected in the install-server root and jenkins
                        account
  --prefix PREFIX       optional prefix to put in the machine and network to
                        avoid conflict with resources create by another
                        virtualizor instance. Thanks to this parameter, the
                        user can run as virtualizor as needed on the same
                        machine.
  --public_network PUBLIC_NETWORK
                        allow the user to pass the name of a libvirt NATed
                        network that will be used as a public network for the
                        install-server. This public network will by attached
                        to eth1 interface and IP address is associated using
                        the DHCP.

Example

$ cd ~
$ git clone https://github.com/enovance/config-tools.git
$ cd config-tools/
$ git checkout I.1.3
$ ./download.sh I.1.3.0 deployment-3nodes-D7.yml version=D7-I.1.3.0

It generates a directory 'top/' in the current directory.

$ cd ~
$ git clone https://github.com/enovance/virt-infra.git
$ cd virt-infra/
$ ./collector.py --config-dir ~/config-tools/top/etc --sps-version D7-I.1.3.0
Virtual platform generated successfully at 'virt_platform.yml' !

It will generate a file 'virt_platform.yml' which describe the corresponding virtual platform. You may take a look at a sample in the virtualization directory.

$ cd ~/virt-infra/
$ ./virtualizor.py virt_platform.yml my-hypervisor-node --replace --pub-key-file ~/.ssh/boa.pub

virtualize.sh

virtualize.sh is a script built on top of virtualizor.py to play SpinalStack deployment and upgrade.

$ ./virtualize.sh --help
usage: virtualize.sh [OPTION] workdir1 workdir2 etc
Collect architecture information from the edeploy directory as generated
by config-tools/download.sh.

optinal arguments:
  -H|--hypervisor=name: change the hypervisor name, default ()
arguments:
virtualize.sh will use the first argument as the location of the
SpinalStack environment to deploy. It will then upgrade the newly deployed
SpinalStack to the following environment directory.

For example: ./virtualize.sh I.1.2.1 I.1.3.0 I.1.3.1
will deploy environment I.1.2.1 and upgrade to I.1.3.0 and then I.1.3.1.

infra-virt's People

Contributors

prophidys avatar fredericlepied avatar ylamgarchal avatar goneri avatar

Watchers

James Cloos avatar Jean-Francis AHANDA avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.