Skip to content

Commit

Permalink
Add new GroupControllerService and VolumeGroupSnapshot CSI RPCs (#519)
Browse files Browse the repository at this point in the history
* Add VolumeGroupSnapshot CSI RPCs
  • Loading branch information
xing-yang committed Feb 21, 2023
1 parent bd1cb65 commit 47a0fa4
Show file tree
Hide file tree
Showing 3 changed files with 1,781 additions and 320 deletions.
214 changes: 214 additions & 0 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,30 @@ service Controller {
}
}

service GroupController {
option (alpha_service) = true;

rpc GroupControllerGetCapabilities (
GroupControllerGetCapabilitiesRequest)
returns (GroupControllerGetCapabilitiesResponse) {}

rpc CreateVolumeGroupSnapshot(CreateVolumeGroupSnapshotRequest)
returns (CreateVolumeGroupSnapshotResponse) {
option (alpha_method) = true;
}

rpc DeleteVolumeGroupSnapshot(DeleteVolumeGroupSnapshotRequest)
returns (DeleteVolumeGroupSnapshotResponse) {
option (alpha_method) = true;
}

rpc GetVolumeGroupSnapshot(
GetVolumeGroupSnapshotRequest)
returns (GetVolumeGroupSnapshotResponse) {
option (alpha_method) = true;
}
}

