-
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
Fix listing of VMs with removed NICs #10204
Fix listing of VMs with removed NICs #10204
Conversation
@blueorangutan package |
@bernardodemarco 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 #10204 +/- ##
============================================
- Coverage 15.13% 15.13% -0.01%
Complexity 11274 11274
============================================
Files 5408 5408
Lines 473974 473975 +1
Branches 57813 57813
============================================
Hits 71730 71730
- Misses 394227 394228 +1
Partials 8017 8017
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 12114 |
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
@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-12131)
|
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
monkey tested in a lab env, all good |
* 4.20: linstor: Fix ZFS snapshot backup (#10219) fix listing of VMs by network (#10204) Configure org.eclipse.jetty.server.Request.maxFormKeys from server.properties and increase the default value (#10214) api: fix access for listSystemVmUsageHistory (#10032) Fix NPE issues during host rolling maintenance, due to host tags and custom constrained/unconstrained service offering (#9844)
Description
Currently, when listing VMs by network (
networkid
) or VPC (vpcid
), CloudStack does not check whether the VMs still belong to the specified network or VPC. Therefore, this PR fixes this issue by only filtering the VMs that have non-removed NICs in the specified network or VPC.Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
First, I created an isolated network (
nw-01
) and a VPC (vpc-01
) with two tiers (tier-01
andtier-02
). Next, I deployed a VM (vm-01
) with one NIC in each one of these networks.After that, I checked that the
listVirtualMachines
API had the same behavior as prior to the PR changes:List VMs that belong to the
nw-01
networkList VMs that belong to the
tier-01
networkList VMs that belong to the
tier-02
networkList VMs that belong to the
vpc-01
VPCList VMs that belong to the
vpc-01
VPC andtier-01
tierList VMs that belong to the
vpc-01
VPC andtier-02
tierNext, I removed the NIC associated to the
nw-01
network from the VM. When listing the VMs by that network, I verified that no VMs were returned:List VMs that belong to the
nw-01
networkThen, I removed the NIC associated to the
tier-02
tier. When listing the VMs by that network, I verified that no VMs were returned:List VMs that belong to the
tier-02
networkI also verified that when listing the VMs by the
tier-02
tier and thevpc-01
VPC, no VMs were returned:List VMs that belong to the
vpc-01
VPC andtier-02
tierFurthermore, when only listing by VPC, the VM was returned since it still had a NIC associated to the
tier-01
network:List VMs that belong to the
vpc-01
VPCNext, in order to be able to remove the
tier-01
NIC, I added a NIC corresponding to a Layer 2 network, and set it to be the default VM's NIC. After removing thetier-01
NIC, I verified that no VMs were returned when listing by thetier-01
network:List VMs that belong to the
tier-01
networkNo VMs were returned when listing by the
vpc-01
VPC andtier-01
network:List VMs that belong to the
vpc-01
VPC andtier-01
tierNo VMs were returned when listing by the
vpc-01
VPC:List VMs that belong to the
vpc-01
VPCFixes #10188