Git Product home page Git Product logo

vm-cluster's Introduction

About

Simple Vagrant setup to quickly create multiple VM`s for testing and developing Epiphany clusters locally.

Requirements

Windows

Ubuntu

Other Linux distros should work but are untested.

MacOS

MacOS should work but is untested.

Usage

Configuration

There are 2 ways of configuration.

1: you can quickly create a number of similar VM`s with only the basic config:

cfg = {
  :provider => "hyperv", # Set the which vagrant provider we want to use. "hyperv" on Windows and "libvirt" on Linux and MacOS.
  :group => "group1", # Group included in a VM name. 
  :vm_count => 4, # If set to 0 a set of VM`s will be created with the definitions in boxes below. Of > 0 then the general cfg (vm_cpus, vm_memory) is used.
  :vm_prefix => "prefix", # Prefix that will be used for creating the clusters.
  :vm_cpus => 2, # Number of CPU cores each VM should have when using the vm_count.
  :vm_memory => 2048, # Amount of memory each VM should have when using the vm_count.
  :vm_box => "generic/ubuntu1804",  #"generic/rhel7", "centos/7", # Image to use for the VM`s.
  :ssh_priv => "/path/to/ssh/private/key",  # Path of the private SSH key that you want to use to connect to the VMs
  :ssh_public => "/path/to/ssh/public/key",  # Path of the public SSH key that you want to use to connect to the VMs
  :network_switch => "switchname" # HYPER-V ONLY - The network switch you want to use to connect the VMs to. This must be created in Hyper-V manager before hand and needs to be an external switch.
}

With the above configuration 4 VM`s will be created labeled prefix1 ... ```prefix4``` with the specifications defined in ```vm_cpus``` and ```vm_memory```. The hostnames will be the same is the created VM labels.

2: You can set the vm_count to 0 and define a number of custom VM`s based on the configuration in the boxes array:

boxes = [
  {
    :name => "Kubernetes Master", # Name of the machine.
    :hostname => "kmaster", # Hostname this VM will get on the network.
    :memory => 2048, # Ammount of memory this VM will have.
    :cpus => 2 # Number of CPU cores this VM will have.
  },
  {
    :name => "Kubernetes Node 1", # Name of the machine.
    :hostname => "knode1", # Hostname this VM will get on the network.
    :memory => 2048, # Ammount of memory this VM will have.
    :cpus => 2 # Number of CPU cores this VM will have.
  },
  {
    :name => "Kubernetes Node 2", # Name of the machine.
    :hostname => "knode2", # Hostname this VM will get on the network.
    :memory => 2048, # Ammount of memory this VM will have.
    :cpus => 2 # Number of CPU cores this VM will have.
  }
]

This will create 3 VM`s with the defined settings.

The following settings of the basic config will be used for both approaches described above:

cfg = {
  :provider => "hyperv" # Set the which vagrant provider we want to use. "hyperv" on Windows and "libvirt" on Linux and MacOS.
  :group => "group1", # Group included in a VM name. 
  :vm_box => "generic/ubuntu1804",  #"generic/rhel7", "centos/7", # Image to use for the VM`s.
  :ssh_priv => "/path/to/ssh/private/key",  # Path of the private SSH key that you want to use to connect to the VMs.
  :ssh_public => "/path/to/ssh/public/key",  # Path of the public SSH key that you want to use to connect to the VMs.
  :network_switch => "switchname"  # HYPER-V ONLY. The network switch you want to use to connect the VMs to. This must be created in Hyper-V manager before hand and needs to be an external switch.
}

VM Management

You can use the normal Vagrant commands to manage the VM`s you create for the cluster. Few of the most common:

  • vagrant up ... to create a new set of VM`s
  • vagrant destroy ... to destroy a set of VM`s
  • vagrant snapshot ... for creating and managing VM snapshots. Usefull when developing functionality that needs to be retested frequently.

vm-cluster's People

Contributors

seriva 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.