Giter VIP home page Giter VIP logo

vm-cluster's Introduction

VM-CLUSTER

Quick Start

$ git clone https://github.com/refraction-ray/vm-cluster.git
$ cd vm-cluster
# after editing vars_default.sh
$ sudo ./vm-cluster cluster-up # build up a VM cluster
# now you can ssh into VMs, and play around
$ sudo ./vm-cluster nodes-add 3 4 # add the third and fourth VM as compute nodes to the cluster
$ sudo ./vm-cluster cluster-down # tear down the whole VM cluster

Prerequisite

You should have a host Linux machine with KVM module enabled. You should also have some packages installed. For Ubuntu, you can apt install qemu-kvm libvirt-bin virtinst ansible.

How does it work

The bash script makes use of virsh interface to provision KVM based VMs and utilizes ansible playbooks to further configure the cluster.

In the first provision phase, we use the official Ubuntu cloud image and also make .iso file to provide data for cloud init within VM.

In the second configuration phase, we apply several ansible-playbooks on VM, and build a full featured HPC cluster with well configured slurm work load manager.

How to customize

The first place you have to go is vars_default.sh. Here you can edit the variables, specifically, you must specify a pair of ssh keys, public key string as variable sshkey, absolute path of secret key file as variable keyfile. You can only ssh into VMs, after you properly configured ssh key pairs at the beginning. The default ip for the master VM node is 192.168.100.100, which can be tuned by ip24 for a different ip prefix.

Furthermore, if you want to have finer control on the configuration of VM, you can customize ansible roles by hand and even change the template files in bootstrap. You may particularly be interested in slurm.conf in bootstrap/roles/slurm/template/.

How universal is the script

Only tested on the combination of KVM based VM, Ubuntu OS and bash for host. And ansible playbooks are specially designed for Ubuntu18.04 on VM side. I have no intention to make the script more robust or platform agnostic. But PRs on this are welcome.

vm-cluster's People

Contributors

refraction-ray 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.