Skip to content

Commit 7f3b61d

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 e189075 commit 7f3b61d

File tree

3 files changed

+368
-255
lines changed

3 files changed

+368
-255
lines changed

csi.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,16 @@ message VolumeContentSource {
246246
string id = 1;
247247
}
248248

249+
message VolumeSource {
250+
// Contains identity information for the existing source volume.
251+
// This field is REQUIRED. Plugins reporting CLONE_VOLUME
252+
// capability MUST support creating a volume from another volume.
253+
string id = 1;
254+
}
255+
249256
oneof type {
250257
SnapshotSource snapshot = 1;
258+
VolumeSource volume = 2;
251259
}
252260
}
253261

@@ -747,6 +755,10 @@ message ControllerServiceCapability {
747755
// with the snapshot_id as the filter to query whether the
748756
// uploading process is complete or not.
749757
LIST_SNAPSHOTS = 6;
758+
// Plugins supporting efficient volume cloning MAY report this
759+
// capability. A source volume must be managed by the same plugin.
760+
// Not all volume sources and parameters combinations may work.
761+
CLONE_VOLUME = 7;
750762
}
751763

752764
Type type = 1;

0 commit comments

Comments
 (0)