Virtual Lab Setup

Summary

This guide describes the required steps to set up a lab using Containerlab. Containerlab enables us to quickly create a variety of topologies with support for different vendors using docker containers and experiment with Inmanta Connect module.

In this guide, we use a simple topology containing:

  • 2 routers (or 4 if testing multihoming) from our supported vendors

  • 4 clients (NFV-Test-API)

  • Inmanta service orchestrator to test services which we deploy to the routers.

Set Up A Virtual Machine

  1. Using the hypervisor of your choice, spin up a CentOS machine with either of the below specs:

    System Requirements

    CPU Cores

    RAM (GB)

    Disk Space (GB)

    Minimum (only applicable for Nokia)

    4

    16

    20

    Recommended

    4

    32

    35

  2. Take note of the VM’s IP address.

  3. Once the VM is up, install git and docker:

    • Install git:

      sudo yum update
      sudo yum install git
      
    • Install docker:

      sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
      sudo dnf install docker-ce docker-ce-cli containerd.io
      sudo systemctl enable --now docker
      
  4. Check docker status:

    sudo systemctl status docker
    

    The output should look like this:

    $ sudo systemctl status docker
     docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
     Active: active (running) since Fri 2021-06-04 10:56:34 UTC; 3 days ago
       Docs: https://docs.docker.com
    
  5. Add your user to docker group:

    sudo usermod -aG docker $USER
    

Install Containerlab

  1. Before installing Containerlab we need to update and reboot the VM:

    sudo yum update
    sudo reboot
    
  2. Install Containerlab:

    sudo yum-config-manager --add-repo=https://yum.fury.io/netdevops/ && \
    echo "gpgcheck=0" | sudo tee -a /etc/yum.repos.d/yum.fury.io_netdevops_.repo
    
    sudo yum install containerlab
    

    This is a short and starch-free version of Containerlab setup. For more information, you can visit its official docs:

    Warning Due to some breaking changes in Containerlab 0.15, Connect LAB with version >= 0.3.0 only works with clab version >= 0.15. If you want to use a Containerlab older than 0.15 you will need to install one of the earlier versions of Connect LAB.

    You can check which version of Containerlab you have installed using the clab version command.

Download And Setup Images

The specific steps to download and setup the images of each vendor could be viewed in the following pages:

clab deploy command for routers should be run from the directory that contains the license file. In this case connect-lab/labs.

Get The Connect LAB Resources

The Connect LAB project, containing the configuration files and clab topology files, can be downloaded from Inmanta packages repository:

DEFAULT_VERSION="1.0.5"
read -rp "Enter the version you want to install (defaults to $DEFAULT_VERSION): " VERSION \
   && if [[ $VERSION == "" ]]; then VERSION=$DEFAULT_VERSION; echo "No version provided, defaulting to $VERSION"; fi \
   && read -rsp "Enter your private token here: " TOKEN \
   && echo "" \
   && curl -1sO --fail https://packages.inmanta.com/$TOKEN/connect/raw/versions/$VERSION/connect-lab-$VERSION.tar.gz \
   || ( \
      echo "FAILED to get package" \
      && cat connect-lab-$VERSION.tar.gz \
      && echo "" \
      && exit 1 \
   ) \
   && tar -zxf connect-lab-$VERSION.tar.gz \
   && echo "All done! The lab project is available under connect-lab-$VERSION/ directory"

Currently the connect-lab version that is used for this guide is 1.0.5.

The project structure is as follows:

