feat(clone): add cloneFullCopy parameter for snapshot-based volume cloning#416
Draft
kvaps wants to merge 1 commit intopiraeusdatastore:masterfrom
Draft
feat(clone): add cloneFullCopy parameter for snapshot-based volume cloning#416kvaps wants to merge 1 commit intopiraeusdatastore:masterfrom
kvaps wants to merge 1 commit intopiraeusdatastore:masterfrom
Conversation
…sed cloning
Add a new StorageClass parameter `cloneFullCopy` that changes the Clone()
behavior to use snapshot + restore instead of LINSTOR's built-in rd clone.
When enabled, CSI Clone creates a temporary LINSTOR snapshot from the source
volume, restores it via VolFromSnap (which uses autoplace for placement),
and then migrates the data away from source nodes using Autoplace with
NotPlaceWithRsc. This produces a fully independent copy on different nodes
rather than a thin COW snapshot pinned to the source nodes.
This is useful when:
- Cloning golden images (e.g. VM disk templates) where 100+ clones from
the same source would exhaust the thin pool on source nodes
- Users want clone data distributed across the cluster rather than
co-located with the source
The migration is best-effort: if no alternative nodes are available
(e.g. replicas=3 on a 3-node cluster), the clone remains co-located
with the source but is still a full independent copy.
Usage:
parameters:
linstor.csi.linbit.com/cloneFullCopy: "true"
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
linstor.csi.linbit.com/cloneFullCopythat changes Clone() to use snapshot + restore instead of LINSTOR rd clone
different nodes from the source, avoiding thin pool exhaustion on source nodes
co-located but remains a full independent copy
Motivation
LINSTOR's built-in
rd clonecreates thin COW snapshots pinned to the samenodes as the source volume. This works well for occasional clones, but becomes
problematic when cloning golden images (e.g. VM disk templates) at scale — all
clones accumulate on the source nodes, eventually exhausting the thin pool.
With
cloneFullCopy: "true", the CSI driver instead:This produces fully independent volumes distributed across the cluster.
Usage
Test plan
cloneFullCopy: "true"— verify clone lands on different nodescloneFullCopy: "true"on a fully saturated cluster (replicas = node count)— verify graceful fallback (clone co-located but functional)