If you’re a network engineer or like to play around with networks, you’ve used GNS3 (or something similar, like VIRL) to simulate networks to prepare for live configuration changes, preparing for certifications, and maybe keep a demo lab. Part of the demo lab I maintain for vRealize Network Insight, is collecting from a GNS3 network.

Sometimes, you need to restart all, or just some of the nodes. In my case, periodic node restarts are to simulate router crashes, and sometimes the storage underneath GNS3 would error and some of the nodes have kernel panics. All reasons to restart the nodes, which can get tedious in the UI. Luckily, GNS3 has a REST API.

PowerGNS3

To solve the automation need, I created a small module called PowerGNS3. It’s focused on node management so far, and you’re able to read out projects, nodes in those projects and start or stop the nodes. You can find it on GitHub, here: https://github.com/smitmartijn/PowerGNS3 

Usage

Here are a few examples of how to use PowerGNS3.

Connect to GNS3 API

List Projects

List Nodes in a Project

Stop Node

Start Node

Summary

The GNS3 API has a ton of additional APIs for project management; from adding nodes to modeling the interface canvas. PowerGNS3 is focused on node management for now, but pull requests are always accepted for more coverage of the API. 🙂



Share the wealth!