Downloading and Installing the SDK

ruferp edited this page Jul 18, 2016 · 8 revisions

Installing EOS SDK on your switch

Introduction

Since EOS release 4.17.0F, there is no need to install anything on your EOS device in order to run an EOS SDK application. In earlier releases, the embedded part of the EOS SDK was distributed as a standalone RPM to be installed as an extension on EOS. The older approach of a standalone RPM is still needed/useful to achieve quick turnarounds that deliver access to more EOS functionalities or bug fixes between EOS releases, without the disruption of a full EOS upgrade and reboot. Even if you don't need to install anything on the switch, you still need to download the corresponding development environment, and potentially a virtual instance of EOS to facilitate early testing. The following chapters will guide you through those various steps.

Downloading EOS SDK

There are a few distinct files that provide the SDK and development environment.

  • EosSdk-stubs-<version>.tar.gz - this tarball contains the C++ headers for the SDK, and is independent of the EOS version. With the stubs, you are free to develop your agent in any compatible Linux environment. The contents of the latest version of the stubs tarball can be perused at the repository homepage, or per EOS version at the Arista downloads portal in the EOS SDK/ folder (After logging in and accepting the EULA).
  • vEOS.swi - if you wish to develop against a virtual machine instead of a physical Arista switch, you can download the vEOS image. Instructions on setting up your virtual machine can be found here, or, for use with VirtualBox, here. vEOS images are also available for download from the Arista software downloads portal.
  • EosSdk-<version>-<EOS-release>.i686.rpm - this RPM contains the actual SDK implementation, and is already bundled into EOS since release 4.17.0. You will only need to download and install it in case you need a bugfix or field-trial code. There is a unique RPM for each EOS release and SDK version pair. The various versions of these RPMs can be downloaded from the Arista downloads portal. Note that for EOS releases that already have the RPM built-in you might not find any corresponding RPM here.

Switch Installation instructions

On releases prior to 4.17.0, or to install a special enhancement to the EOS SDK delivered between regular EOS releases: first, download the EosSdk.i686.rpm from the Arista downloads portal. Next, copy the RPM to the extension: directory on your switch:

switch# copy <url-or-path-to-the-rpm> extension:
Copy completed successfully.

If your switch does not have connectivity to the server where you originally downloaded the RPM, you can first scp the RPM to the switch (say, to /mnt/flash/) and then run the copy command with a local path (i.e. copy flash:EosSdk.i686.rpm extension:). Note that the account scping files to the switch or vEOS instance must have access to exec mode. For local accounts, this can be accomplished with the following commands:

veos(config)# aaa authorization exec default local 
veos(config)# username XXX privilege 15 secret XXX

At this point you can install the extension:

switch# extension EosSdk.i686.rpm force

... and voila, you can now use the SDK! Note that the "force" option is required if an older version of the RPM is already installed, as is the case by default since EOS release 4.17.0F.

Go ahead, try checking out the SDK version via the Python bindings:

switch# bash python
Welcome to the Python shell.  Press Ctrl-D to exit.
>>> import eossdk
>>> print eossdk.version
1.3.1
>>> exit()

Before deploying the SDK in production, you will likely want to perform a few extra steps. First, you'll want to make sure the EosSdk RPM is installed after a reboot. To do this, make it a bootup-extension:

switch# copy installed-extensions boot-extensions

Secondly, if using the SDK on a machine with two supervisors installed, you'll want to repeat these installation instructions on the standby supervisor, so your agent can run on the other CPU after a switchover event.

If at any point you need to examine the extension, use the show extension CLI. For example:

switch# show extension
Name                                       Version/Release           Status RPMs
------------------------------------------ ------------------------- ------ ----
EosSdk.i686.rpm                            1.3.1/2044576.2013eossdkb A, I      1

A: available | NA: not available | I: installed | NI: not installed | F: forced

Additionally, if you wish to uninstall the extension, simply run

switch# no extension EosSdk.i686.rpm
switch# delete extension:EosSdk.i686.rpm
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.