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

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft

Add switch migrate endpoint #566

wants to merge 21 commits into from

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 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
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.

2 participants