Arista vEOS up on Vagrant - Step by Step

 The journey of NetDevops is really interesting and helping me to learn new things everyday. Today I learn, how to run vEOS over Vagrant. 

Step 1. Create an account with Arista and download vEOS box file. In my case I download - "lab-4.17.10M-virtualbox.box"

Step2. Create a directory name "vagrant".

Step3. Add vEOS box file to vagrant box. 

Command- sudo vagrant box add --name vEOS-lab-4.17.10M-virtualbox ~/Downloads/vEOS-lab-4.17.10M-virtualbox.box

 Check Vagrant box list-  sudo vagrant box list

Output will be like this:

hitesh@hitesh-ThinkPad-W541:~/vagrant$ sudo vagrant box add --name vEOS-lab-4.17.10M-virtualbox ~/Downloads/vEOS-lab-4.17.10M-virtualbox.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'vEOS-lab-4.17.10M-virtualbox' (v0) for provider:
    box: Unpacking necessary files from: file:///home/hitesh/Downloads/vEOS-lab-4.17.10M-virtualbox.box

hitesh@hitesh-ThinkPad-W541:~/vagrant$ vagrant box list
hashicorp/precise32                   (virtualbox, 1.0.0)
hashicorp/precise64                   (virtualbox, 1.1.0)
vEOS-lab-4.17.10M-virtualbox          (virtualbox, 0)
vEOS-lab-vEOS-lab-4.17.10M-virtualbox (virtualbox, 0)

 

 

Step4: Create a file name "vagrantfile" and add the configuration to run vEOS

# Vagrantfile for the quickstart tutorial

# Script configuration:
#
# Arista vEOS box.
# Please change this to match your installed version
# (use `vagrant box list` to see what you have installed).
VEOS_BOX = "vEOS-lab-4.15.5M-virtualbox" ====> change box version to which you have download.

Vagrant.configure(2) do |config|

  config.vm.define "base" do |base|
    # This box will be downloaded and added automatically if you don't
    # have it already.
    base.vm.box = "hashicorp/precise64"
    base.vm.network :forwarded_port, guest: 22, host: 12200, id: 'ssh'
    base.vm.network "private_network", virtualbox__intnet: "link_1", ip: "10.0.1.100"
    base.vm.network "private_network", virtualbox__intnet: "link_2", ip: "10.0.2.100"
    base.vm.provision "shell", inline: "apt-get update; apt-get install lldpd -y"
  end

  config.vm.define "eos" do |eos|
    eos.vm.box = VEOS_BOX
    eos.vm.network :forwarded_port, guest: 22, host: 12201, id: 'ssh'
    eos.vm.network :forwarded_port, guest: 443, host: 12443, id: 'https'
    eos.vm.network "private_network", virtualbox__intnet: "link_1", ip: "169.254.1.11", auto_config: false
    eos.vm.network "private_network", virtualbox__intnet: "link_2", ip: "169.254.1.11", auto_config: false
  end

end

Step5. Vagrant up 


Command: sudo vagrant up --provider virtualbox

Again Got and error:

hitesh@hitesh-ThinkPad-W541:~/vagrant$ sudo vagrant up --provider virtualbox
Bringing machine 'base' up with 'virtualbox' provider...
Bringing machine 'eos' up with 'virtualbox' provider...
==> base: Checking if box 'hashicorp/precise64' is up to date...
Vagrant cannot forward the specified ports on this VM, since they
would collide with some other application that is already listening
on these ports. The forwarded port to 12200 is already in use
on the host machine.

To fix this, modify your current project's Vagrantfile to use another
port. Example, where '1234' would be replaced by a unique host port:

  config.vm.network :forwarded_port, guest: 22, host: 1234

Sometimes, Vagrant will attempt to auto-correct this for you. In this
case, Vagrant was unable to. This is usually because the guest machine
is in a state which doesn't allow modifying port forwarding.
 

Solution: Change the port in the Vagrant file to "122001" and run command again. 

This time Vagrant run as expected.

Output

 hitesh@hitesh-ThinkPad-W541:~/vagrant$ sudo vagrant up --provider virtualbox
