Skip to content
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

Add script which prevents XRd from having multiple IPv6 addresses on mgmt interface #2295

Merged
merged 2 commits into from
Nov 16, 2024

Conversation

kaelemc
Copy link
Contributor

@kaelemc kaelemc commented Nov 15, 2024

Closes #2277.

This PR adds a basic script which removes all IPv6 address from the management interface (MgmtEth0/RP0/CPU0/0), and then assigns the correct management IPv6 address according to clab.

This fixes a problem that users have reported having of 'incorrect device mapping to ip address'. No work is required for IPv4 as the management interface is only allowed a single IPv4 address and XRd automatically overwrites the old one.

  • Environment variable XR_EVERY_BOOT_SCRIPT points to the path to the script on the containers filesystem. When this env var is populated XRd runs the script at that path on well.. every boot 😀.
  • An empty file for the script is created in the createXRDFiles() function, so that docker doesn't automatically create a folder for the bind mount. ACLs are also edited on the file since XR needs the file to be executable.
  • Script populates IPv6 address via gomplate. This has to be done in PostDeploy since we don't know the container IPv6 address in PreDeploy (I think?).
  • XRd executes the script AFTER first boot or startup configuration has been applied.

I've tested and ensured the script is working as it should and confirmed that without the script i'm getting the duplicate address behaviour.

- Created script which removes existing management IPv6 address from MgmtEth0/RP0/CPU0/0.
- Script has IPv6 address populated via gomplate.
- Env var XRD_EVERY_BOOT_SCRIPT is populated with path to script.
- On every boot of XRd the script is executed, and on each lab deployment the script is regenerated with the correct v6 mgmt address.
@kaelemc kaelemc changed the title Implement script to configure XRd mgmt ipv6 address Add script which prevents XRd from having multiple IPv6 addresses on mgmt interface Nov 15, 2024
@hellt
Copy link
Member

hellt commented Nov 16, 2024

do you want someone else to test it first? or is it pretty much tested by you?

@kaelemc
Copy link
Contributor Author

kaelemc commented Nov 16, 2024

I've tested it, I think it's good to go 👍

@hellt hellt merged commit c06dd25 into srl-labs:main Nov 16, 2024
66 checks passed
Copy link

codecov bot commented Nov 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 25 lines in your changes missing coverage. Please review.

Project coverage is 51.31%. Comparing base (d442919) to head (2549c37).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
nodes/xrd/xrd.go 0.00% 25 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2295      +/-   ##
==========================================
+ Coverage   50.59%   51.31%   +0.72%     
==========================================
  Files         172      172              
  Lines       16770    16792      +22     
==========================================
+ Hits         8484     8617     +133     
+ Misses       7369     7253     -116     
- Partials      917      922       +5     
Files with missing lines Coverage Δ
nodes/xrd/xrd.go 0.91% <0.00%> (-0.24%) ⬇️

... and 5 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XRd can have duplicate IPv6 addresses on management interface
2 participants