04 Apr

On-demand GNS3-Server automation using Packet (part I)

GNS3 was extensively developed in the past years. It is good that the Client and Server functions are decoupled, so we can use the GUI but still run the simulation on cloud resources. For this kind of virtualization bare metal service required as GNS3 using KVM/QEMU, and most cloud providers are not supporting Nested virtualization. Packet provides on-demand physical server resources, so it is a good target to run ESXi or GNS3 server in the cloud. The main idea is to book the required resource only for the time of the simulation. Persistency still required so that the GNS3 images and project data is available for future use. Deployment of the solution is controlled via an Ansible playbook. For this to work we need the following tasks:
  • Add an SSH key to Packet
  • Create the Server at Packet
  • Attache the Block storage to the created server using the Packet API
  • Verify the server is reachable via SSH
  • Connect to the server and download GNS3-server installation script
  • Run this script
  • update DDNS entry
  • Connect and mount the Block storage
  • restart GNS3 service
We would also require another playbook to destroy the server:
  • Unmount /opt and disconnect the block storage
  • wait for 10-30 seconds
  • Destroy the server
In part II. I’ll write about the preparations.