Skip to content

Commit 7a8d2d5

Browse files
Akrogjieyu
authored andcommitted
spec: Add efficient volume cloning support
With the new CSI snapshot feature it's now possible to create volumes from a snapshots. This may lead to users abusing it for unintended functionality, such as having a golden image to source new volumes. Most storage backends support efficient volume cloning, so it would be benefitial to expose this functionality in the CSI spec. By supporting cloning we avoid users creating a volume, and then a snapshot of that volume, just so it can be used as the source for new volumes. The VolumeContentSource, that was added by the snapshots feature, will be used for this feature. New VolumeSource message is added to the VolumeContentSource.
1 parent 375e379 commit 7a8d2d5

File tree

3 files changed

+392
-274
lines changed

3 files changed

+392
-274
lines changed

csi.proto

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,16 @@ message VolumeContentSource {
242242
string id = 1;
243243
}
244244

245+
message VolumeSource {
246+
// Contains identity information for the existing source volume.
247+
// This field is REQUIRED. Plugins reporting CLONE_VOLUME
248+
// capability MUST support creating a volume from another volume.
249+
string id = 1;
250+
}
251+
245252
oneof type {
246253
SnapshotSource snapshot = 1;
254+
VolumeSource volume = 2;
247255
}
248256
}
249257

@@ -767,6 +775,11 @@ message ControllerServiceCapability {
767775
// with the snapshot_id as the filter to query whether the
768776
// uploading process is complete or not.
769777
LIST_SNAPSHOTS = 6;
778+
// Plugins supporting volume cloning at the storage level MAY
779+
// report this capability. The source volume must be managed by
780+
// the same plugin. Not all volume sources and parameters
781+
// combinations may work.
782+
CLONE_VOLUME = 7;
770783
}
771784

772785
Type type = 1;

0 commit comments

Comments
 (0)