connect-lab/
├── docs
|   └── repair-a-lab.md
├── labs
│   ├── config
│   │   ├── cisco-evc-2R
│   │   │   ├── east.cfg
│   │   │   └── west.cfg
│   │   ├── cisco-evc-4R
│   │   │   ├── east.cfg
│   │   │   ├── north.cfg
│   │   │   ├── south.cfg
│   │   │   └── west.cfg
│   │   ├── juniper-evc-2R
│   │   │   ├── east.cfg
│   │   │   └── west.cfg
│   │   ├── juniper-evc-4R
│   │   │   ├── east.cfg
│   │   │   ├── north.cfg
│   │   │   ├── south.cfg
│   │   │   └── west.cfg
│   │   ├── nfv-test-api
│   │   │   └── config.yaml
│   │   ├── nokia-evc-2R
│   │   │   ├── east.cfg
│   │   │   └── west.cfg
│   │   └── nokia-evc-4R
│   │       ├── east.cfg
│   │       ├── north.cfg
│   │       ├── south.cfg
│   │       └── west.cfg
│   ├── docker-orchestrator
│   │   ├── agent
│   │   │   └── env
│   │   └── server
│   │       ├── env
│   │       ├── license.cfg
│   │       └── server.cfg
│   ├── cisco-evc-2R.clab.yml
│   ├── cisco-evc-4R.clab.yml
│   ├── cisco-evc.clab.yml -> cisco-evc-2R.clab.yml
│   ├── juniper-evc-2R.clab.yml
│   ├── juniper-evc-4R.clab.yml
│   ├── juniper-evc.clab.yml -> juniper-evc-2R.clab.yml
│   ├── nokia-evc-2R.clab.yml
│   ├── nokia-evc-4R.clab.yml
│   └── nokia-evc.clab.yml -> nokia-evc-2R.clab.yml
├── 2R.svg
├── 4R.svg
├── CHANGELOG.md
└── README.md

Inmanta Service Orchestrator

Please contact us to get the required service orchestrator image and license.

Upon acquiring the image, there are a few prerequisites that has to be fulfilled before continuing:

  • Copy the license to connect-lab/labs/docker-orchestrator/server.

  • Copy the public key of the SSH key that you will use to run tests against the lab to connect-lab/labs/docker-orchestrator/server/authorized_keys.

  • Check the config file of the server: connect-lab/labs/docker-orchestrator/server/server.cfg.

Verify the downloaded image by checking Docker images:

$ docker images
REPOSITORY                                                     TAG             IMAGE ID       CREATED        SIZE
docker.cloudsmith.io/inmanta/containers/service-orchestrator   4               5139265d16e3   7 days ago     1.28GB

Starting the LAB

The topology consists of two routers; or four in case of multihoming, four clients, Inmanta service orchestrator and a DB for the orchestrator. Inmanta service orchestrator uses the management network to connect to the routers and the orchestrator DB.

Before you proceed, check that all the required images are present:

$ docker images
REPOSITORY                                                     TAG        IMAGE ID       CREATED        SIZE
docker.cloudsmith.io/inmanta/containers/service-orchestrator   4          5139265d16e3   7 days ago     1.28GB
vrnetlab/vr-sros                                               20.10.R1   0ff03483e5c4   6 weeks ago    994MB

Inside connect-lab/labs directory there are a bunch of yaml files starting with the name of a vendor; for instance, cisco-evc.clab.yml. Deploying the aforementioned yaml file will yield the topology with 2 routers as depicted below.

Connection Map With 2 Routers

Name

Interface

Name

Interface

router-west

eth1

router-east

eth1

router-west

eth2

subscriber-north-west

eth1

router-west

eth3

subscriber-south-west

eth1

router-east

eth2

subscriber-north-east

eth1

router-east

eth3

subscriber-south-east

eth1

Topology With 2 Routers

Topology

The rest of this document is based on cisco-evc.clab.yml deployment.

On the other hand, a 4 router topology can be set up by deploying the files that have 4R in their name. As an example for cisco-evc-4R.clab.yml the result is depicted as below.

Connection Map With 4 Routers

Name

Interface

Name

Interface

router-north

eth1

router-south

eth1

router-north

eth2

subscriber-north-west

eth2

router-north

eth3

subscriber-north-east

eth2

router-north

eth4

router-west

eth4

router-north

eth5

router-east

eth5

router-west

eth1

router-east

eth1

router-west

eth2

subscriber-north-west

eth1

router-west

eth3

subscriber-south-west

eth1

router-west

eth5

router-south

eth5

router-east

eth2

subscriber-north-east

eth1

router-east

eth3

subscriber-south-east

eth1

router-east

eth4

router-south

eth4

router-south

eth2

subscriber-south-west

eth2

router-south

eth3

subscriber-south-west

eth2

Topology With 4 Routers

Topology

NOTE:

  • In this configuration Inmanta service orchestrator uses port 2222 of the VM for remote access.

  • Router’s initial configuration files are in the connect-lab/labs/config/ directory. Currently non-Nokia routers require a manual copy and paste of their configuration in order to function. The procedure has been elaborated for each vendor in this section.

