Repository navigation
Infer single conversion storage pool for VMware import - #13235
andrijapanicsb wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13235 +/- ##
=========================================
Coverage 20.77% 20.78%
- Complexity 20855 20872 +17
=========================================
Files 6053 6053
Lines 548230 548272 +42
Branches 73237 73244 +7
=========================================
+ Hits 113903 113956 +53
+ Misses 420988 420969 -19
- Partials 13339 13347 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@andrijapanicsb a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 18022 |
There was a problem hiding this comment.
Pull request overview
This PR improves the VMware→KVM import flow when forceconverttopool=true and no explicit convertinstancepoolid is provided, by inferring a single eligible primary storage pool when exactly one candidate exists. It also updates the UI to auto-select the only returned pool and to drive users into the primary-storage selection path when forced conversion is enabled.
Changes:
- Server: infer an implicit conversion storage pool ID when forced conversion is enabled and exactly one eligible pool exists (cluster/zone scope).
- Server: add unit tests covering implicit pool resolution behavior.
- UI: centralize conversion-pool selection sync and auto-select the single available pool; auto-open primary storage selection for forced conversion/VDDK.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ui/src/views/tools/ImportUnmanagedInstance.vue | Adds centralized pool-selection sync and auto-selection behavior; forces primary pool selection path when forceconverttopool / VDDK is enabled. |
| server/src/test/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImplTest.java | Adds tests for implicit conversion storage pool resolution behavior. |
| server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java | Adds logic to resolve an implicit conversion storage pool ID before validating the pool for forced conversion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| List<StoragePoolVO> candidatePools = getImplicitForceConvertToPoolStoragePools(destinationCluster); | ||
| if (candidatePools.isEmpty()) { | ||
| logFailureAndThrowException(String.format("The parameter forceconverttopool is set to true, but no suitable primary storage pool was found in cluster %s", | ||
| destinationCluster.getName())); | ||
| } | ||
| if (candidatePools.size() > 1) { | ||
| logFailureAndThrowException(String.format("The parameter forceconverttopool is set to true, but multiple suitable primary storage pools were found in cluster %s. Please provide convertinstancepoolid.", | ||
| destinationCluster.getName())); |
| selectPrimaryStorageForForcedConversion () { | ||
| this.selectedStorageOptionForConversion = 'primary' | ||
| this.showStoragePoolsForConversion = true | ||
| this.fetchStoragePoolsForConversion() |
|
@blueorangutan package |
|
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19138 |
abh1sar
left a comment
There was a problem hiding this comment.
LGTM. reviewed and tested.
Testing:
Selected forceconverttopool option but didn't select a specific pool.
TC1
Eligible pools: 2
Result: Failed as expected - "The parameter forceconverttopool is set to true, but
multiple suitable primary storage pools were found in cluster p1-c1. Please provide
convertinstancepoolid."
TC2
Eligible pools: 1
Result: VM imported successfully auto selecting the one eligible storage pool.
TC3
Eligible pools: 0
Result: Failed as expected - "...but no suitable primary storage pool was found in cluster p1-c1"
|
@blueorangutan test |
|
@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
@blueorangutan test |
|
@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-16975) |
|
@blueorangutan package |
|
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19234 |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
Hi @andrijapanicsb can you please address the conflicts? |
Resolve an omitted conversion pool before detecting direct RBD/Linstor imports, preserving the updated VDDK and disk-offering validation calls. Use mode-specific pool types for inference so VDDK considers RBD and Linstor alongside filesystem pools. Preserve explicit pool selection, staged conversion, and ambiguity errors. Add focused inference and import-path regression coverage.
|
@ACSHomeBot package G |
|
Accepted: Planned: RPM + DEB, KVM SystemVM. Status: Completed. Packaging results. |
Packaging results:
Test packages are available at: |
Description
This improves the VMware import workflow when
forceconverttopool=trueand the caller does not provideconvertinstancepoolid.Previously, the API always failed in that case, even when the destination environment had exactly one suitable primary storage pool. With this change, CloudStack infers that single suitable pool and proceeds. If no suitable pool exists, or if multiple suitable pools exist, the API still fails with a clear message so the caller can provide
convertinstancepoolidexplicitly.No API parameters are added or removed.
API behavior
When
forceconverttopool=true:convertinstancepoolidis supplied, the selected pool is used and validated as before.convertinstancepoolidis omitted and exactly one suitable KVM primary storage pool exists for the destination cluster or zone, that pool is used automatically.convertinstancepoolid.UI behavior
Testing
mvn -pl server -am -Dtest=UnmanagedVMsManagerImplTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false test