Getting started with Arista Community Labs
This guide is intended for individuals looking to familiarize themselves with the steps necessary to get started with Arista Community Labs, powered by GitHub Codespaces.
Pre-Requisites
Before launching an Arista Community Lab, the following pre-requisites must be met:
- Arista account(1) with the ability to download cEOS-lab via Software Downloads
- GitHub account
- GitHub Codespaces Access(2)
- Arista user token
-
Need an account? Register here! Arista account registration.
The email address used for the account must be associated with a corporate email domain (no Gmail, Yahoo, etc.).
-
For those that have never used Codespaces before, no worries! There is a quick primer on Codespaces included below!
We can find the 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 necessary cEOS-lab image into the lab environment.
GitHub Codespaces Primer
Overview
GitHub Codespaces can instantiate a fully configured development or lab environment hosted entirely on GitHub's cloud infrastructure with a simple click of a button, on any machine. Making the environments incredibly portable!
In the Arista Community Labs, we pre-package these Codespaces with the tools necessary to interact with the nodes within the lab. Quick examples are Python, Ansible, and Ansible Galaxy collections such as AVD, CVP, and EOS.
Docker in Docker in alignment with the Dev Container Specification makes this possible in Codespaces.
Costs
GitHub Codespaces is a commercial offering from GitHub. As of October 2024, all GitHub users have 120 hours of Codespace time available for free each month.
By default, if all 120 hours are consumed and the Spending Limit for Codespaces is $0, then Codespace usage cannot continue until the hours are replenished the following month.
When and how would GitHub charge me for this?💰
A GitHub user will never be charged for Codespace usage by default. The feature will stop working until the hours are renewed the next month.
Users can define a Payment Method and Spending Limit for Codespaces. Once defined, usage beyond 120 hours can continue as long as the spending limit is not exceeded. Once a defined spending limit has been reached, Codespace usage cannot continue until the next month.
Additional information can be found in GitHub's Codespaces Billing Overivew Page
What if I forget about my Codespace? 
Don't worry! It won't run forever, at least not by default.
The Default idle timeout
and Default retention period
values can be modified within GitHub Codespaces Settings.
These parameters can be changed at any time, and should be defined with values that make the most sense for your usage patterns.
A general recommendation for these values is provided below:
- Default idle timeout:
30 Minutes
- Default retention period:
1 Day
Codespaces can be deleted at anytime from the Codespaces section of GitHub.
Machine Types
Different machine types are available within Codespaces. As a general rule, the greater the number of CPU cores, the greater number of hours that will be consumed during a Codespace's runtime.
GitHub's Pricing for Paid Usage chart provides the details of the usage multiplier
for each available machine type.
For example, as of the writing of this guide:
-
2 Core
Machine Types will consume2
hours for every hour of runtime -
8 Core
Machine Types will consume8
hours for every hour of runtime -
16 Core
Machine Types will consume16
hours for every hour of runtime
Some Arista Community Labs make use of larger machine types, such as the 16 Core
option.
My GitHub Account doesn't have access to a larger 8 Core
or 16 Core
machine types?
By default, some larger machine types may not be available for use. In order to resolve this, a ticket can be opened via GitHub support requesting access to these larger machine types.
Listed below is a template that can be used for this request:
Hello - Can the 8-core and 16-core codespace machine types please be enabled for my account?
The default 2-core and 4-core machines lack the necessary resources for my use cases.
A payment method has been added to my account. If additional information is needed, please let me know.
Thanks!
Once completed, select Create a Ticket
Starting the Lab
Note
All community labs hosted via Codespaces will follow a similar process to the one defined below. Labs that contain exceptions to the process below will have this specifically called out via a note associated with the lab launch button.
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, paste the user token copied from the arista.com user profile. This is a one time requirement, and will be saved for all 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 GitHub account settings.
Watch the expiration date! 
User tokens on arista.com have an expiration date listed in the Token Valid Till
field in the Portal Access
section of the user profile.
If the token has expired, click Regenerate Token to create a new one. A token expires one year after it was generated; the user cannot modify this value.
Once the token has been entered, and Create new Codespace
has been selected, a new tab will open in the 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 the GitHub account's Codespaces settings.
In the newly launched Codespace, a tab is opened displaying an overview of the lab.
The Post Deploy Script
can be seen running in the terminal, and will 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 the post deployment script has completed, the terminal prompt will change to the GitHub username followed by the name of the lab.
In the screenshot below, the GitHub username is MitchV85
and the lab is techlib-vxlan-domain-a
.
At this point, the lab is ready to go! Running the following command in the terminal will provide an overview and status of all deployed nodes:
make inspect
Interacting with the Lab
Once the lab is up and running, we can interact with the topology nodes.
Both SSH and API access to the nodes are available via the Codespace. Lab environments are pre-packaged with tools like Python and the Arista AVD, CVP, and EOS Ansible Galaxy collections.
Labs that leverage tools such as AVD for configuration, documentation, and testing will provide the instructions in their lab guide.
Accessing the environment via SSH is detailed below:
SSH
More real estate for those SSH sessions 🏠
Increase the size of the terminal by selecting the Maximize Panel Size
button to the right of the terminal:
A list of Lab Hosts
that are accessible via SSH
from within the codespace can be viewed at any time from the terminal by entering the following command:
make inspect
To access a node, use the ssh
command followed by admin@hostname
as shown in the example below
ssh admin@A-SPINE1
What's the password? 
The credentials used to access nodes within an Arista Community Lab environment will always be listed in the lab's documentation.
Use tabs 📑
Create a new tab for an SSH session by selecting New Terminal
to the right of the terminal.
Alternatively, the following keyboard shortcut can be used to open a new tab on both Windows and macOS: Ctrl+Shift+'
Once opened, the new terminal tab can be renamed by right-clicking on the tab and selecting Rename
Stopping the Lab
When you're finished with the lab, simply close the codespace by exiting the browser window. By default, a GitHub Codespace is stopped after 45 minutes of idleness and deleted after 30 days of inactivity.
Conserve those hours and save some money! 💵💷💶💴
The Default idle timeout
and Default retention period
values can be modified within GitHub Codespaces Settings.
These parameters can be changed at any time, and should be defined with values that make the most sense for your usage patterns.
A general recommendation for these values is provided below:
- Default idle timeout:
30 Minutes
- Default retention period:
1 Day
A list of all codespaces can be found in the Codespaces section of GitHub. From here, a codespace can be resumed, stopped, deleted, renamed, and more!
Tips and Troubleshooting
Tip 1 - 'docker login': denied
During the initial lab provisioning, the user's Arista Access Token is used to download cEOS-lab into the Codespace and import it into Docker.
In the event that the user's Arista Access Token has expired, or is not present, the lab will fail to download cEOS-lab from arista.com and attempt to download the cEOS-lab image from DockerHub.
When this happens, the lab terminal will display the following message:
Error: Error response from daemon: pull access denied for arista/ceos, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
make: *** [Makefile:9: start] Error 1
Solution - Update ARTOKEN with new token
When a token is created in a user's arista.com profile, it is valid for one year.
Follow the steps below to generate a new token and update the ARTOKEN
secret used by acLabs Codespaces.
- Open your arista.com user profile
- Choose
Regenerate Token
- Copy the token
- Update the
ARTOKEN
value in your GitHub Codespaces Settings(1)
In the event that the
ARTOKEN
secret doesn't exist in your GitHub Codespaces Settings, chooseNew secret
and create it.This value is created automatically the first time an acLabs lab is launched, but in rare situations this auto-creation may not occur.
Once updated, launch a new acLab(1) and get back to labbing!
It's recommended to delete the Codespace where the failure occurred, and instead create a new one by choosing
Create a new one
when prompted to resume the failed Codespace
Tip 2 - Resuming an acLab
By default, GitHub Codespaces will automatically shutdown(1) after 30 minutes, and will be deleted(2) after 30 days of inactivity.
Default idle timeout
Default retention period
These Default idle timeout
and Default retention period
parameters can be changed at any time within GitHub Codespaces Settings.
A general recommendation for these values is provided below:
- Default idle timeout:
30 Minutes
- Default retention period:
1 Day
How to resume an acLab
If the Default idle timeout
has been reached, then a user may find themselves presented with the following message when re-launching the lab:
Multiple choices exist at the above prompt:
- Create a new instance of the lab in a new Codespace (1)
- Resume an existing lab that was shutdown due to the idle timeout being reached
- Delete the existing codespace(2)
Select Resume this codespace
to bring the codespace back up.
Once the Codespace is ready(1) the lab can be resumed via the ContainerLab extension by right-clicking the lab name and selecting Redeploy
- If the terminal is open and responsive, the Codespace is back up and running!
After selecting Redeploy
, the terminal will present a message indicating that ContainerLab is in the process of redeploying the lab.
If desired, select View Logs
to monitor the process of the lab as it is started back up.
When complete, a message indicating success will be presented and it's time to jump back into the lab!