Set snapCPG in online copy request to fix snapshot failures on cloned volumes#12955
Set snapCPG in online copy request to fix snapshot failures on cloned volumes#12955poddm wants to merge 1 commit intoapache:4.22from
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds the missing snapCPG assignment to Primera’s online copy request so cloned volumes have a snapshot CPG configured, preventing snapshot failures after cloning.
Changes:
- Set
snapCPGonPrimeraVolumeCopyRequestParametersin the online copy flow.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| parms.setSnapCPG(snapCpg); | ||
| parms.setTpvv(false); | ||
| parms.setReduce(true); | ||
| logger.debug("PrimeraAdapter: Configuring online copy - destination CPG: '{}', deduplication enabled, thin provisioning disabled", cpg); |
There was a problem hiding this comment.
The debug log message is now misleading/incomplete because the code configures snapCPG (and also reduce) but the log only prints destCPG and omits snapCPG. This makes troubleshooting harder and can contradict operator expectations (the PR description/test output includes snapCPG). Update the log format and arguments to include snapCpg (and optionally reduce) so the message reflects the actual online copy configuration.
| logger.debug("PrimeraAdapter: Configuring online copy - destination CPG: '{}', deduplication enabled, thin provisioning disabled", cpg); | |
| logger.debug("PrimeraAdapter: Configuring online copy - destination CPG: '{}', snapshot CPG: '{}', reduce enabled: {}, thin provisioning enabled: {}", | |
| cpg, snapCpg, true, false); |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12955 +/- ##
============================================
- Coverage 17.60% 17.60% -0.01%
+ Complexity 15677 15676 -1
============================================
Files 5918 5918
Lines 531681 531682 +1
Branches 65005 65005
============================================
- Hits 93623 93612 -11
- Misses 427498 427510 +12
Partials 10560 10560
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:
|
|
@rg9975, could you review? |
|
@blueorangutan package |
|
@sureshanaparti 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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17401 |
Description
The snapCPG parameter was missing from the online copy request parameters (PrimeraVolumeCopyRequestParameters), so the newly cloned volume was created without a snap CPG assignment. This caused subsequent snapshot operations on that volume to fail because Primera didn't know which CPG to allocate snapshot space from.
Fix: Added parms.setSnapCPG(snapCpg) to the online copy configuration in the copy() method, alongside the existing destCPG, tpvv, and reduce parameters.
Note: The direct create() path already set snapCPG correctly via request.setSnapCPG(snapCpg) — the gap was only in the online copy flow.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tested using both HPE Primera and Alletra arrays. Verified that volumes created via online copy now have the correct snapCPG set and that snapshot operations succeed.
How did you try to break this feature and the system with this change?