Bringing machine 'base' up with 'virtualbox' provider...
Bringing machine 'eos' up with 'virtualbox' provider...
==> base: Checking if box 'hashicorp/precise64' is up to date...
==> base: Clearing any previously set network interfaces...
==> base: Preparing network interfaces based on configuration...
    base: Adapter 1: nat
    base: Adapter 2: intnet
    base: Adapter 3: intnet
==> base: Forwarding ports...
    base: 22 (guest) => 12204 (host) (adapter 1)
==> base: Booting VM...
==> base: Waiting for machine to boot. This may take a few minutes...
    base: SSH address: 127.0.0.1:12204
    base: SSH username: vagrant
    base: SSH auth method: private key
    base:
    base: Vagrant insecure key detected. Vagrant will automatically replace
    base: this with a newly generated keypair for better security.
    base:
    base: Inserting generated public key within guest...
    base: Removing insecure key from the guest if it's present...
    base: Key inserted! Disconnecting and reconnecting using new SSH key...
==> base: Machine booted and ready!
==> base: Checking for guest additions in VM...
    base: The guest additions on this VM do not match the installed version of
    base: VirtualBox! In most cases this is fine, but in rare cases it can
    base: prevent things such as shared folders from working properly. If you see
    base: shared folder errors, please make sure the guest additions within the
    base: virtual machine match the version of VirtualBox you have installed on
    base: your host and reload your VM.
    base:
    base: Guest Additions Version: 4.2.0
    base: VirtualBox Version: 5.1
==> base: Configuring and enabling network interfaces...
==> base: Mounting shared folders...
    base: /vagrant => /home/hitesh/vagrant
==> base: Running provisioner: shell...
    base: Running: inline script
