Skip to content

Set snapCPG in online copy request to fix snapshot failures on cloned volumes#12955

Open
poddm wants to merge 1 commit intoapache:4.22from
poddm:mp/4.22_fix_snapcpg
Open

Set snapCPG in online copy request to fix snapshot failures on cloned volumes#12955
poddm wants to merge 1 commit intoapache:4.22from
poddm:mp/4.22_fix_snapcpg

Conversation

@poddm
Copy link
Copy Markdown

@poddm poddm commented Apr 2, 2026

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

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

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.

2026-04-02 16:01:44,866 DEBUG [o.a.c.s.d.a.p.PrimeraAdapter] (Work-Job-Executor-1:[ctx-846f217c, job-10462/job-10463, ctx-c0684397]) (logid:c8c0c67d) PrimeraAdapter: Starting volume copy operation - source volume: 'tpl-17-0-18-315', target volume: 'ROOT-882', requested new size: 21474836480 bytes (20480 MiB)
2026-04-02 16:01:44,868 DEBUG [o.a.c.s.d.a.p.PrimeraAdapter] (Work-Job-Executor-1:[ctx-846f217c, job-10462/job-10463, ctx-c0684397]) (logid:c8c0c67d) PrimeraAdapter: Generated external name 'vol-17-1-29-1139' for target volume
2026-04-02 16:01:44,885 DEBUG [o.a.c.s.d.a.p.PrimeraAdapter] (Work-Job-Executor-1:[ctx-846f217c, job-10462/job-10463, ctx-c0684397]) (logid:c8c0c67d) PrimeraAdapter: No size change required (both 21474836480 bytes) - using online copy method for faster cloning
2026-04-02 16:01:44,891 DEBUG [o.a.c.s.d.a.p.PrimeraAdapter] (Work-Job-Executor-1:[ctx-846f217c, job-10462/job-10463, ctx-c0684397]) (logid:c8c0c67d) PrimeraAdapter: Online copy mode - target volume 'ROOT-882' will be created automatically during clone operation
2026-04-02 16:01:44,891 DEBUG [o.a.c.s.d.a.p.PrimeraAdapter] (Work-Job-Executor-1:[ctx-846f217c, job-10462/job-10463, ctx-c0684397]) (logid:c8c0c67d) PrimeraAdapter: Configuring online copy - destination CPG: 'mycpg', snapCPG: 'mycpg', deduplication enabled, thin provisioning disabled
 

How did you try to break this feature and the system with this change?

@boring-cyborg
Copy link
Copy Markdown

boring-cyborg bot commented Apr 2, 2026

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)
Here are some useful points:

@poddm poddm changed the title set snapcpg config on copy Set snapCPG in online copy request to fix snapshot failures on cloned volumes Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant