Skip to content

Commit

Permalink
spec: Add efficient volume cloning support
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Akrog committed Aug 20, 2018
1 parent aeca98c commit f45b2eb
Show file tree
Hide file tree
Showing 3 changed files with 384 additions and 272 deletions.
12 changes: 12 additions & 0 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,16 @@ message VolumeContentSource {
string id = 1;
}

message VolumeSource {
// Contains identity information for the existing source volume.
// This field is REQUIRED. Plugins reporting CLONE_VOLUME
// capability MUST support creating a volume from another volume.
string id = 1;
}

oneof type {
SnapshotSource snapshot = 1;
VolumeSource volume = 2;
}
}

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

Type type = 1;
Expand Down
Loading

0 comments on commit f45b2eb

Please sign in to comment.