==> base: stdin: is not a tty
==> base: Get:1 http://security.ubuntu.com precise-security InRelease [55.7 kB]
==> base: Ign http://us.archive.ubuntu.com precise InRelease
==> base: Get:2 http://us.archive.ubuntu.com precise-updates InRelease [55.7 kB]
==> base: Get:3 http://us.archive.ubuntu.com precise-backports InRelease [55.7 kB]
==> base: Get:4 http://security.ubuntu.com precise-security/main Sources [150 kB]
==> base: Hit http://us.archive.ubuntu.com precise Release.gpg
==> base: Get:5 http://us.archive.ubuntu.com precise-updates/main Sources [503 kB]
==> base: Get:6 http://security.ubuntu.com precise-security/restricted Sources [4,657 B]
==> base: Get:7 http://security.ubuntu.com precise-security/universe Sources [57.9 kB]
==> base: Get:8 http://security.ubuntu.com precise-security/multiverse Sources [3,040 B]
==> base: Get:9 http://security.ubuntu.com precise-security/main amd64 Packages [375 kB]
==> base: Get:10 http://us.archive.ubuntu.com precise-updates/restricted Sources [8,837 B]
==> base: Get:11 http://us.archive.ubuntu.com precise-updates/universe Sources [137 kB]
==> base: Get:12 http://us.archive.ubuntu.com precise-updates/multiverse Sources [10.5 kB]
==> base: Get:13 http://us.archive.ubuntu.com precise-updates/main amd64 Packages [741 kB]
==> base: Get:14 http://security.ubuntu.com precise-security/restricted amd64 Packages [10.8 kB]
==> base: Get:15 http://security.ubuntu.com precise-security/universe amd64 Packages [145 kB]
==> base: Get:16 http://security.ubuntu.com precise-security/multiverse amd64 Packages [3,365 B]
==> base: Get:17 http://security.ubuntu.com precise-security/main i386 Packages [378 kB]
==> base: Get:18 http://us.archive.ubuntu.com precise-updates/restricted amd64 Packages [15.4 kB]
==> base: Get:19 http://us.archive.ubuntu.com precise-updates/universe amd64 Packages [288 kB]
==> base: Get:20 http://security.ubuntu.com precise-security/restricted i386 Packages [10.8 kB]
==> base: Get:21 http://security.ubuntu.com precise-security/universe i386 Packages [154 kB]
==> base: Get:22 http://us.archive.ubuntu.com precise-updates/multiverse amd64 Packages [17.1 kB]
==> base: Get:23 http://us.archive.ubuntu.com precise-updates/main i386 Packages [745 kB]
==> base: Get:24 http://security.ubuntu.com precise-security/multiverse i386 Packages [3,552 B]
==> base: Get:25 http://security.ubuntu.com precise-security/main TranslationIndex [208 B]
==> base: Get:26 http://security.ubuntu.com precise-security/multiverse TranslationIndex [199 B]
==> base: Get:27 http://security.ubuntu.com precise-security/restricted TranslationIndex [202 B]
==> base: Get:28 http://security.ubuntu.com precise-security/universe TranslationIndex [205 B]
==> base: Get:29 http://us.archive.ubuntu.com precise-updates/restricted i386 Packages [15.3 kB]
==> base: Get:30 http://us.archive.ubuntu.com precise-updates/universe i386 Packages [297 kB]
==> base: Get:31 http://us.archive.ubuntu.com precise-updates/multiverse i386 Packages [17.3 kB]
==> base: Get:32 http://us.archive.ubuntu.com precise-updates/main TranslationIndex [208 B]
==> base: Get:33 http://us.archive.ubuntu.com precise-updates/multiverse TranslationIndex [202 B]
==> base: Get:34 http://security.ubuntu.com precise-security/main Translation-en [188 kB]
==> base: Get:35 http://us.archive.ubuntu.com precise-updates/restricted TranslationIndex [202 B]
==> base: Get:36 http://us.archive.ubuntu.com precise-updates/universe TranslationIndex [205 B]
==> base: Hit http://us.archive.ubuntu.com precise Release
==> base: Get:37 http://us.archive.ubuntu.com precise-backports/main Sources [5,889 B]
==> base: Get:38 http://us.archive.ubuntu.com precise-backports/restricted Sources [28 B]
==> base: Get:39 http://us.archive.ubuntu.com precise-backports/universe Sources [44.2 kB]
==> base: Get:40 http://us.archive.ubuntu.com precise-backports/multiverse Sources [5,742 B]
==> base: Get:41 http://us.archive.ubuntu.com precise-backports/main amd64 Packages [6,456 B]
==> base: Get:42 http://security.ubuntu.com precise-security/multiverse Translation-en [1,993 B]
==> base: Get:43 http://security.ubuntu.com precise-security/restricted Translation-en [2,802 B]
==> base: Get:44 http://us.archive.ubuntu.com precise-backports/restricted amd64 Packages [28 B]
==> base: Get:45 http://us.archive.ubuntu.com precise-backports/universe amd64 Packages [46.2 kB]
==> base: Get:46 http://us.archive.ubuntu.com precise-backports/multiverse amd64 Packages [5,426 B]
==> base: Get:47 http://us.archive.ubuntu.com precise-backports/main i386 Packages [6,470 B]
==> base: Get:48 http://us.archive.ubuntu.com precise-backports/restricted i386 Packages [28 B]
==> base: Get:49 http://us.archive.ubuntu.com precise-backports/universe i386 Packages [46.0 kB]
==> base: Get:50 http://us.archive.ubuntu.com precise-backports/multiverse i386 Packages [5,418 B]
==> base: Get:51 http://us.archive.ubuntu.com precise-backports/main TranslationIndex [202 B]
==> base: Get:52 http://us.archive.ubuntu.com precise-backports/multiverse TranslationIndex [202 B]
==> base: Get:53 http://us.archive.ubuntu.com precise-backports/restricted TranslationIndex [193 B]
==> base: Get:54 http://security.ubuntu.com precise-security/universe Translation-en [93.2 kB]
==> base: Get:55 http://us.archive.ubuntu.com precise-backports/universe TranslationIndex [205 B]
==> base: Get:56 http://us.archive.ubuntu.com precise-updates/main Translation-en [344 kB]
==> base: Get:57 http://us.archive.ubuntu.com precise-updates/multiverse Translation-en [10.1 kB]
==> base: Get:58 http://us.archive.ubuntu.com precise-updates/restricted Translation-en [3,686 B]
==> base: Get:59 http://us.archive.ubuntu.com precise-updates/universe Translation-en [174 kB]
==> base: Hit http://us.archive.ubuntu.com precise/main Sources
==> base: Hit http://us.archive.ubuntu.com precise/restricted Sources
==> base: Hit http://us.archive.ubuntu.com precise/universe Sources
==> base: Hit http://us.archive.ubuntu.com precise/multiverse Sources
==> base: Hit http://us.archive.ubuntu.com precise/main amd64 Packages
==> base: Hit http://us.archive.ubuntu.com precise/restricted amd64 Packages
==> base: Hit http://us.archive.ubuntu.com precise/universe amd64 Packages
==> base: Hit http://us.archive.ubuntu.com precise/multiverse amd64 Packages
==> base: Hit http://us.archive.ubuntu.com precise/main i386 Packages
==> base: Hit http://us.archive.ubuntu.com precise/restricted i386 Packages
==> base: Hit http://us.archive.ubuntu.com precise/universe i386 Packages
==> base: Hit http://us.archive.ubuntu.com precise/multiverse i386 Packages
==> base: Hit http://us.archive.ubuntu.com precise/main TranslationIndex
==> base: Hit http://us.archive.ubuntu.com precise/multiverse TranslationIndex
==> base: Hit http://us.archive.ubuntu.com precise/restricted TranslationIndex
==> base: Hit http://us.archive.ubuntu.com precise/universe TranslationIndex
==> base: Get:60 http://us.archive.ubuntu.com precise-backports/main Translation-en [5,737 B]
==> base: Get:61 http://us.archive.ubuntu.com precise-backports/multiverse Translation-en [4,852 B]
==> base: Get:62 http://us.archive.ubuntu.com precise-backports/restricted Translation-en [28 B]
==> base: Get:63 http://us.archive.ubuntu.com precise-backports/universe Translation-en [35.9 kB]
==> base: Hit http://us.archive.ubuntu.com precise/main Translation-en
==> base: Hit http://us.archive.ubuntu.com precise/multiverse Translation-en
==> base: Hit http://us.archive.ubuntu.com precise/restricted Translation-en
==> base: Hit http://us.archive.ubuntu.com precise/universe Translation-en
==> base: Fetched 5,298 kB in 6s (773 kB/s)
==> base: Reading package lists...
==> base: Reading package lists...
==> base: Building dependency tree...
==> base: Reading state information...
==> base: The following extra packages will be installed:
==> base:   libperl5.14 libsensors4 libsnmp-base libsnmp15 perl perl-base perl-modules
==> base: Suggested packages:
==> base:   lm-sensors snmp-mibs-downloader snmpd perl-doc libterm-readline-gnu-perl
==> base:   libterm-readline-perl-perl make libpod-plainer-perl
==> base: The following NEW packages will be installed:
==> base:   libperl5.14 libsensors4 libsnmp-base libsnmp15 lldpd
==> base: The following packages will be upgraded:
==> base:   perl perl-base perl-modules
==> base: 3 upgraded, 5 newly installed, 0 to remove and 190 not upgraded.
==> base: Need to get 11.0 MB of archives.
==> base: After this operation, 4,251 kB of additional disk space will be used.
==> base: Get:1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main perl amd64 5.14.2-6ubuntu2.5 [4,412 kB]
==> base: Get:2 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main perl-base amd64 5.14.2-6ubuntu2.5 [1,513 kB]
==> base: Get:3 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main perl-modules all 5.14.2-6ubuntu2.5 [3,397 kB]
==> base: Get:4 http://us.archive.ubuntu.com/ubuntu/ precise/main libsensors4 amd64 1:3.3.1-2ubuntu1 [31.9 kB]
==> base: Get:5 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libperl5.14 amd64 5.14.2-6ubuntu2.5 [1,256 B]
==> base: Get:6 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libsnmp-base all 5.4.3~dfsg-2.4ubuntu1.3 [216 kB]
==> base: Get:7 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libsnmp15 amd64 5.4.3~dfsg-2.4ubuntu1.3 [1,334 kB]
==> base: Get:8 http://us.archive.ubuntu.com/ubuntu/ precise/universe lldpd amd64 0.5.5-1 [97.3 kB]
==> base: dpkg-preconfigure: unable to re-open stdin: No such file or directory
==> base: Fetched 11.0 MB in 4s (2,490 kB/s)
==> base: (Reading database ...
==> base: 51095 files and directories currently installed.)
==> base: Preparing to replace perl 5.14.2-6ubuntu2 (using .../perl_5.14.2-6ubuntu2.5_amd64.deb) ...
==> base: Unpacking replacement perl ...
==> base: Preparing to replace perl-base 5.14.2-6ubuntu2 (using .../perl-base_5.14.2-6ubuntu2.5_amd64.deb) ...
==> base: Unpacking replacement perl-base ...
==> base: Processing triggers for man-db ...
==> base: Setting up perl-base (5.14.2-6ubuntu2.5) ...
==> base: (Reading database ...
==> base: 51095 files and directories currently installed.)
==> base: Preparing to replace perl-modules 5.14.2-6ubuntu2 (using .../perl-modules_5.14.2-6ubuntu2.5_all.deb) ...
==> base: Unpacking replacement perl-modules ...
==> base: Selecting previously unselected package libsensors4.
==> base: Unpacking libsensors4 (from .../libsensors4_1%3a3.3.1-2ubuntu1_amd64.deb) ...
==> base: Selecting previously unselected package libperl5.14.
==> base: Unpacking libperl5.14 (from .../libperl5.14_5.14.2-6ubuntu2.5_amd64.deb) ...
==> base: Selecting previously unselected package libsnmp-base.
==> base: Unpacking libsnmp-base (from .../libsnmp-base_5.4.3~dfsg-2.4ubuntu1.3_all.deb) ...
==> base: Selecting previously unselected package libsnmp15.
==> base: Unpacking libsnmp15 (from .../libsnmp15_5.4.3~dfsg-2.4ubuntu1.3_amd64.deb) ...
==> base: Selecting previously unselected package lldpd.
==> base: Unpacking lldpd (from .../lldpd_0.5.5-1_amd64.deb) ...
==> base: Processing triggers for man-db ...
==> base: Processing triggers for ureadahead ...
==> base: Setting up libsensors4 (1:3.3.1-2ubuntu1) ...
==> base: Setting up libperl5.14 (5.14.2-6ubuntu2.5) ...
==> base: Setting up libsnmp-base (5.4.3~dfsg-2.4ubuntu1.3) ...
==> base: Setting up libsnmp15 (5.4.3~dfsg-2.4ubuntu1.3) ...
==> base: Setting up lldpd (0.5.5-1) ...
==> base: Setting up perl-modules (5.14.2-6ubuntu2.5) ...
==> base: Setting up perl (5.14.2-6ubuntu2.5) ...
==> base: Processing triggers for libc-bin ...
==> base: ldconfig deferred processing now taking place
==> eos: Importing base box 'vEOS-lab-4.17.10M-virtualbox'...
==> eos: Matching MAC address for NAT networking...
==> eos: Setting the name of the VM: vagrant_eos_1596810579439_3041
==> eos: Clearing any previously set network interfaces...
==> eos: Preparing network interfaces based on configuration...
    eos: Adapter 1: nat
    eos: Adapter 2: intnet
    eos: Adapter 3: intnet