To run the LAB for the first time:

cd connect-lab/docs/
sudo clab deploy --topo cisco-evc.clab.yml

To re-run the LAB after making modifications:

sudo clab deploy --topo cisco-evc.clab.yml --reconfigure

To delete the LAB:

sudo clab destroy --topo cisco-evc.clab.yml

After a few minutes, the router containers should be shown as healthy. In our example we use Nokia routers:

$ docker ps
CONTAINER ID   IMAGE                          COMMAND                  CREATED         STATUS                   PORTS                                                                                                                                                NAMES
9472bfdf566e   vrnetlab/vr-sros:20.10.R1      "/launch.py --trace …"   4 minutes ago   Up 4 minutes (healthy)   80/tcp, 443/tcp, 5000/tcp, 10000-10099/tcp, 57400/tcp, 161/udp, 0.0.0.0:21022->22/tcp, :::21022->22/tcp, 0.0.0.0:21830->830/tcp, :::21830->830/tcp   clab-nokia-nokia-west
f59435aa0ed6   vrnetlab/vr-sros:20.10.R1      "/launch.py --trace …"   4 minutes ago   Up 4 minutes (healthy)   80/tcp, 443/tcp, 5000/tcp, 10000-10099/tcp, 57400/tcp, 161/udp, 0.0.0.0:20022->22/tcp, :::20022->22/tcp, 0.0.0.0:20830->830/tcp, :::20830->830/tcp   clab-nokia-nokia-east
fb201bf0beae   postgres:10                    "docker-entrypoint.s…"   4 minutes ago   Up 4 minutes             5432/tcp                                                                                                                                             clab-nokia-inmanta-db
ec307468311c   inmantaci/nfv-test-api:0.6.1   "sh -c '/bin/sleep 5…"   4 minutes ago   Up 4 minutes             0.0.0.0:2002->8080/tcp, :::2002->8080/tcp                                                                                                            clab-nokia-subscriber-south-east
448344a5ab1f   inmantaci/nfv-test-api:0.6.1   "sh -c '/bin/sleep 5…"   4 minutes ago   Up 4 minutes             0.0.0.0:2001->8080/tcp, :::2001->8080/tcp                                                                                                            clab-nokia-subscriber-north-east
f56297c91866   inmantaci/nfv-test-api:0.6.1   "sh -c '/bin/sleep 5…"   4 minutes ago   Up 4 minutes             0.0.0.0:2003->8080/tcp, :::2003->8080/tcp                                                                                                            clab-nokia-subscriber-north-west
de139aeef0c4   inmantaci/nfv-test-api:0.6.1   "sh -c '/bin/sleep 5…"   4 minutes ago   Up 4 minutes             0.0.0.0:2004->8080/tcp, :::2004->8080/tcp                                                                                                            clab-nokia-subscriber-south-west
9f73ca4fd97e   service-orchestrator:4         "sh -c '/usr/bin/chm…"   4 minutes ago   Up 4 minutes             0.0.0.0:8888->8888/tcp, :::8888->8888/tcp, 0.0.0.0:2222->22/tcp, :::2222->22/tcp                                                                     clab-nokia-inmanta-server

Accessing Containers

To access containers individually and remotely:

Container

Service

URL

orchestrator

WEB

http://vm_ip:8888

orchestrator

SSH

ssh://vm_ip:2222

subscriber-north-east

API

http://vm_ip:2001

subscriber-south-east

API

http://vm_ip:2002

subscriber-north-west

API

http://vm_ip:2003

subscriber-south-west

API

http://vm_ip:2004

To access containers individually on the VM:

Container

Access

nokia-east

ssh admin@clab-nokia-nokia-east

nokia-west

ssh admin@clab-nokia-nokia-west

subscriber-north-east

docker exec -ti clab-lab-subscriber-north-east bash

subscriber-south-east

docker exec -ti clab-lab-subscriber-south-east bash

subscriber-north-west

docker exec -ti clab-lab-subscriber-north-west bash

subscriber-south-west

docker exec -ti clab-lab-subscriber-south-west bash

Conclusion

This guide showed how to set up a small lab using container lab to test Inmanta connect module. If you are having any questions or suggestions regarding this guide, please get in touch.