-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Filter list VMs by IP address #9547
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #9547 +/- ##
============================================
+ Coverage 15.08% 15.24% +0.15%
- Complexity 11184 11572 +388
============================================
Files 5406 5406
Lines 472889 489497 +16608
Branches 57738 66537 +8799
============================================
+ Hits 71352 74641 +3289
- Misses 393593 406562 +12969
- Partials 7944 8294 +350
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@blueorangutan package |
@Pearl1594 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10699 |
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
@vishesh92 @Pearl1594 is this ready or does it need more work? |
@DaanHoogland It works in the current state, but I wasn't able to address @vishesh92's comment, and am awaiting his response on it. |
Every search with keyword param will become too expensive. We will be doing a join of |
@blueorangutan package |
@Pearl1594 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11240 |
@blueorangutan test keepEnv |
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-11591)
|
@vishesh92 could you please help review the changes made to address the discussed issue in the searchBuilder. Thanks! |
framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
Outdated
Show resolved
Hide resolved
Changes look good and it's working as expected. Just one case required to handle to prevent issues in future. SQL query before SELECT
DISTINCT(user_vm.id)
FROM
user_vm
INNER JOIN vm_instance ON user_vm.id = vm_instance.id
INNER JOIN account accountSearch ON vm_instance.account_id = accountSearch.id
INNER JOIN vm_template vmTemplate ON vm_instance.vm_template_id = vmTemplate.id
WHERE
vm_instance.type = 'User'
AND vm_instance.display_vm = ?
AND (
user_vm.display_name LIKE ?
OR vm_instance.name LIKE ?
OR vm_instance.state = ?
OR vm_instance.instance_name LIKE ?
)
AND vm_instance.removed IS NULL
AND (accountSearch.type != ?)
AND (vmTemplate.type != ?)
ORDER BY
vm_instance.id ASC
LIMIT
0, 20 after: SELECT
DISTINCT(user_vm.id)
FROM
user_vm
INNER JOIN vm_instance ON user_vm.id = vm_instance.id
LEFT JOIN user_ip_address ipAddressSearch ON user_vm.id = ipAddressSearch.vm_id
INNER JOIN vm_template vmTemplate ON vm_instance.vm_template_id = vmTemplate.id
LEFT JOIN nics nicSearch ON user_vm.id = nicSearch.instance_id
AND nicSearch.removed IS NULL
INNER JOIN account accountSearch ON vm_instance.account_id = accountSearch.id
WHERE
vm_instance.type = 'User'
AND vm_instance.display_vm = ?
AND (
user_vm.display_name LIKE ?
OR vm_instance.name LIKE ?
OR vm_instance.state = ?
OR vm_instance.instance_name LIKE ?
OR ipAddressSearch.public_ip_address LIKE ?
OR nicSearch.ip4_address LIKE ?
OR nicSearch.ip4_address LIKE ?
)
AND vm_instance.removed IS NULL
AND (vmTemplate.type != ?)
AND (accountSearch.type != ?)
ORDER BY
vm_instance.id ASC
LIMIT
0, 20 |
framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
Outdated
Show resolved
Hide resolved
framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
Outdated
Show resolved
Hide resolved
@blueorangutan package |
@vishesh92 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11298 |
@blueorangutan test |
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-11629)
|
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. Tested locally with simulator and it's working as expected.
Description
This PR fixes: #9486
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
List VMs without any filter:
Listing VMs with a specific IP:
Listing VMs with a part of an IP used as filter:
Listing VMs with an IP that doesn't match:
How did you try to break this feature and the system with this change?