==> eos: Forwarding ports...
    eos: 22 (guest) => 12201 (host) (adapter 1)
    eos: 443 (guest) => 12443 (host) (adapter 1)
==> eos: Booting VM...
==> eos: Waiting for machine to boot. This may take a few minutes...
    eos: SSH address: 127.0.0.1:12201
    eos: SSH username: root
    eos: SSH auth method: private key
    eos:
    eos: Vagrant insecure key detected. Vagrant will automatically replace
    eos: this with a newly generated keypair for better security.
    eos:
    eos: Inserting generated public key within guest...
    eos: Removing insecure key from the guest if it's present...
    eos: Key inserted! Disconnecting and reconnecting using new SSH key...
==> eos: Machine booted and ready!
==> eos: Checking for guest additions in VM...
    eos: No guest additions were detected on the base box for this VM! Guest
    eos: additions are required for forwarded ports, shared folders, host only
    eos: networking, and more. If SSH fails on this machine, please install
    eos: the guest additions and repackage the box to continue.
    eos:
    eos: This is not an error message; everything may continue to work properly,
    eos: in which case you may ignore this message.


Step6: Login to Arista vEOS.

Command: sudo vagrant ssh eos

Output

hitesh@hitesh-ThinkPad-W541:~/vagrant$ sudo vagrant ssh eos

Arista Networks EOS shell

-bash-4.3# sho
shopt            showconsolefont  showkey          showmount        
-bash-4.3#    




Comments