Getting started with Arista Community Labs
This guide is intended for individuals looking to familiarize themselves with the steps necessary to spin up an Arista Community Labs topology hosted via GitHub Codespaces.
A deep understanding of GitHub Codespaces is not required to begin using Arista Community Labs. Those seeking more information on how GitHub Codespaces provides the foundation for Arista Community Labs can find this information and more in the Codespaces Quickstart Guide.
Pre-Requisites
Before launching an Arista Community Lab, we need to ensure we have the following:
- An Arista account with the ability to download cEOS-lab via Software Downloads
- A GitHub account
- Our Arista user token
We can find our user token by logging into arista.com and selecting My Profile
.
The tabs below illustrate the steps needed to locate and copy the token:
What's with the token?
When an Arista Community Lab is started, the user token will be used to automatically download and import the necesary cEOS-lab image into the lab environment
Starting a Lab
Note
Throughout this guide, we will use the EVPN Domain A lab associated with the EVPN/VXLAN Deployment Guide on Arista's Tech Library as reference point. All community labs hosted via Codespaces will follow the same process.
Once a lab has been launched via it's respective 'Start Lab' button, a Create Codespace
window will be opened via a web browser:
In the ARTOKEN
field, we will paste the user token copied from our arista.com user profile. This is a one time requirement, and will be saved for all of our subsequent Arista Community Lab deployments.
Where is the token saved?
Once entered, the token is saved as a GitHub Codespaces Secret
. This can be viewed via the Codespaces section of our GitHub account settings.
Watch the expiration date!
User tokens on arista.com have an expiration date associated with them, listed in the Token Valid Till
field in the Portal Access
section of the user profile.
If the token has expired, simply click Regenerate Token
to create a new one. A token expires one year after it was generated; This value cannot be modified by the user.
Once we've pasted in our token and selected Create new Codespace
, a new tab will open in our browser containing the codespace
Wait...the codespace opened in my local VS Code!
Not a problem - this just means that VS Code is locally installed and Visual Studio Code
is selected in the Editor preference
section of our GitHub account's Codespaces settings.
In our newly launched Codespace, we will see the Post Deploy Script
running in the terminal. This script is getting our lab enviornment ready to launch, and may take a few minutes to complete.
Grab a coffee!
The post deployment script can take a few minutes to run. Grab a coffee while the lab environment is being created.
Once complete, we will be presented with the Welcome
page. We can use this page to choose a different color theme, or simply close it out. We will also see our GitHub account name and lab shown in the terminal prompt of the Codespace.
At this point, we can Maximize Terminal
to ensure we have adequate real estate when opening SSH sessions to nodes in our lab topology.
Once the terminal has been maximized, it's time to Start the Lab
be entering the following command at the terminal:
make start
After starting the lab, we will see a series of Informational Output
scroll across the terminal as the lab is being instantiated.
When complete, the terminal will display a table containing a Lab Deployment Summary
. This includes information related to the nodes that were deployed when creating the lab.
Interacting with a Lab
Once the lab has been deployed, we can use the terminal in our Codespace to SSH into the nodes.
A list of Lab Hosts
that are accessible via SSH
can be viewed at any time from the terminal by entering the following command:
sudo clab inspect -a
To access an EOS host via our Codespace termianl, use the ssh
command followed by the host name as shown below
ssh A-SPINE1
Access to Ubuntu hosts requires that the admin
username be defined as a part of the ssh command:
ssh admin@HostA1
What's the password?
Unless stated otherwise, the default username of admin
and password of admin
is used for all nodes in an Arista Community lab
Once connected, we can interact with the lab as needed.
Stopping the Lab
When we're finished with our lab, we can spin down the environment by issuing the following command in the terminal of our Codespace:
make stop
Once the lab has stopped, we can then choose to stop or delete our codespace by selecting the Remote Window
button in the lower lefthand corner of our Codespace, and then choosing Stop Current Codespace
or My Codespaces
If we choose My Codespaces
, this will open a webpage containing a list of our current GitHub Codespaces. From here, we can locate our Codespace used for this session and stop or delete it if desired.
What if I forget about my lab?
By default, GitHub Codespaces will be stopped after being idle for 45 minutes and deleted after 30 days of inactivity.
The Default idle timeout
and Default retention period
values can be modified under our GitHub account's Codespaces settings.
Happy labbing!