I am starting to get into a little bit of devops and I work in a QEMU/KVM environment most of the time. I am trying to build a framework for my employer where we can effectively demonstrate various architectures for security and network appliances through using Vagrant do deploy a quick lab image inside our Lab environment. I am hoping to be able to approach a CI/CD workflow in network architectures for on-prem hardware using this methodology.
I have found quite a few guides on building older VyOS builds, and I found some documentation on how to build FortiOS images for Vagrant + VMWare. I tried to build a new VM image of VyOS using Packer, by forking [higebu/packer-templates](https://github.com/higebu/packer-templates), removing a lot of the extraneous commands needed for the install since VMs are now available in qemu format, and creating a libvirt provisioner export, however my image won't boot when imported as a packer image. If I unpack the box (untar, grab .img file, rename to qcow2, and mount it) it does work.
I would like to have a way to build the appliances easily since many of my appliances have time limited trials, and as soon as i boot the VM image to put in the base vagrant configuration (dhcp on port1, vagrant user, insecure ssh key) the clock starts ticking. by building a provisioner script to automate the creation of boxes locally, all of my architects/engineers will be able to download the images themselves, provision them into vagrant boxes, and then use them for 14 days until the trial runs out, when it does, re-packer the boxes.
Has anybody built a relatively recent VyOS, Fortinet, or other network "appliance" virtual machine Vagrant box to be run on libvirt and do you have any tips for building such a thing? Vagrant is so perfect for this use case, specifically to be able to share labs between engineers/architects through the sharing of vagrant files and/or a git repo of vagrant files, but I've been struggling with the build of the individual boxes of network appliances, which is kind of the founding blocks of this project.
I have created quite a few. Take your pick:
* [Fortinet FortiGate](https://github.com/mweisel/fortigate-vagrant-libvirt)
* [Arista vEOS](https://github.com/mweisel/veos-lab-vagrant-libvirt)
* [Cisco ASAv](https://github.com/mweisel/cisco-asav-vagrant-libvirt)
* [Cisco IOSv](https://github.com/mweisel/cisco-iosv-vagrant-libvirt)
* [Cisco IOSvL2](https://github.com/mweisel/cisco-iosvl2-vagrant-libvirt)
* [Cisco IOS XRv](https://github.com/mweisel/cisco-iosxrv-vagrant-libvirt)
* [Cisco CSR 1000V](https://github.com/mweisel/cisco-csr1kv-vagrant-libvirt)
* [Cisco Catalyst 8000V](https://github.com/mweisel/cisco-catalyst-8kv-vagrant-libvirt)
* [Cisco Nexus 9000v](https://github.com/mweisel/cisco-nxos9kv-vagrant-libvirt)
>Vagrant is so perfect for this use case, specifically to be able to share labs between engineers/architects through the sharing of vagrant files and/or a git repo of vagrant files …
I agree. In my experience, it’s superior to GNS3, EVE-NG, and CML in the modern age of network automation. Happy labbing!
[https://res.cloudinary.com/binarynature/image/upload/v1616553267/fgt-vagrant-packer-ansible\_pz03zv.png](https://res.cloudinary.com/binarynature/image/upload/v1616553267/fgt-vagrant-packer-ansible_pz03zv.png)