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

Support NIC identifiers as alternative to MAC addresses #351

Merged
merged 34 commits into from
Mar 2, 2023

Conversation

GrigoriyMikhalkin
Copy link
Contributor

@GrigoriyMikhalkin GrigoriyMikhalkin commented Oct 26, 2022

This pull request is part of implementing support for SONiC.

Currently we are using the mac addresses on the interfaces to calculate machine connections. On SONiC switches though, all mac addresses on the switch interfaces have the same mac address. Therefore, we need some alternative identifier instead of mac addresses in order to support SONiC.

With this PR, metal-core is allowed to alternatively register its interfaces with nic identifiers, which are, if provided, used instead of mac addresses for calculating machine connections.

In order to make the identifiers for SONiC unique across racks, we additionally report Hostname with the metal-hammer. When using the identifiers, we can then narrow down nics by the switch hostnames to ensure we only have the corresponding switch nics to be used for calculating the machine connections.

The metal-hammer will:

  • in the SONiC case: report nic identifier Eth14/4(Port14), no mac address
  • in the Cumulus case: report nic identifier <the mac address>, the mac address as before

This is a breaking change for the metal-hammer, it has to be released along with this PR's changes.

/cc @robertvolkmann

References:

cmd/metal-api/internal/metal/network.go Outdated Show resolved Hide resolved
@Gerrit91
Copy link
Contributor

Gerrit91 commented Jan 12, 2023

Before merging, we should manually test this PR:

  • Run in mini-lab
  • Deploy to test environment
    • Ensure metal-core restart is working (switch registration)
    • Ensure older metal-core compatible with this PR
  • Delete machine from database and see that it comes back properly

@Gerrit91 Gerrit91 changed the title WIP: support NIC aliases as alternative to MAC addresses Support NIC aliases as alternative to MAC addresses Feb 20, 2023
@Gerrit91 Gerrit91 changed the title Support NIC aliases as alternative to MAC addresses Support NIC identifiers as alternative to MAC addresses Feb 20, 2023
@majst01 majst01 mentioned this pull request Feb 23, 2023
@Gerrit91 Gerrit91 merged commit 2156944 into master Mar 2, 2023
@Gerrit91 Gerrit91 deleted the nic-aliases-support branch March 2, 2023 11:35
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.

4 participants