Skip to content

Latest commit

 

History

History

vagrant

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Bootstrapping Virtual Machines with Vagrant

Vagrant will handle Virtual Machines for the cluster. The script uses Ubuntu Xenial 64-bit image.

Prerequisites

  • Vagrant installed on host machine
  • Generated SSH keys on host machine ssh-keygen

Configuration

In Vagrantfile set variables:

  • CLUSTER_SIZE - number of VMs to create (default 4)
  • SSH_PRIVATE_KEY - path to host SSH private key (default ~/.ssh/id_rsa)
  • SSH_PUBLIC_KEY - path to host SSH public key (default ~/.ssh/id_rsa.pub)

Bootstrap Virtual Machines

Each VM will be configured in following way:

where {i} is subsequent number of VM from 1 to CLUSTER_SIZE

To start VMs execute command:

vagrant up

To start specific VMs provide their names to the command:

vagrant up node1 node2

Check status of Virtual Machines

To get a status of VMs run:

vagrant status

This command will return similar output:

Current machine states:

node1                     running (virtualbox)
node2                     running (virtualbox)
node3                     running (virtualbox)
node4                     running (virtualbox)

This environment represents multiple VMs. The VMs are all listed above with their current state. 
For more information about a specific VM, run `vagrant status NAME`.

SSH to a Virtual Machine

To connect to a running VM via SSH run:

vagrant ssh node1

Clean Up Virtual Machines

To tear down Virtual Machines run:

vagrant destroy

To destroy specific VMs provide their names to the command:

vagrant destroy node1 node2

More Vagrant Commands

For more Vagrant commands visit Vagrant Docs Command-Line Interface