Skip to content

Commit 65e1843

Browse files
committed
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 86aa4ce commit 65e1843

File tree

3 files changed

+396
-278
lines changed

3 files changed

+396
-278
lines changed

csi.proto

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,16 @@ message VolumeContentSource {
253253
string id = 1;
254254
}
255255

256+
message VolumeSource {
257+
// Contains identity information for the existing source volume.
258+
// This field is REQUIRED. Plugins reporting CLONE_VOLUME
259+
// capability MUST support creating a volume from another volume.
260+
string id = 1;
261+
}
262+
256263
oneof type {
257264
SnapshotSource snapshot = 1;
265+
VolumeSource volume = 2;
258266
}
259267
}
260268

@@ -778,6 +786,11 @@ message ControllerServiceCapability {
778786
// with the snapshot_id as the filter to query whether the
779787
// uploading process is complete or not.
780788
LIST_SNAPSHOTS = 6;
789+
// Plugins supporting volume cloning at the storage level MAY
790+
// report this capability. The source volume must be managed by
791+
// the same plugin. Not all volume sources and parameters
792+
// combinations may work.
793+
CLONE_VOLUME = 7;
781794
}
782795

783796
Type type = 1;

0 commit comments

Comments
 (0)