VyOS: vagrant box building hacks - #3849
Conversation
|
Based on https://docs.vyos.io/en/1.5/automation/cloud-init.html, it seems like we could get most of your setup into cloud-init files. Let me waste some time on this... ;) |
Unfortunately it's not that simple. ( https://docs.vyos.io/en/1.5/automation/cloud-init.html#generate-qcow2-image ) |
Yeah, they really try to make it "easy" to install stuff :(( How about modifying "netlab libvirt package" command to accept ISO images and then do the whole installation process (including reboot) in one go? |
|
One more thing: we could build an ISO image with the required scripts (the pre-boot script and another one with the set commands) and then execute a single script off the ISO image to complete VyOS configuration. |
that could be a great idea. potentially, we could also add "hooks" to inject arbitrary files on arbitrary partitions of the qcow file ("mounting" it with qemu-nbd & co) before packing it up as box. - at that point we can inject a first-boot script with all the required config including vagrant keys & friends. however i'm wondering if this will ever be used by other devices and if it's worth the effort... |
Wondering what happens if you have two CD-ROMs when booting the CD-ROM image...
Nah, we have to do this with the minimum amount of extra changes. For example:
|
|
... I think I got most of the details nailed down. Give me a few hours... |
Optimize VyOS build process
Fixes #3841
It's "a bit" hacky, but I put a warning on the box building document about this, and about the fact that for this reason we suggest using the containerlab version.
However, it works.
Tested with
netlab up -p libvirt -d vyos 01-interfaces.yml --validate(building issues are in the interface presence & ordering)Given all this, up to you @ipspace if you want to merge this or not.