vm-import: fix stopped managed vms listing in unmanaged instances#7606
Conversation
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Codecov Report
@@ Coverage Diff @@
## 4.18 #7606 +/- ##
============================================
+ Coverage 13.02% 13.06% +0.04%
- Complexity 9032 9109 +77
============================================
Files 2720 2720
Lines 257080 257535 +455
Branches 40088 40153 +65
============================================
+ Hits 33476 33654 +178
- Misses 219400 219654 +254
- Partials 4204 4227 +23
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
haven´t looked at the code thouroughly but looks good so far. I wonder about the functionality though @shwstppr ; as a user I would want to be able to import stopped VMs as well. Is this harmful/impossible and is this why you want to prevent the listing? |
|
@DaanHoogland maybe the title and description wasn't that clear. This PR is trying to fix an issue where stopped managed VMs are getting listed as unmanaged instances |
ok, tnx |
|
@blueorangutan package |
|
@shwstppr a [SF] 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6329 |
|
@blueorangutan test rocky8 vmware-67u3 |
| UnmanagedInstanceTO unmanagedInstance = unmanagedInstances.get(name); | ||
| if (unmanagedInstance == null) { | ||
| throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Unable to retrieve details for unmanaged VM: %s", name)); | ||
| if (!instanceName.equals(name)) { |
There was a problem hiding this comment.
we can extract the larger part of this block, from the continue here and the break just before the end of the loop.
|
@shwstppr - is this ready for review? |
|
@rohityadavcloud a [SF] 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6709 |
|
@rohityadavcloud yes, marked it as ready for review |
|
@blueorangutan test |
|
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7355)
|
|
tested manually @shwstppr , there was one circumstance in which a VM was visible both as managed as well as unmanaged: |
|
@DaanHoogland thanks for the testing. Will have to check. Weird that an unmanaged VM is showing in the managed list |
|
@blueorangutan test rocky8 vmware-70u3 keepEnv |
|
@DaanHoogland a [SF] Trillian-Jenkins test job (rocky8 mgmt + vmware-70u3) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7525)
|
|
@shwstppr still a little snag (I don't know if you already gave that attention) |
|
@shwstppr , is it at all possible to fix the issue I found with this? Should we close and revisit at a later time? |
|
@DaanHoogland will investigate this week and update |
|
@blueorangutan package |
|
@shwstppr a [SF] 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7294 |
|
@DaanHoogland issue should be fixed now post-7606-fix.mp4@blueorangutan package |
|
@shwstppr a [SF] 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7300 |
|
great @shwstppr , the issue is gone indeed. |
|
@blueorangutan test rocky8 vmware-67u3 |
|
@DaanHoogland a [SF] Trillian-Jenkins test job (rocky8 mgmt + vmware-67u3) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7906)
|
|
@blueorangutan test alma8 vmware-70u3 |
|
@DaanHoogland a [SF] Trillian-Jenkins test job (alma8 mgmt + vmware-70u3) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7915)
|



Description
When listing unmanaged instances for a cluster with multiple hosts, stopped manager VMs are getting listed as well. This PR fixes this behaviour and adds some code refactoring
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?