Skip to content

Commit f26ef70

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 df56d67 commit f26ef70

File tree

3 files changed

+358
-242
lines changed

3 files changed

+358
-242
lines changed

csi.proto

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,16 @@ message VolumeContentSource {
225225
string id = 1;
226226
}
227227

228+
message VolumeSource {
229+
// Contains identity information for the existing source volume.
230+
// This field is REQUIRED. Plugins reporting CLONE_VOLUME
231+
// capability MUST support creating a volume from another volume.
232+
string id = 1;
233+
}
234+
228235
oneof type {
229236
SnapshotSource snapshot = 1;
237+
VolumeSource volume = 2;
230238
}
231239
}
232240

@@ -522,6 +530,11 @@ message ControllerServiceCapability {
522530
// with the snapshot_id as the filter to query whether the
523531
// uploading process is complete or not.
524532
LIST_SNAPSHOTS = 6;
533+
// Plugins supporting efficient volume cloning MAY report this
534+
// capability. Source volume must be managed by the same plugin.
535+
// Not all volume sources and parameters combinations MAY work.
536+
// CLONE_VOLUME is NOT REQUIRED.
537+
CLONE_VOLUME = 7;
525538
}
526539

527540
Type type = 1;

0 commit comments

Comments
 (0)