service Node {
rpc NodeStageVolume (NodeStageVolumeRequest)
returns (NodeStageVolumeResponse) {}
Expand Down Expand Up @@ -181,6 +205,15 @@ message PluginCapability {
// returned by NodeGetInfo to ensure that a given volume is
// accessible from a given node when scheduling workloads.
VOLUME_ACCESSIBILITY_CONSTRAINTS = 2;

// GROUP_CONTROLLER_SERVICE indicates that the Plugin provides
// RPCs for operating on groups of volumes. Plugins MAY provide
// this capability.
// The presence of this capability determines whether the CO will
// attempt to invoke the REQUIRED GroupController service RPCs, as
// well as specific RPCs as indicated by
// GroupControllerGetCapabilities.
GROUP_CONTROLLER_SERVICE = 3;
}
Type type = 1;
}
Expand Down Expand Up @@ -1163,6 +1196,21 @@ message Snapshot {
// `volume_content_source` in a `CreateVolumeRequest`. The default
// value is false. This field is REQUIRED.
bool ready_to_use = 5;

// The ID of the volume group snapshot that this snapshot is part of.
// It uniquely identifies the group snapshot on the storage system.
// This field is OPTIONAL.
// If this snapshot is a member of a volume group snapshot, and it
// MUST NOT be deleted as a stand alone snapshot, then the SP
// MUST provide the ID of the volume group snapshot in this field.
// If provided, CO MUST use this field in subsequent volume group
// snapshot operations to indicate that this snapshot is part of the
// specified group snapshot.
// If not provided, CO SHALL treat the snapshot as independent,
// and SP SHALL allow it to be deleted separately.
// If this message is inside a VolumeGroupSnapshot message, the value
// MUST be the same as the group_snapshot_id in that message.
string group_snapshot_id = 6 [(alpha_field) = true];
}
message DeleteSnapshotRequest {
// The ID of the snapshot to be deleted.
Expand Down Expand Up @@ -1634,3 +1682,169 @@ message NodeExpandVolumeResponse {
// The capacity of the volume in bytes. This field is OPTIONAL.
int64 capacity_bytes = 1;
}
message GroupControllerGetCapabilitiesRequest {
// Intentionally empty.
}

message GroupControllerGetCapabilitiesResponse {
// All the capabilities that the group controller service supports.
// This field is OPTIONAL.
repeated GroupControllerServiceCapability capabilities = 1;
}

// Specifies a capability of the group controller service.
message GroupControllerServiceCapability {
message RPC {
enum Type {
UNKNOWN = 0;

// Indicates that the group controller plugin supports
// creating, deleting, and getting details of a volume
// group snapshot.
CREATE_DELETE_GET_VOLUME_GROUP_SNAPSHOT = 1
[(alpha_enum_value) = true];
}

Type type = 1;
}

oneof type {
// RPC that the controller supports.
RPC rpc = 1;
}
}
message CreateVolumeGroupSnapshotRequest {
option (alpha_message) = true;

// The suggested name for the group snapshot. This field is REQUIRED
// for idempotency.
// Any Unicode string that conforms to the length limit is allowed
// except those containing the following banned characters:
// U+0000-U+0008, U+000B, U+000C, U+000E-U+001F, U+007F-U+009F.
// (These are control characters other than commonly used whitespace.)
string name = 1;

// volume IDs of the source volumes to be snapshotted together.
// This field is REQUIRED.
repeated string source_volume_ids = 2;

// Secrets required by plugin to complete
// ControllerCreateVolumeGroupSnapshot request.
// This field is OPTIONAL. Refer to the `Secrets Requirements`
// section on how to use this field.
// The secrets provided in this field SHOULD be the same for
// all group snapshot operations on the same group snapshot.
map<string, string> secrets = 3 [(csi_secret) = true];

// Plugin specific parameters passed in as opaque key-value pairs.
// This field is OPTIONAL. The Plugin is responsible for parsing and
// validating these parameters. COs will treat these as opaque.
map<string, string> parameters = 4;
}

message CreateVolumeGroupSnapshotResponse {
option (alpha_message) = true;

// Contains all attributes of the newly created group snapshot.
// This field is REQUIRED.
VolumeGroupSnapshot group_snapshot = 1;
}

message VolumeGroupSnapshot {
option (alpha_message) = true;

// The identifier for this group snapshot, generated by the plugin.
// This field MUST contain enough information to uniquely identify
// this specific snapshot vs all other group snapshots supported by
// this plugin.
// This field SHALL be used by the CO in subsequent calls to refer to
// this group snapshot.
// The SP is NOT responsible for global uniqueness of
// group_snapshot_id across multiple SPs.
// This field is REQUIRED.
string group_snapshot_id = 1;

// A list of snapshots belonging to this group.
// This field is REQUIRED.
repeated Snapshot snapshots = 2;

// Timestamp of when the volume group snapshot was taken.
// This field is REQUIRED.
.google.protobuf.Timestamp creation_time = 3;

// Indicates if all individual snapshots in the group snapshot
// are ready to use as a `volume_content_source` in a
// `CreateVolumeRequest`. The default value is false.
// If any snapshot in the list of snapshots in this message have
// ready_to_use set to false, the SP MUST set this field to false.
// If all of the snapshots in the list of snapshots in this message
// have ready_to_use set to true, the SP SHOULD set this field to
// true.
// This field is REQUIRED.
bool ready_to_use = 4;
}
message DeleteVolumeGroupSnapshotRequest {
option (alpha_message) = true;

// The ID of the group snapshot to be deleted.
// This field is REQUIRED.
string group_snapshot_id = 1;

// A list of snapshot IDs that are part of this group snapshot.
// If SP does not need to rely on this field to delete the snapshots
// in the group, it SHOULD check this field and report an error
// if it has the ability to detect a mismatch.
// Some SPs require this list to delete the snapshots in the group.
// If SP needs to use this field to delete the snapshots in the
// group, it MUST report an error if it has the ability to detect
// a mismatch.
// This field is REQUIRED.
repeated string snapshot_ids = 2;

// Secrets required by plugin to complete group snapshot deletion
// request.
// This field is OPTIONAL. Refer to the `Secrets Requirements`
// section on how to use this field.
// The secrets provided in this field SHOULD be the same for
// all group snapshot operations on the same group snapshot.
map<string, string> secrets = 3 [(csi_secret) = true];
}

message DeleteVolumeGroupSnapshotResponse {
// Intentionally empty.
option (alpha_message) = true;
}
message GetVolumeGroupSnapshotRequest {
option (alpha_message) = true;

// The ID of the group snapshot to fetch current group snapshot
// information for.
// This field is REQUIRED.
string group_snapshot_id = 1;

// A list of snapshot IDs that are part of this group snapshot.
// If SP does not need to rely on this field to get the snapshots
// in the group, it SHOULD check this field and report an error
// if it has the ability to detect a mismatch.
// Some SPs require this list to get the snapshots in the group.
// If SP needs to use this field to get the snapshots in the
// group, it MUST report an error if it has the ability to detect
// a mismatch.
// This field is REQUIRED.
repeated string snapshot_ids = 2;

// Secrets required by plugin to complete
// GetVolumeGroupSnapshot request.
// This field is OPTIONAL. Refer to the `Secrets Requirements`
// section on how to use this field.
// The secrets provided in this field SHOULD be the same for
// all group snapshot operations on the same group snapshot.
map<string, string> secrets = 3 [(csi_secret) = true];
}

message GetVolumeGroupSnapshotResponse {
option (alpha_message) = true;

// This field is REQUIRED
VolumeGroupSnapshot group_snapshot = 1;
}

0 comments on commit 47a0fa4

Please sign in to comment.