Skip to content
Snippets Groups Projects

Usage

The terraform configuration provides a simple way to start AWS EC2 instances with the necessary software and configuration to run experiments.

As preparation please configure a proper ssh key in rewan/module.tf and rewan/server.user-data.yml.

$ terraform init config-geo
$ terraform apply config-geo
$ ./extract_ips.py
... Use servers ...
$ terraform destroy config-geo

Warning: Seamless switching between configs is not always possible! Destroy the servers first if necessary.

Setup Description

The rewan module contains the configuration for the VMs of a region whereas config-geo contains the actual VM and regions setup in config-geo.

VMs

The default instance type is configured in rewan/variables.tf and currently defaults to a small t3 instance. The configuration uses spot instances with a price limit of 0.02 dollars. In case a region has no spot capacity available it is possible to use regular on-demand instances instead (on a per region basis).

The virtual machines run Ubuntu 18.04 and install Java 11, rsync/moreutils (necessary for the experiment scripts), nethogs/iftop (network traffic measurements) and chrony (NTP time synchronization). The software installation can run for a few minutes after VM startup.

The firewall of each VM allows access via SSH, permits pinging the VMs and opens TCP ports 8170-8199 for connections between the replicas.

Region Setup

The region setup for starting VMs in config-geo consists of three setup steps:

  1. Configure a provider for each region.
  2. Include the rewan module for each region and configure it to use the matching provider. The subnet specification configures the VPC subnets which also specify a VMs region. The module creates counts VMs, which are assigned to VPC subnets from first to last. If there are more VMs than subnets, then these VMs are added to the last subnet.
  3. Finally, add the rewan module to the outregs variable. This allows the extract_ips.py to retrieve the VMs internal and external IPs.