Containerlab¶
Estimated time to read: 3 minutes
- Originally Written: March, 2024
Setup Notes¶
I've started using Containerlab to quickly setup some lab examples. I have the following configuration which seems to be working ok so far:
- Ubuntu VM running Containerlab
- 32G memory
- 8 CPUs
- 50GB disk
- Single network adapter
I'm starting with some IP multicast scenarios using a small number (up to 4) of CSR 1000v routers and a couple of Linux containers. From the CSR 1000v datasheet, the minimum requirement is 1 vCPU/4 GB per instance.
Info
If you see the error the CPU virtualization support is required, but not available
then you may need to enable hardware virtualization on the VM through the vCenter client.
To install Containerlab was fairly straight forward using the install guide found at:
https://containerlab.dev/install/
Since I'm using the CSR1000v I needed package the qcow2 virtual machine image into a container and used the vrnetlab project to do this. As per the Containerlab guide above the existing Vrnetlab project has been forked to support container based networking. The correct repo is found at:
https://github.com/hellt/vrnetlab
If you use the original vrnetlab repo with Containerlab you may run into this error and the nodes won't start.
launch.py: error: unrecognized arguments: --hostname csr-r1 --connection-mode tc
Onboarding the CSR 1000v¶
-
I downloaded the CSR 1000v qcow2 image
-
I then uploaded it to my VM running containerlab
- Clone the vrnetlab Git repo
- Move the csr1000v image to the csr folder
- Run the Makefile in the CSR folder. You may need sudo privileges to run Docker.
- If successful you should see a new Docker image
- You can tag the image with your own username and push to your image registry
docker image tag vrnetlab/vr-csr:17.03.04a conmurphy/vr-csr:17.03.04a
docker login
docker push conmurphy/vr-csr:17.03.04a
Info
I did try Boxen which seemed straight forward to use but unfortunately I ran into some errors building the image.
I also found the build process output straight forward with vrnetlab. I might have overlooked something but I was only able to follow the install process in Boxen by looking at the log file.
Running topologies¶
Now that it's installed and setup I can deploy the topology quite easily.
You can SSH directly into the routers and the default username/password for the CSR1000v is admin/admin