ipspace / netlab

Making virtual networking labs suck less
https://netlab.tools
Other
428 stars 63 forks source link

Option to create configuration files before deployment/w netlab create #208

Closed JulioPDX closed 2 years ago

JulioPDX commented 2 years ago

Some providers(Containerlab) allow the user to specify a startup configuration for each node. See here. net-sim tools could create startup configurations that can then be referenced in the clab file. The nodes would then boot up fully configured and possibly remove a step for the Ansible deployment piece.

ipspace commented 2 years ago

Creating a fully-blown startup configuration would be an interesting exercise (see discussions in #80, nobody was brave enough yet to tackle that task), but we can collect the configurations from the devices (assuming the author of the device support provided relevant Ansible task lists) and insert pointers to them in clab.yml to allow you to restart a fully-configured lab.

At the moment, the only device for which I could see that work would be Arista vEOS. Nokia SR* devices don't have the fetch-config tasks yet (copying @jbemmel) and Cumulus VX has configs all over the place.

JulioPDX commented 2 years ago

Creating a fully-blown startup configuration would be an interesting exercise (see discussions in #80, nobody was brave enough yet to tackle that task), but we can collect the configurations from the devices (assuming the author of the device support provided relevant Ansible task lists) and insert pointers to them in clab.yml to allow you to restart a fully-configured lab.

At the moment, the only device for which I could see that work would be Arista vEOS. Nokia SR* devices don't have the fetch-config tasks yet (copying @jbemmel) and Cumulus VX has configs all over the place.

Even if you use the eos as a POC/start point would be really interesting. If the clab has pointers to startup configs, this could then be shared with other individuals. Although, you could make the argument that the same is achieved by just having the user run "netlab up". More than happy to let others weigh in on the pros and cons. Thank you for the time.

petercrocker commented 2 years ago

This could be done for some of the platforms, but not all. Cumulus <= 4.x is difficult due to the current way of using vtysh. Cisco, Arista, Juniper, Cumulus 5.X are all straightforward. Fortinet is a no go, since it’s doing API calls, not rendering a config and pushing it. I’ve been wanting to add this, so maybe I’ll give it a go next week, time permitting. Not sure about SR, but I’ll take a look at how we’re doing that.

ipspace commented 2 years ago

@petercrocker This is currently only applicable to containerlab (there's no similar mechanism to push configs to Vagrant boxes), so Cumulus 5.x is the only interesting option until Juniper wakes up and makes cRPD into something downloadable and useful.

petercrocker commented 2 years ago

Ah, I was thinking about doing this with the ansible templates for vagrant, so ignore my previous comments. Haven’t tried containerlab yet.

ipspace commented 2 years ago

Ah, I was thinking about doing this with the ansible templates for vagrant, so ignore my previous comments. Haven’t tried containerlab yet.

That doesn't bring us anything. We'd still have Ansible dependency.

jbemmel commented 2 years ago

See https://github.com/ipspace/netsim-tools/pull/214 for SR Linux / SR OS fetch config; the resulting JSON files could be set as startup-config in Containerlab

ipspace commented 2 years ago

Implemented. It will be included in 1.1.4 release (probably pushed out in mid-March).