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 switch migrate endpoint #566

Merged
merged 42 commits into from
Nov 7, 2024
Merged

Add switch migrate endpoint #566

merged 42 commits into from
Nov 7, 2024

Conversation

iljarotar
Copy link
Contributor

Replaces #526

With the previous PR migrating from Cumulus to SONiC was expected to occur during switch registration. The problem with that is that a switch replacement requires the new switch to have the same ID as the old one. But deploying a new switch with the same ID as an existing one can be problematic in some cases.

Therefore the new approach implements a switch/migrate endpoint that migrates the configuration from one switch to another, allowing both switches to have different OSs (Cumulus and Edgecore SONiC). With this approach it should be possible to register a switch first and perform the migration from an existing one to the new one afterwards, without requiring its ID to be the same as the old one's.

@iljarotar iljarotar requested a review from a team as a code owner September 4, 2024 09:52
@iljarotar iljarotar requested a review from majst01 September 4, 2024 09:52
@iljarotar iljarotar marked this pull request as draft September 4, 2024 09:53
@iljarotar iljarotar self-assigned this Sep 4, 2024
@majst01
Copy link
Contributor

majst01 commented Sep 4, 2024

It should be much easier to test with this approach in the mini-lab, simply create a setup there where 2 cumulus switches and one SONiC Switch is present and then migrate one of the cumulus switches to the SONiC Switch. Then the configuration on the SONiC Switch must be identical

@iljarotar
Copy link
Contributor Author

Open for discussion:

In addition to the migrate approach, a port mapping from Cumulus to SONiC also occurs when a switch gets replaced. So a migration is also possible right on switch registration. Do we want this, or should a switch replacement remain as it is, i.e. only for replacing a broken switch by a healthy one without changing OS?

@iljarotar iljarotar marked this pull request as ready for review September 10, 2024 14:02
@iljarotar iljarotar marked this pull request as draft September 13, 2024 09:17
@iljarotar
Copy link
Contributor Author

Turns out the mapping from Cumulus to SONiC port names is off by 1. spw1 should map to Ethernet0 etc.

cmd/metal-api/internal/datastore/switch.go Outdated Show resolved Hide resolved
cmd/metal-api/internal/metal/network.go Outdated Show resolved Hide resolved
cmd/metal-api/internal/service/switch-service.go Outdated Show resolved Hide resolved
@iljarotar iljarotar marked this pull request as ready for review October 1, 2024 12:16
cmd/metal-api/internal/service/v1/switch.go Outdated Show resolved Hide resolved
@majst01 majst01 requested a review from Gerrit91 October 14, 2024 12:02
@majst01
Copy link
Contributor

majst01 commented Oct 17, 2024

We should wait for a retest in the fleet.

Copy link
Contributor

@Gerrit91 Gerrit91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just comments on style. I guess the technical aspects are spot on.

cmd/metal-api/internal/metal/switch_test.go Outdated Show resolved Hide resolved
cmd/metal-api/internal/metal/switch.go Outdated Show resolved Hide resolved
cmd/metal-api/internal/metal/switch.go Outdated Show resolved Hide resolved
cmd/metal-api/internal/metal/switch.go Outdated Show resolved Hide resolved
cmd/metal-api/internal/service/switch-service.go Outdated Show resolved Hide resolved
@iljarotar iljarotar merged commit 3d4b264 into master Nov 7, 2024
2 checks passed
@iljarotar iljarotar deleted the switch-migrate branch November 7, 2024 14:38
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.

3 participants