This page describes how to configure a VM for running ETSI TeraFlowSDN(TFS) controller using [OpenStack](https://www.openstack.org/). It has been tested with OpenStack Kolla up to Yoga version.
# Create a Security Group in OpenStack
In OpenStack, go to Project - Network - Security Groups - Create Security Group with name TFS
Add the following rules:
|Direction |Ether Type |IP Protocol |Port Range | Remote IP Prefix|
__Note__: The IP address will be assigned depending on the network you have configured inside OpenStack. This IP will have to be modified in TeraFlow configuration files which by default use IP 10.0.2.10
# Create a flavour
## From dashboard (Horizon)
Go to Admin - Compute - Flavors and press Create Flavor
This page describes how to configure a VM for running ETSI TeraFlowSDN(TFS) controller using [Oracle VirtualBox](https://www.virtualbox.org/). It has been tested with VirtualBox up to version 6.1.40 r154048.
# Create a NAT Network in VirtualBox
In "Oracle VM VirtualBox Manager", Menu "File > Preferences... > Network", create a NAT
network with the following specifications:
|Name |CIDR |DHCP |IPv6 |
|-----------|-----------|--------|--------|
|TFS-NAT-Net|10.0.2.0/24|Disabled|Disabled|
Within the newly created "TFS-NAT-Net" NAT network, configure the following IPv4
forwarding rules:
|Name|Protocol|Host IP |Host Port|Guest IP |Guest Port|
__Note__: IP address 10.0.2.10 is the one that will be assigned to the VM.
# Create VM in VirtualBox:
- Name: TFS-VM
- Type/Version: Linux / Ubuntu (64-bit)
- CPU (*): 4 vCPUs @ 100% execution capacity
- RAM: 8 GB
- Disk: 60 GB, Virtual Disk Image (VDI), Dynamically allocated
- Optical Drive ISO Image: "ubuntu-22.04.X-live-server-amd64.iso"
- Download the latest Long Term Support (LTS) version of the *Ubuntu Server* image from [Ubuntu 22.04 LTS](https://releases.ubuntu.com/22.04/), e.g., "ubuntu-22.04.X-live-server-amd64.iso".
- __Note__: use Ubuntu Server image instead of Ubuntu Desktop to create a lightweight VM.
This page describes how to configure a physical server for running ETSI TeraFlowSDN(TFS) controller.
# Server Specifications
### Minimum Server Specifications for development and basic deployment
- CPU: 4 cores
- RAM: 8 GB
- Disk: 60 GB
- 1 GbE NIC
### Recommended Server Specifications for development and basic deployment
- CPU: 6 cores
- RAM: 12 GB
- Disk: 80 GB
- 1 GbE NIC
### Server Specifications for best development and deployment experience
- CPU: 8 cores
- RAM: 32 GB
- Disk: 120 GB
- 1 GbE NIC
**NOTE**: the specifications listed above are provided as a reference. They depend also on the CPU clock frequency, the RAM memory, the disk technology and speed, etc.
For development purposes, it is recommended to run the VSCode IDE (or the IDE of your choice) in a more powerful server, for instance, the recommended server specifications for development and basic deployment.
Given that TeraFlowSDN follows a micro-services architecture, for the deployment, it might be better to use many clusterized servers with many slower cores than a single server with few highly performant cores.
# Clusterized Deployment
You might consider creating a cluster of machines each featuring, at least, the minimum server specifications. That solution brings you scalability in the future.
# Networking
No explicit indications are given in terms of networking besides that servers need access to the Internet for downloading dependencies, binaries, and packages while building and deploying the TeraFlowSDN components.
Besides that, the network requirements are essentially the same than that required for running a classical Kubernetes environment. To facilitate the deployment, we extensively use [MicroK8s](https://microk8s.io/), thus the network requirements are, essentially, the same demanded by MicroK8s, especially, if you consider creating a Kubernetes cluster.
As a reference, the other deployment solutions based on VMs assume the VM is connected to a virtual network configured with the IP range `10.0.2.0/24` and have the gateway at IP `10.0.2.1`. The VMs have the IP address `10.0.2.10`.
The minimum required ports to be accessible are:
- 22/SSH : for management purposes
- 80/HTTP : for the TeraFlowSDN WebUI and Grafana dashboard
- 8081/HTTPS : for the CockroachDB WebUI
Other ports might be required if you consider to deploy addons such as Kubernetes observability, etc. The details on these ports are left appart given they might vary depending on the Kubernetes environment you use.
# Operating System
The recommended Operating System for deploying TeraFlowSDN is [Ubuntu Server 22.04 LTS](https://releases.ubuntu.com/jammy/) or [Ubuntu Server 20.04 LTS](https://releases.ubuntu.com/focal/). Other version might work, but we have not tested them. We strongly recommend using Long Term Support (LTS) versions as they provide better stability.
Below we provide some installation guidelines:
- Installation Language: English
- Autodetect your keyboard
- If asked, select "Ubuntu Server" (do not select "Ubuntu Server (minimized)").
- Configure static network specifications (adapt them based on your particular setup):
This page describes how to create a Vagrant Box, using the base virtual machine configured in [Oracle Virtual Box](./1.1.2.-Oracle-Virtual-Box).
# Virtual Machine specifications
Most of the specifications can be as specified in the [Oracle Virtual Box](./1.1.2.-Oracle-Virtual-Box) page, however, there are a few particularities to Vagrant that must be accommodated, such as:
For a Vagrant Box, it is generally suggested that the ISO's server version is used, as it is intended to be used via SSH, and any web GUI is expected to be forwarded to the host.
Do not install featured server snaps. It will be done manually [later](./1.-Deployment-Guide/1.2.-Install-Microk8s) to illustrate how to uninstall and reinstall them in case of trouble with.
## Updates
Let the system install and upgrade the packages. This operation might take some minutes depending on how old is the Optical Drive ISO image you use and your Internet connection speed.
## Upgrade the Ubuntu distribution
```bash
sudo apt-get update -y
sudo apt-get dist-upgrade -y
```
- If asked to restart services, restart the default ones proposed.
- Restart the VM when the installation is completed.
### Install VirtualBox Guest Additions
On VirtualBox Manager, open the VM main screen. If you are running the VM in headless
mode, right-click over the VM in the VirtualBox Manager window, and click "Show".
If a dialog informing about how to leave the interface of the VM is shown, confirm
by pressing the "Switch" button. The interface of the VM should appear.
Click the menu "Device > Insert Guest Additions CD image..."
# This command might take some minutes depending on your VM specs and your Internet access speed.
sudo mount /dev/cdrom /mnt/
cd /mnt/
sudo ./VBoxLinuxAdditions.run
# This command might take some minutes depending on your VM specs.
sudo reboot
```
# ETSI TFS Installation
After this, proceed to [1.2. Install Microk8s](./1.-Deployment-Guide/1.2.-Install-Microk8s), after which, return to this wiki to finish the Vagrant Box creation.
# Box configuration and creation
Make sure the ETSI TFS controller is correctly configured. **You will not be able to change it after!**
It is advisable to do the next configurations from a host's terminal, via a SSH connection.
```bash
ssh -p 2222 vagrant@127.0.0.1
```
## Set root password
Set the root password to `vagrant`.
```bash
sudo passwd root
```
## Set the superuser
Set up the Vagrant user so that it’s able to use sudo without being prompted for a password.
Anything in the `/etc/sudoers.d/*` directory is included in the sudoers privileges when created by the root user.
Create a new sudo file.
```bash
sudo visudo -f /etc/sudoers.d/vagrant
```
and add the following lines
```text
# add vagrant user
vagrant ALL=(ALL) NOPASSWD:ALL
```
You can now test that it works by running a simple command.
```bash
sudo pwd
```
Issuing this command should result in an immediate response without a request for a password.
## Install the Vagrant key
Vagrant uses a default set of SSH keys for you to directly connect to boxes via the CLI command `vagrant ssh`, after which it creates a new set of SSH keys for your new box. Because of this, we need to load the default key to be able to access the box after created.
- ... <!-- Should create and host one at ETSI!! -->
To use them, you simply have to create a Vagrantfile and run `vagrant up controller` in the same directory. The following example Vagrantfile already allows you to do just that, with the bonus of exposing the multiple management GUIs to your `localhost`.
This Vagrantfile also allows for **optional repository updates** on startup by running the command with a specified environment variable `BRANCH`
```bash
BRANCH=develop vagrant up controller
```
## Linkerd DNS rebinding bypass
Because of Linkerd's security measures against DNS rebinding, a reverse proxy, that modifies the request's header `Host` field, is needed to expose the GUI to the host. The previous Vagrantfile already deploys such configurations, for that, all you need to do is create the `reverse-proxy-linkerdviz.sh` file in the same directory. The content of this file is displayed below.
This page describes how to configure a VM for running ETSI TeraFlowSDN(TFS) controller using [VMWare Fusion](https://www.vmware.com/products/fusion.html). It has been tested with VMWare Fusion version 12 and 13.
# Create VM in VMWare Fusion:
In "VMWare Fusion" manager, create a new network from the "Settings/Network" menu.
- Unlock to make changes
- Press the + icon and create a new network
- Change the name to TFS-NAT-Net
- Check "Allow virtual machines on this network to connect to external network (NAT)"
- Do not check "Enable IPv6"
- Add port forwarding for HTTP and SSH
- Uncheck "Provide address on this network via DHCP"
Create a new VM an Ubuntu 22.04.1 ISO:
- Display Name: TeraFlowSDN
- Username: tfs
- Password: tfs123
On the next screen press "Customize Settings", save the VM and in "Settings" change:
- Change to use 4 CPUs
- Change to access 8 GB of RAM
- Change disk to size 60 GB
- Change the network interface to use the previously created TFS-NAT-Net
Run the VM to start the installation.
# Install Ubuntu 22.04.1 LTS Operating System
The installation will be automatic, without any configuration required.
- Configure the guest IP, gateway and DNS:
Using the Network Settings for the wired connection, set the IP to 10.0.2.10,
the mask to 255.255.255.0, the gateway to 10.0.2.2 and the DNS to 10.0.2.2.
- Disable and remove swap file:
$ sudo swapoff -a
$ sudo rm /swapfile
Then you can remove or comment the /swapfile entry in /etc/fstab
- Install Open SSH Server
- Import SSH keys, if any.
- Restart the VM when the installation is completed.