-
Notifications
You must be signed in to change notification settings - Fork 1.2k
add use of virsh domifaddr to get VM external DHCP IP #10376
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 use of virsh domifaddr to get VM external DHCP IP #10376
Conversation
|
@blueorangutan package |
|
@rohityadavcloud 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #10376 +/- ##
=========================================
Coverage 15.15% 15.16%
- Complexity 11314 11325 +11
=========================================
Files 5413 5413
Lines 474670 474762 +92
Branches 57890 57900 +10
=========================================
+ Hits 71943 71997 +54
- Misses 394680 394716 +36
- Partials 8047 8049 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12436 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-12390)
|
Pearl1594
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one logic question.
in general I'd like to see the execute method split out further for better readability
...main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmIpAddressCommandWrapper.java
Outdated
Show resolved
Hide resolved
...main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmIpAddressCommandWrapper.java
Outdated
Show resolved
Hide resolved
…s; added test cases to cover 90%+ scenarios
|
@blueorangutan package |
|
@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. |
.../java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmIpAddressCommandWrapperTest.java
Outdated
Show resolved
Hide resolved
…s; added test cases to cover 90%+ scenarios
…s; added test cases to cover 90%+ scenarios
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12582 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
This does work in my testing on ubuntu 24. |
|
[SF] Trillian test result (tid-12503)
|
|
Sorry missed your comment @weizhouapache if there are further changes you could review if this needs to be reverted or you want to raise a new PR? |
@rohityadavcloud btw, actually I missed a word in my previous comment. 🤦♂️ This does NOT work in my testing on ubuntu 24. |
What exactly is the problem you are seeing? you mean Ubuntu on the hypervisor or on the guest OS? |
@rg9975 |
| static String virt_cat_path = null; | ||
| static String tail_path = null; | ||
|
|
||
| static void init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thanks @rg9975 and @weizhouapache - I'm watching this closely and will be testing. Very interested in the feature for both shared and especially L2 networks. |
* add use of virsh domifaddr to get VM external DHCP IP * updates to modularize LibvirtGetVmIpAddressCommandWrapper per comments; added test cases to cover 90%+ scenarios * updates to modularize LibvirtGetVmIpAddressCommandWrapper per comments; added test cases to cover 90%+ scenarios * updates to modularize LibvirtGetVmIpAddressCommandWrapper per comments; added test cases to cover 90%+ scenarios
Description
Adds use of virsh domifaddr command as first choice for finding the external DHCP address of a newly provisioned VM. This command returns address information about all the interfaces when the Qemu OS guest agent is installed within the VM. When this command fails to find the IP, falls back to original behavior of looking at OS disk lease files to find the data.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tested locally with VM running Qemu guest agent.
How did you try to break this feature and the system with this change?
Tested with VM having guest agent and not having agent for expected behaviors.