Looks like you're using an older browser. To get the best experience, please upgrade. UPGRADE MY BROWSER.
In one of my previous articles,I elaborated on a setup to create DC fabric simulations with GNS3 and OpenSwitch.I also promised to follow up with some post about using Ansible with it.
Well, I have been a bit distracted with some changes to the setup before moving intothe Ansible details (to say true, I got the Ansible article almost ready, but thingsare moving so fast, that I keep rewriting it).
One of the things that ‘change everything’ recently was therelease of GNS3 1.5.This is a great release that includes several features that makes using OpenSwitch with GNS3 awesome:
The GNS3 Certified Associate (GNS3CA) program is a multi-vendor, next generation network engineer certification that focuses on the core skills that network engineers need today for the new era of rapidly changing, programmable, automated and intelligent networks. Index of /files/Downloads Name Last modified Size Description: Parent Directory - ASA842/ 2018-06-20 17:21 - Cisco-IOU-L2-L3-Collection-v4/. Latest Stable Version (Community Edition) This is the most recent stable release, and the recommended version for all installations. Refer to the documentation for Upgrade Guides and Installation Guides.For pre-configured systems, see the pfSense® firewall appliances from Netgate. The GNS3 Certified Associate (GNS3A) program is a multi-vendor, next generation network engineer certification that focuses on the core skills that network engineers need today for the new era of rapidly changing, programmable, automated and intelligent networks.
- Support for Docker containers! This enables OpenSwitch to be a container instead ofa VM, allowing to scale better:
- This obviously consumes less RAM memory and use it more efficiently.
- We are no longer limited to 8 ports per node (VirtualBox’s restriction), butinstead we can have as many ports as you want. Even more, the OpenSwitch Appliancecontainer will change the number of ports available, based on the GNS3 configuration.
- Support for portable projects! Now you can export your project and shared itwith others (restrictions apply).
Let’s see how to use this new release with OpenSwitch Appliance Container.
The first recommendation when using the container setup for GNS3, is to use theGNS3 VM (even when using a native Linux host). Why?
- Well, for running containers on Linux or Windows, you need the GNS3 VM.Yeah, even if you have docker for Linux/Windows, GNS3 can create the virtual interfacesfor them on these platforms.
- Right now the only way to create a portable way to connect to the external world is touse the GNS3 Internet VM Appliance,and this only works inside the GNS3 VM.
- With GNS3 1.5, you can setup a remote GNS3 VM machine, allowing to deploya powerful VM for running your simulations without starving your laptop.
- Also with the GNS3 VM, there is a simplified process for setting up a proxy whenworking in a corporate environment.
Since we will be using qemu appliances inside the GNS3 VM, you need a virtualizationplatform that supports nested virtualization. That means you are either using aVMware desktop solution (Workstation, Player or Fusion), or if using ESXi, be sureto enable the VHV flag.
Installing the GNS3 VM
Download the VM from here. Be sure to download theright image for either desktop solution or ESXi.
You will need at least version 1.5.0, but if you are behind a corporate firewall, you will need version1.5.1 that fixes a bug when configuring the proxy settings.
After downloading the GNS3 VM appliance, import it into your virtualization solution, and reconfigurewith this minimal hardware requirements:
- 512MB of RAM for every OpenSwitch container that you plan to run. For our examples 6GB of RAM should be enough.
- 2 CPU cores. If you can afford more, the better.
If you are behind a corporate firewall, be sure to turn on the VM, and using the menu displayed when the VM boots,configure the proxy settings.
Configure GNS3 to use the VM
If you haven’t already, install GNS3 downloading from here(be sure to use the same version as the VM image that you downloaded).
When configuring GNS3, the wizard doesn’t allow you to configure a remote server GNS3 VM, butyou can abort the wizard, and add it later from the preferences panel (the IP address ofthe VM is show on the information page displayed by the VM on boot, or available from thetext menu on the VM as well).
In order to use OpenSwitch as a container with GNS3, you have to main options:use an existing image (easier one), or build a custom one from scratch (useful for developers).
Using an Existing OpenSwitch Container Image
Let’s focus on the simple procedure first. Fortunately we no longer need to specify multipleparameters on the UI to create a template, since for Docker containers we can usea pre-defined template appliance (.gns3a file), that will do all the configurationfor you.
First, download a GNS3 appliance template from the listavailable here.
Next, import it into GNS3: there is a new ‘Import appliance template’ button underthe device panel.
Select ‘Import an appliance template file’
Select the template that you downloaded, and follow the rest of the wizard. Selectto run on the remote server running the GNS3 VM.
Once you are done with the import, you can download a custom stencil for OpenSwitchDocker Appliance from here,and customize the template to use it.
The template uses by default 8 ports, but that can be adjusted in per machine instance.
That’s all it takes, you are ready to drag & drop container instances into GNS3!
Creating a custom Container Image
In the previous step where we used the .gns3a file, it points to a published versionof the container in the Docker Hub, but you may want to create your own container fromscratch with the latest code or modifications. If that is not the case, you can skipthis section.
First you will have to build an image for the appliance target as explained inprevious articles (you can also download the tarball for a periodic build fromthe artifact archives).
Now, the default tarball created for the appliance is designed to run in a VM, soit needs some small modifications to run properly on a container. I have automatedthe steps in a docker file here.
Here are the example commands to create a custom image with the latest code frommaster and push into the docker hub (in this example I use my docker hub account):
Now you can modify the gns3a file provided in the previous step and point to yourcustomized image to import it into GNS3.
Now, let’s create a topology for creating a DC Fabric simulation with Ansible similarto the one described in the previous article using virtual machine appliances.
I have created a docker container that already automated all the steps detailed inthe previous article, and is suitable to be run as a systemd container. The Dockerfilecould be found here, andthe GNS3 template file here.
Unlike the previous examples using VirtualBox, we cannot longer use the cloud elementto get a NAT connection to the external world, so instead we will use theGNS3 Internet VM Appliance.
After installing those two templates, we can recreate the DC fabric similar to the onefrom the previous article, with the difference that is (almost) all containers.
Now comes another cool part, you can export and import the project to share withothers.
So, you can export the project by using ‘Export portable project’ on the filemenu. It will ask you if you wan to include any base image, which for our exampleI would recommend we do (this will pack the qemu image used by the GNS3 Internet Appliance).Docker images won’t get included on the file, but instead will be automaticallydownloaded from the docker hub when someone imports the project.
Talking about importing the project back, there is currently a bug when importingthe project and downloading the docker images,where certain imports may timeout. This is fixed for 1.5.1, but in the meantime you can workaround by deleting theproject that failed to import and re-import it again (since the docker images shouldbe already downloaded, it won’t fail the second time).
The portable project file for the example on this article ishere, in case youwant to get up an running.
Isn’t all of this really exciting? Thanks to the GNS3 team for their awesome workand their responsiveness to fix the bug/enhancements that I keep throwing at them.
In the next article I will continue with explaining how to use Ansible to deployconfiguration to the topology we build here.