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

metal3-static-ip-set init container fails when there are two interfaces with same MAC and provisioningInterface is not set #530

Open
machacekondra opened this issue Jul 18, 2024 · 4 comments
Labels
needs-triage Indicates an issue lacks a `triage/foo` label and requires one. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@machacekondra
Copy link

machacekondra commented Jul 18, 2024

When metal3-static-ip-set init container is executed on env where there two interface with same MAC address following script:
metal3-static-ip-set init container

interface="$(ip -br link show up | grep -i "$mac" | cut -f 1 -d ' ' | cut -f 1 -d '@')"

fails, as it returns both interfaces delimited by new line and so the init container fails, because later such interface name don't exist. Here is example of failed script execution:

+ '[' -z '' ']'
+ '[' -n 78:ac:44:05:35:fc,78:ac:44:06:61:96,78:ac:44:06:62:62 ']'
+ for mac in ${PROVISIONING_MACS//,/ }
+ ip -br link show up
+ grep -qi 78:ac:44:05:35:fc
++ ip -br link show up
++ grep -i 78:ac:44:05:35:fc
++ cut -f 1 -d ' '
+ PROVISIONING_INTERFACE='eno3
br-ex'
+ break
+ '[' -n 'eno3
br-ex' ']'
++ ip -o addr show dev 'eno3
br-ex' scope global
Device "eno3
br-ex" does not exist.
+ [[ -n '' ]]
+ /usr/sbin/ip address flush dev 'eno3
br-ex' scope global
Device "eno3
br-ex" does not exist.

As you can see it tries to find interface:

eno3
br-ex

Workaround is edit provisioning resource provisioning-configuration with following configuration:

spec:
    ...
    provisioningInterface: eno3
    ...

Is there a way to specify such configuration in openshift install config?

@metal3-io-bot metal3-io-bot added the needs-triage Indicates an issue lacks a `triage/foo` label and requires one. label Jul 18, 2024
@metal3-io-bot
Copy link
Contributor

This issue is currently awaiting triage.
If Metal3.io contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.
The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dtantsur
Copy link
Member

Note: metal3-static-ip-set is specific to OpenShift, but I suspect the bug equally applies to upstream containers.

@Rozzii
Copy link
Member

Rozzii commented Jul 24, 2024

/triage needs-information

@metal3-io-bot metal3-io-bot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Jul 24, 2024
@dtantsur
Copy link
Member

I think you're right that we don't handle a situation where two interfaces have the same MAC. How did you end up in this situation? What the behavior you'd expect? We need to know exactly 1 interface.

P.S.
Please avoid OpenShift-isms like metal3-static-ip-set and provisioning-configuration in upstream bugs. I know what you mean because I work on OpenShift, but some people do not. It could be beneficial for you to file a bug in the Red Hat Jira first, so that we can see how much it affects the upstream Metal3.

iurygregory pushed a commit to iurygregory/ironic-image that referenced this issue Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Indicates an issue lacks a `triage/foo` label and requires one. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

4 participants