Introducing the Nautobot Arista CloudVision SSoT Plugin

The team at NTC is excited to announce the public release of the SSoT Arista CloudVision App for Nautobot. This Arista CloudVision SSoT app is built on top of the Single Source of Truth Nautobot app. I highly encourage you to read that blog post before reading this blog post as you will learn get a basic understanding of the intentions behind the SSoT app and some of its landing pages. This Arista SSoT app allows synchronization of data directly between CloudVision and Nautobot. It synchronizes user device tags from Nautobot into CloudVision while using devices and system tags from CloudVision to populate devices and device metadata in Nautobot too.

For all intents and purposes, “app” is synonymous with “plugin”.

Installing the Plugin

The app is available as a Python package in PyPI and can be installed atop an existing Nautobot installation using pip. For the full installation steps, refer to the app’s README.

Once installed, you should be able to navigate to Plugins > Single Source of Truth > Dashboard from the navigation bar (or go to /plugins/ssot/) on your Nautobot instance to view the SSoT dashboard. Once there, you should have CloudVision as an option under both Data Targets and Data Sources:

ssot_homepage

Using the Plugin

Usage of this app is very simple and follows the steps in the Single Source of Truth blog post. Let me go over what exactly is synced when running each of the jobs, how the data models on each side of the sync relate, and other noteworthy behaviors of the app.

Syncing CloudVision as a Data Source

When syncing with CloudVision as the data source, devices and system tags from CloudVision are synced to Nautobot.

Devices

Devices in CloudVision map to the device models in Nautobot. This means that if you have a device in CloudVision that does not exist in Nautobot, it will be created in Nautobot when you run the sync.

When syncing devices from CloudVision we wanted to ensure that only the Arista devices are in scope in Nautobot as CloudVision would only have Arista devices. To do this, when the sync runs, we only gather devices from Nautobot that have their device type manufacturer name set to Arista.

Now, if you are familiar with Nautobot, you know that when creating a device, you must provide a site, a device role, device role color, and a device status. To account for this, the app allows setting app variables to set default values to your liking. They are:

Configuration VariableDefault Value
from_cloudvision_default_sitecloudvision_imported
from_cloudvision_default_device_rolenetwork
from_cloudvision_default_device_role_colorff0000
from_cloudvision_default_device_statuscloudvision_imported
from_cloudvision_default_device_status_colorff0000

If these app settings are not defined, the default values above will be used on any devices imported into Nautobot.

When configuring these settings, if the value you set the environment variable to does not exist in Nautobot it will create that object. For example, if I set the from_cloudvision_default_device_role to super_switch, and the device role super_switch does not already exist in Nautobot, this app will create it for you.

Just as the app will create devices in Nautobot, it can delete devices as well. I say “can” delete because there is another app variable that can be set, delete_devices_on_sync_cv_source. This variable controls the behavior of the app when a device exists in Nautobot but not in CloudVision. If not defined in the app settings, the value is set to False which means the app will not delete devices from Nautobot that no longer exist in CloudVision. You can set the variable’s value to True by including the variable in your app settings. When set to True it will delete devices.

Here is screenshot of the landing page for the job to sync from CloudVision. You can see it displays those variables, as well as what they are currently set to.

configuration_page

System Tags

Along with devices, the system tags for each device are synced from CloudVision as well. When this app is installed, it creates the custom fields that are tied to the device model. The below shows the CloudVision system tags and how they map to custom fields when a sync occurs.

CloudVision System TagsNautobot Device Custom Field
bgpbgp
eosEOS Version
eos trainEOS Train
mlagmlag
modelDevice Platform*
mplsmpls
pimpim
pimbidirpimbidir
serialnumberDevice Serial Number
sflowsFlow
systypesystype
tapaggTAp Aggregation
terminattrTerminAttr Version
topology_network_typeTopology Network Type
topology_typeTopology Type
ztpztp

The model system tag is not mapped to a custom field. Instead, the model tag is tied to a Device Platform. If the Device Platform does not exist upon syncing, the app will create a new Device Platform.

While these system tags won’t be changing very often, they will be updated in the event of a change. An example being if you update software version on a device. CloudVision will automatically pick up the change, but you’d need to run a sync job to ensure the custom field in Nautobot gets updated.

Syncing with CloudVision as a Data Target

When syncing with CloudVision as the data target, tags from Nautobot are synced to CloudVision.

Tags

This sync job takes tags created in Nautobot and creates them in CloudVision as User tags. It also ensures devices that may be assigned those tags in Nautobot are updated in CloudVision as well. For example, let’s say we already have our devices synced between Nautobot and CloudVision. In Nautobot we create a tag that denotes whether or not a device is running Virtual Router Redundancy Protocol (VRRP). We create the tag vrrp:True in Nautobot and assign it to our device named nyc-switch01. Instead of having to go to CloudVision to create that tag and assign it there, we can run this sync. It’ll automatically create the user tag vrrp:True in CloudVision and assign it to the appropriate device.

But wait! There’s more!

Before using the Arista SSoT app, you may have user tags in CloudVision that you want to import into Nautobot. That’s where the Arista CloudVision Importer comes in. This CLI tool is used as an initial sync of your user tags in CloudVision to tags in Nautobot so that we can treat Nautobot as the Source of Truth for tags. In the interest of brevity for this blog post, installation and usage instructions can be found in the README file. One thing worth mentioning is that the slugs for any tags imported into Nautobot will follow the schema of arista_{tag_name}_{tag_value}. This serves two purposes:

  1. Shows in Nautobot which tags were imported from CloudVision.
  2. Ensures tags imported into Nautobot are unique.

Here is a small screen capture of tags that have been imported into Nautobot. 

tag_slug

The name of the tag is a direct copy. Only the slug adheres to the syntax schema mentioned above.


Conclusion

The Single Source of Truth Nautobot app is a very useful app that will allow Nautobot to be treated as the Single Source of Truth. This Arista integration is just the tip of the iceberg when it comes to what we can sync and what systems we can sync with. If you have any questions or ideas, don’t hesitate to reach out to us on our NTC community Slack.

-Adam



ntc img
ntc img

Contact Us to Learn More

Share details about yourself & someone from our team will reach out to you ASAP!

Author