-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
veth creation: make first node create the veth endpoints #1914
Conversation
- remove links from nodes -> should go via Endpoints->link - nodes deploy links, whch then call deploy on the link
c032936
to
dbaa94d
Compare
Hi @steiler, I just tested this PR and it works like a charm.
Topology needed before around 48min to become healthy and there was always the possibilty that the virtual asr9k will never become healthy because there are not enough resources. If I did the math right speed increased by 15% |
Great, then it is now up to @hellt to do the final review. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1914 +/- ##
==========================================
+ Coverage 48.59% 53.20% +4.61%
==========================================
Files 133 155 +22
Lines 12789 11303 -1486
==========================================
- Hits 6215 6014 -201
+ Misses 5870 4437 -1433
- Partials 704 852 +148
|
Thanks mate, this is solid |
This is the PR to tackle the link creation issues described in #1907.
This PR now changes the link creation strategy. For the veth, where there are two endpoints located in two network namespaces. The link is created by the first node that reaches the create-links phases. It creates the link with its two endpoints in the host namespace with randomized interface names. One endpoint (netlink.link) is then transferred to the netns of the container, renamed to the designated name, and set admin up.
The other endpoint remains in the root/host netns (wiht its random clab- name) until the second node reaches the create-links phase. The second node, instead of creating the whole veth link, only pulls in the existing endpoint, renames it and sets it admin up.
This way, the defined interfaces will exist, as soon as the create-links phase is reached. However, it is not guarantied that the link is already operational. But anyways will this help to perform
ip link
andip address
commands and further also prevents deadlocks in case of vrnetlab nodes, where the nodes would only boot the VMs when all the interfaces are available to the network namespace.Further did I remove the reference from nodes to links. Nodes do own endpoints that belong to links. Hence to access Link attributes, the endpoint should be consulted. This prevents us from drifting state, if an endpoint is added but the link is missed or the other way around.