Skip to content

VMware: match nic mac for ip address fetch #10641

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

Open
wants to merge 3 commits into
base: 4.20
Choose a base branch
from

Conversation

alexandru-bagu
Copy link
Contributor

@alexandru-bagu alexandru-bagu commented Mar 29, 2025

Description

This PR fixes #10640

The main solution for the issue here would be to make sure that we are getting the IP for the correct NIC which we can do based on the MAC of the NIC. Additionally, a null IP is also a valid response because a NIC can have no IP assigned.

It's up for discussion whether we should pull any IP even if it does not match the network subnet because the user can in fact use the NIC with another subnet as well, but that is not necessarily relevant to this issue.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

I am in the process of testing on my dev environment then going to push in prod once I am happy with the results.

How did you try to break this feature and the system with this change?

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

overall looks good

A related pr for l2 network #10431

@weizhouapache
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@@ -788,12 +793,6 @@ protected void runInContext() {
}
}
} else {
//previously vm has ip and nic table has ip address. After vm restart or stop/start
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my opinion, if we cannot know if the VM still has the IP assigned or not then we should not modify the database. In other words, we should be sure that the VM's NIC does not have an IP assigned before updating the database.

@alexandru-bagu
Copy link
Contributor Author

overall looks good

A related pr for l2 network #10431

Interesting. I see your PR has more changes than this PR. Feel free to grab my code for VMware and close this PR.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12924

Copy link

codecov bot commented Mar 29, 2025

Codecov Report

Attention: Patch coverage is 8.69565% with 21 lines in your changes missing coverage. Please review.

Project coverage is 16.30%. Comparing base (2dfe6a6) to head (d3939f0).
Report is 57 commits behind head on main.

Files with missing lines Patch % Lines
...oud/hypervisor/vmware/resource/VmwareResource.java 0.00% 11 Missing ⚠️
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 0.00% 7 Missing ⚠️
...ava/com/cloud/agent/api/GetVmIpAddressCommand.java 40.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10641      +/-   ##
============================================
- Coverage     16.30%   16.30%   -0.01%     
+ Complexity    13448    13446       -2     
============================================
  Files          5674     5674              
  Lines        499203   499216      +13     
  Branches      60369    60373       +4     
============================================
+ Hits          81408    81409       +1     
- Misses       408726   408738      +12     
  Partials       9069     9069              
Flag Coverage Δ
uitests 3.99% <ø> (ø)
unittests 17.16% <8.69%> (-0.01%) ⬇️

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@weizhouapache weizhouapache linked an issue Mar 29, 2025 that may be closed by this pull request
@Pearl1594 Pearl1594 added this to the 4.21.0 milestone Apr 3, 2025
@weizhouapache weizhouapache self-assigned this Apr 10, 2025
@weizhouapache
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@weizhouapache weizhouapache changed the title match nic mac for ip address fetch VMware: match nic mac for ip address fetch Apr 17, 2025
@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13098

@weizhouapache weizhouapache changed the base branch from main to 4.20 April 25, 2025 06:27
@weizhouapache weizhouapache changed the base branch from 4.20 to main April 25, 2025 06:27
@weizhouapache
Copy link
Member

@alexandru-bagu
can you rebase with 4.20 branch so it will be included into 4.20.1.0 release ?

Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@alexandru-bagu alexandru-bagu changed the base branch from main to 4.20 April 25, 2025 09:38
@alexandru-bagu
Copy link
Contributor Author

@alexandru-bagu can you rebase with 4.20 branch so it will be included into 4.20.1.0 release ?

I rebased the changes onto 4.20 and changed merge target branch to 4.20.

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@weizhouapache
Copy link
Member

@alexandru-bagu can you rebase with 4.20 branch so it will be included into 4.20.1.0 release ?

I rebased the changes onto 4.20 and changed merge target branch to 4.20.

great, thanks @alexandru-bagu
I will test it next week

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment