Open KTodts opened 10 months ago
Thanks for a detailed report @KTodts we will have a look at it
I can not confirm this. The message Creating lab directory: ...
is expected, we call the os.MakeAll functions, that takes a path and creates all the dirs along the path that do not exist, like mkdir
with the -p
option. So if the path towards the lab folder is there it is basically a noop.
Deploy:
~/projects/containerlab4$ sudo clab deploy -t lab-examples/srl01/
INFO[0000] Containerlab v0.47.2 started
INFO[0000] Parsing & checking topology file: srl01.clab.yml
INFO[0000] Creating docker network: Name="clab", IPv4Subnet="172.20.20.0/24", IPv6Subnet="2001:172:20:20::/64", MTU='ל'
INFO[0000] Creating lab directory: /home/steiler/projects/containerlab4/clab-srl01
INFO[0000] Creating container: "srl"
INFO[0001] Running postdeploy actions for Nokia SR Linux 'srl' node
INFO[0022] Adding containerlab host entries to /etc/hosts file
INFO[0022] Adding ssh config for containerlab nodes
+---+----------------+--------------+-----------------------+------+---------+----------------+----------------------+
| # | Name | Container ID | Image | Kind | State | IPv4 Address | IPv6 Address |
+---+----------------+--------------+-----------------------+------+---------+----------------+----------------------+
| 1 | clab-srl01-srl | af0a98f1c3b0 | ghcr.io/nokia/srlinux | srl | running | 172.20.20.2/24 | 2001:172:20:20::2/64 |
+---+----------------+--------------+-----------------------+------+---------+----------------+----------------------+
Configure:
steiler@vbox:~/projects/containerlab4$ ssh clab-srl01-srl
Warning: Permanently added 'clab-srl01-srl' (ED25519) to the list of known hosts.
................................................................
: Welcome to Nokia SR Linux! :
: Open Network OS for the NetOps era. :
: :
: This is a freely distributed official container image. :
: Use it - Share it :
: :
: Get started: https://learn.srlinux.dev :
: Container: https://go.srlinux.dev/container-image :
: Docs: https://doc.srlinux.dev/22-11 :
: Rel. notes: https://doc.srlinux.dev/rn22-11-1 :
: YANG: https://yang.srlinux.dev/release/v22.11.1 :
: Discord: https://go.srlinux.dev/discord :
: Contact: https://go.srlinux.dev/contact-sales :
................................................................
Using configuration file(s): []
Welcome to the srlinux CLI.
Type 'help' (and press <ENTER>) if you need any help using this.
--{ running }--[ ]--
A:srl# enter candidate
--{ candidate shared default }--[ ]--
A:srl# set network-instance default description "my funny description"
--{ * candidate shared default }--[ ]--
A:srl# set network-instance default admin-state enable
--{ * candidate shared default }--[ ]--
A:srl# commit now save
/system:
Saved current running configuration as initial (startup) configuration '/etc/opt/srlinux/config.json'
All changes have been committed. Leaving candidate mode.
--{ running }--[ ]--
A:srl# quit
Connection to clab-srl01-srl closed.
Check:
steiler@vbox:~/projects/containerlab4$ grep -B3 -A2 funny clab-srl01/srl/config/config.json
{
"name": "default",
"admin-state": "enable",
"description": "my funny description"
},
{
Destroy:
steiler@vbox:~/projects/containerlab4$ sudo clab destroy -t lab-examples/srl01/
INFO[0000] Parsing & checking topology file: srl01.clab.yml
INFO[0000] Destroying lab: srl01
INFO[0000] Removed container: clab-srl01-srl
INFO[0000] Removing containerlab host entries from /etc/hosts file
INFO[0000] Removing ssh config for containerlab nodes
Redeploy:
steiler@vbox:~/projects/containerlab4$ sudo clab deploy -t lab-examples/srl01/
INFO[0000] Containerlab v0.47.2 started
INFO[0000] Parsing & checking topology file: srl01.clab.yml
INFO[0000] Creating docker network: Name="clab", IPv4Subnet="172.20.20.0/24", IPv6Subnet="2001:172:20:20::/64", MTU='ל'
INFO[0000] Creating lab directory: /home/steiler/projects/containerlab4/clab-srl01
INFO[0000] Creating container: "srl"
INFO[0000] Running postdeploy actions for Nokia SR Linux 'srl' node
INFO[0016] Adding containerlab host entries to /etc/hosts file
INFO[0016] Adding ssh config for containerlab nodes
+---+----------------+--------------+-----------------------+------+---------+----------------+----------------------+
| # | Name | Container ID | Image | Kind | State | IPv4 Address | IPv6 Address |
+---+----------------+--------------+-----------------------+------+---------+----------------+----------------------+
| 1 | clab-srl01-srl | 003c92e9f56e | ghcr.io/nokia/srlinux | srl | running | 172.20.20.2/24 | 2001:172:20:20::2/64 |
+---+----------------+--------------+-----------------------+------+---------+----------------+----------------------+
Check file:
steiler@vbox:~/projects/containerlab4$ grep -B3 -A2 funny clab-srl01/srl/config/config.json
{
"name": "default",
"admin-state": "enable",
"description": "my funny description"
},
{
Check SRL:
steiler@vbox:~/projects/containerlab4$ ssh clab-srl01-srl
Warning: Permanently added 'clab-srl01-srl' (ED25519) to the list of known hosts.
................................................................
: Welcome to Nokia SR Linux! :
: Open Network OS for the NetOps era. :
: :
: This is a freely distributed official container image. :
: Use it - Share it :
: :
: Get started: https://learn.srlinux.dev :
: Container: https://go.srlinux.dev/container-image :
: Docs: https://doc.srlinux.dev/22-11 :
: Rel. notes: https://doc.srlinux.dev/rn22-11-1 :
: YANG: https://yang.srlinux.dev/release/v22.11.1 :
: Discord: https://go.srlinux.dev/discord :
: Contact: https://go.srlinux.dev/contact-sales :
................................................................
Using configuration file(s): []
Welcome to the srlinux CLI.
Type 'help' (and press <ENTER>) if you need any help using this.
--{ running }--[ ]--
A:srl# info from running network-instance default
network-instance default {
admin-state enable
description "my funny description"
}
--{ running }--[ ]--
A:srl#
So, well... someone else maybe also try this, but I can't reproduce the issue.
I don't know if it makes any difference but I'm using startup-config in the topology file.
edit: My understanding was, that clab project dir has priority to the startup-config file. When you deploy for the first time there is no clab project dir, so it takes the config from startup-config. Once you alter the config and redeploy it should take the config from the clab project dir
Hmm @hellt whats our definition of a startup-config? Is that the if no config already exists startup-config or is it the always and in any case startup-config?
ok, if a config is present in the nodes lab dir we should use that, if not e.g. --reconfigure we should download. I'll figure out how we do that best
ah, startup-config takes precendence over the local dir @KTodts The goal of a startup-config is to be the "startup config".
The idea was that our topology should be as declarative as possible, so if we have a startup config in the topo file, this file should be used as a startup config, and thus overriding any config present in the node lab directory.
Although this note here https://containerlab.dev/manual/nodes/#embedded-startup-config says otherwise :D
To be honest, I think we need to then use existing labdir config indeed
/cc @steiler @KTodts
Although this note here https://containerlab.dev/manual/nodes/#embedded-startup-config says otherwise :D
To be honest, I think we need to then use existing labdir config indeed
/cc @steiler @KTodts
This way after installing a project from a repo you have the possibility to build on top of that.
Yes and the note says so... We do have the enforce-startup-config flag otherwise... This behavior got screwed when I implemented the http(s) download of the config... Mea culpa. Will fix it!
I just found this issue has been occurred starting from version 0.45.0.
The main issue that I have experienced is even though I have saved my config before destroying the topology, the config is not persistent anymore. After executing deploy command it always copies or uses the config file from startup-config definition in topo-yaml file.,
yes, this is still unresolved. I will link your internal message to be evaluated when we get to fix this
@hellt I am having same issue. I have startup config in clab lab directory. When I deploy lab again, startup config is not seen. have you any progress for this bug
thank you
I noticed after upgrading my clab version from 43.0 to 47.1 that the config is not persistent after a redeploy of the topology.
Test would be, deploy topology for the first time --> make a config change --> destroy lab --> deploy again --> verify if change is persistent.
1 upgrade clab to version 47.1
2 Start with a fresh deployment by using --reconfgure
3 Log into the node. Make a change, commit and save config. (add default network-instance with a description)
4 Destroy topology
5 Deploy again. Note that the project directory, clab-lab, is being created again
6 Verify is config change is persistent after redeployment. (default network-instance is not configured)