Fix list StorPool primary storage#13119
Conversation
Fixes listing of StorPool primary storage when using listStoragePools API
|
@blueorangutan package |
|
@winterhazel 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. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13119 +/- ##
==========================================
Coverage 18.08% 18.09%
- Complexity 16706 16719 +13
==========================================
Files 6037 6037
Lines 542437 542587 +150
Branches 66420 66435 +15
==========================================
+ Hits 98088 98155 +67
- Misses 433333 433413 +80
- Partials 11016 11019 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17757 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes StorPool primary storage listing in listStoragePools by removing the template-name prefix from storage_pool.uuid and passing the template name through pool details instead.
Changes:
- Stop prefixing StorPool primary storage UUIDs with
templateName;and generate plain UUIDs instead. - Pass StorPool template name via storage pool details down to the KVM agent path (instead of parsing it from the UUID).
- Add an upgrade migration to normalize existing StorPool pool UUIDs that still have the legacy
templateName;uuidformat.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/util/StorPoolUtil.java | Stop writing template-prefixed UUIDs when updating pool metadata. |
| plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/provider/StorPoolHostListener.java | Include SP_TEMPLATE in details sent to agent modify-storage command. |
| plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/StorPoolPrimaryDataStoreLifeCycle.java | Initialize StorPool primary storage with plain UUID. |
| plugins/storage/volume/storpool/src/main/java/com/cloud/hypervisor/kvm/storage/StorPoolStoragePool.java | Read StorPool template name from details and store it on the pool object. |
| plugins/storage/volume/storpool/src/main/java/com/cloud/hypervisor/kvm/storage/StorPoolStorageAdaptor.java | Use the stored template name instead of parsing it from the UUID. |
| plugins/storage/volume/storpool/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/StorPoolModifyStorageCommandWrapper.java | Forward command “details” into storage pool creation path. |
| plugins/storage/volume/storpool/src/main/java/com/cloud/agent/api/storage/StorPoolModifyStoragePoolCommand.java | Extend command ctor to accept details and pass them to base command. |
| engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42210to42300.java | Add data migration to normalize legacy StorPool UUIDs to plain UUIDs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| _sourcePort = port; | ||
| _storagePoolType = storagePoolType; | ||
| _storageAdaptor = storageAdaptor; | ||
| _authUsername = details.get(StorPoolUtil.SP_TEMPLATE); |
| srcFile = new QemuImgFile(srcTemplateFilePath, srcFileFormat); | ||
|
|
||
| String spTemplate = destPool.getUuid().split(";")[0]; | ||
| String spTemplate = destPool.getAuthUserName(); |
| final String[] parts = templatePrefixedPoolUuid.split(";"); | ||
| if (parts.length < 2) { | ||
| continue; | ||
| } | ||
| final String realUuid = parts[1].trim(); |
| public void performDataMigration(Connection conn) { | ||
| unhideJsInterpretationEnabled(conn); | ||
| normalizeStorPoolPrimaryStorageUuids(); | ||
| } |
Description
This PR fixes the StorPool primary storage listing in the listStoragePools API, addressing an issue introduced in PR #12502
StorPool was using as a prefix in the UUID the StorPool's template to which is attached the primary storage. Now we're getting this information from the storage details
Types of changes
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Upgrade from CS 4.20.3.0 to main with StorPool primary storage