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

MTV-2025 | NICs mapping is unordered #1437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hazanel
Copy link
Contributor

@Hazanel Hazanel commented Mar 12, 2025

Issue:
When migrating VMs with multiple NICs the mapping order must match source VM order

Fix:
Since rhel 6 swapping/renaming devices isn't supported anymore due to kernel issues.
Since we can't prevent that we will add a validation to the NICs mapping to make sure the order is correct,
if not we'll issue a warning during migration plan's creation so the user will be aware and could
work this around by creating the network map in the same order as source VM.

Copy link
Member

@mnecas mnecas left a comment

Choose a reason for hiding this comment

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

Please add PR information.

@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

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

Project coverage is 15.08%. Comparing base (f1fe5d0) to head (0ad69f1).
Report is 49 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/plan/adapter/vsphere/validator.go 0.00% 37 Missing ⚠️
pkg/controller/plan/validation.go 0.00% 33 Missing ⚠️
pkg/controller/provider/container/vsphere/model.go 0.00% 4 Missing ⚠️
pkg/controller/plan/adapter/openstack/validator.go 0.00% 2 Missing ⚠️
pkg/controller/plan/adapter/ova/validator.go 0.00% 2 Missing ⚠️
pkg/controller/plan/adapter/ovirt/validator.go 0.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1437      +/-   ##
==========================================
- Coverage   15.45%   15.08%   -0.37%     
==========================================
  Files         112      113       +1     
  Lines       23377    24385    +1008     
==========================================
+ Hits         3613     3679      +66     
- Misses      19479    20421     +942     
  Partials      285      285              
Flag Coverage Δ
unittests 15.08% <0.00%> (-0.37%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Hazanel Hazanel force-pushed the nicsOrder branch 5 times, most recently from d26f0f7 to 3c8e521 Compare March 13, 2025 13:47
Copy link
Member

@mnecas mnecas left a comment

Choose a reason for hiding this comment

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

Please add PR description

Status: True,
Reason: NotValid,
Category: Warn,
Message: "VM network mapping is unordered.",
Copy link
Member

Choose a reason for hiding this comment

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

VM network mapping is unordered, this can cause the interface names to be different after migration.

if len(correctOrder) == 0 {
unEvenNicsToNetwork.Items = append(unEvenNicsToNetwork.Items, ref.String())
} else {
unorderedNics.Message = fmt.Sprintf("%s\n Expected order: %s", unorderedNics.Message, strings.Join(correctOrder, ", "))
Copy link
Member

Choose a reason for hiding this comment

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

If there will be 2+ VMs in the plan this will cause all of the VMs to have the same message.
I'm facing similar issue like this in #1436. I'll discuss this problem with another maintainer you don't need to do any changes but we will need to wait before merging this PR.

Copy link
Member

Choose a reason for hiding this comment

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

Think we should add if len(plan.Spec.VMs) == 1 to this whole new section

Issue:
When migrating VMs with multiple NICs the mapping  order must match source VM order

Fix:
Since rhel 6 swapping/renaming devices isn't supported anymore due to kernel issues.
Since we can't prevent that we will add a validation to the NICs mapping to make sure the order is correct,
if not we'll issue a warning during migration plan's creation so the user will be aware and could
work this around by creating the network map in the same order as source VM.

Ref: https://issues.redhat.com/browse/MTV-2025
Signed-off-by: ehazan <[email protected]>
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