Giter Club home page Giter Club logo

hpc-tests's Introduction

HPC tests used in HPC-CI with terraform libvirt provider as the test environment.

You can also find some simplistic shell tests which can be executed on the HPC cluster provisioned in a diffrent way, for instance by openQA.

The test repository is providing HPC tests which are meant to run in combination with terraform tool. For details see: https://www.terraform.io/

The terraform provider being used is: libvirt Please see: https://github.com/dmacvicar/terraform-provider-libvirt

Both, the terraform tool, as well as terraform-provider-libvirt must be installed on the system to run the tests.

The project provides .tf files.

Table of Contents

  1. Terraform Installation
  2. VM images
  3. Terraform usage
  4. Common errors

Terraform Installation

The following section provides a set of instructions to install Terraform together with the libvirt provider along with the virtualization packages.

Leap 15.0

zypper ar -G https://download.opensuse.org/repositories/systemsmanagement:/terraform/openSUSE_Leap_15.0/systemsmanagement:terraform.repo
zypper in -y libvirt terraform terraform-provider-libvirt
systemctl enable libvirtd
systemctl status libvirtd

Other OpenSuse versions

For Tumbleweed, the following repository must be used:

https://download.opensuse.org/repositories/systemsmanagement:/terraform/openSUSE_Tumbleweed/systemsmanagement:terraform.repo

For 42.3, the following repository shall be used:

https://download.opensuse.org/repositories/systemsmanagement:/terraform/openSUSE_Leap_42.3/systemsmanagement:terraform.repo

Manual Installation

Terraform also comes as downloadable binary for Linux, you can find all the builds (even beta versions of releases in development) here.

Just extract the .zip and place the binary in /usr/bin/terraform.

NOTE: It is recommended to use the official repositories to avoid compatibility issues.

VM images

Terraform takes an image (e.g. qcow2) and boots it without user interaction. If you want to use features like assigning an IP automatically (DHCP), you will need to prepare an image to boot automatically a pre-installed OS with proper ifcfg files according to your needs.

Example

Prepare image with only 1 NIC with DHCP IP assignment:

  1. Make sure the image contains a pre-installed OS.
  2. GRUB_TIMEOUT parameter should be set to 0 or any other value different than -1 in /etc/default/grub
  3. Remove /etc/udev/rules.d/70-persistent-net.rules to force usage of eth0
  4. Make sure /etc/sysconfig/network/ifcfg-eth0 contains BOOTPROTO='dhcp'

Terraform usage

Terraform works on directory as environment. Normally, for each configuration, a directory shall be created.

Create a directory example and place the corresponding .tf file in it.

terraform init
terraform apply -auto-approve

To clean the environment (VM, disk, network, ...) run the command:

terraform destroy -auto-approve

Common errors

  • libvirt_volume.myvdisk: can't find storage pool 'default' Create the default storage pool by doing:

    virsh pool-create-as --name default --type dir --target /var/lib/libvirt/images
  • libvirt_domain.domain-sle: Error defining libvirt domain: virError(Code=8, Domain=44, Message='invalid argument: could not find capabilities for domaintype=kvm ') This is a common problem when using nested virtualization. If you are running Terraform inside a VM, make sure Nested Virtualization is enabled on the host and on the VM you can find the Virtual-Machine eXtensions (VMX) CPU flag lscpu|grep vmx. A quick way to check that feature in your VM is by issuing the command virt-host-validate. If you get the following output, you probably don't have Nested Virtualization enabled as the result shall be "PASS".

    QEMU: Checking for hardware virtualization : FAIL (Only emulated CPUs are available, performance will be significantly limited)

    This guide provides comprehensive information with all the steps to enable Nested Virtualization.

hpc-tests's People

Contributors

jlausuch avatar mslacken avatar schlad avatar

Watchers

 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.