Skip to content

mweisel/veos-lab-vagrant-libvirt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant netlab

Arista vEOS-lab Vagrant box

A Packer template for creating an Arista vEOS-lab Vagrant box for the libvirt provider.

Prerequisites

Steps

0. Verify the prerequisite tools are installed.

which git packer libvirtd qemu-system-x86_64 vagrant
vagrant plugin list

1. Log in and download the vEOS Lab disk image (qcow2) file from Arista.

2. Save the file to your Downloads directory.

3. Copy (and rename) the disk image file to the /var/lib/libvirt/images directory.

sudo cp ~/Downloads/vEOS64-lab-4.35.3F.qcow2 /var/lib/libvirt/images/arista-veos.qcow2

4. Create the boxes directory.

mkdir -p ~/boxes

5. Clone this GitHub repo and cd into the directory.

git clone https://github.com/mweisel/veos-lab-vagrant-libvirt && cd veos-lab-vagrant-libvirt

6. Install the plugins required for the Packer configuration.

packer init -upgrade arista-veos.pkr.hcl

7. Packer build to create the Vagrant box artifact, including the EOS version number for the version variable value.

packer build -var 'version=4.35.3F' arista-veos.pkr.hcl

8. Copy the Vagrant box artifact to the boxes directory.

cp ./builds/arista-veos-4.35.3F.box ~/boxes/

9. Copy the box metadata file to the boxes directory.

cp ./src/arista-veos.json ~/boxes/

10. Change the current working directory to boxes.

cd ~/boxes

11. Substitute the HOME placeholder string in the box metadata file.

$ awk '/url/{gsub(/^ */,"");print}' arista-veos.json
"url": "file://HOME/boxes/arista-veos-VER.box"

$ sed -i "s|HOME|${HOME}|" arista-veos.json

$ awk '/url/{gsub(/^ */,"");print}' arista-veos.json
"url": "file:///home/marc/boxes/arista-veos-VER.box"

12. Also, substitute the VER placeholder string with the EOS version.

$ awk '/VER/{gsub(/^ */,"");print}' arista-veos.json
"version": "VER",
"url": "file:///home/marc/boxes/arista-veos-VER.box"

$ sed -i 's/VER/4.35.3F/g' arista-veos.json

$ awk '/\<version\>|url/{gsub(/^ */,"");print}' arista-veos.json
"version": "4.35.3F",
"url": "file:///home/marc/boxes/arista-veos-4.35.3F.box"

13. Add the Vagrant box to the local inventory.

vagrant box add arista-veos.json

License

This project is licensed under the MIT License - see the LICENSE file for details

About

A Packer template for creating an Arista vEOS-lab Vagrant box for the libvirt provider.

Topics

Resources

License

Stars

Watchers

Forks

Languages