Skip to content

Add new GroupControllerService and VolumeGroupSnapshot CSI RPCs #519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Feb 21, 2023
208 changes: 208 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 ControllerGetVolumeGroupSnapshot(
ControllerGetVolumeGroupSnapshotRequest)
returns (ControllerGetVolumeGroupSnapshotResponse) {
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 the GroupControllerService. Plugins MAY provide this
// capability.
// The presence of this capability determines whether the CO will
// attempt to invoke the REQUIRED GroupControllerService RPCs, as
// well as specific RPCs as indicated by
// GroupControllerGetCapabilities.
GROUP_CONTROLLER_SERVICE = 3;
}
Type type = 1;
}
Expand Down Expand Up @@ -1163,6 +1196,17 @@ 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 the volume group snapshot, the SP
// SHOULD provide the ID of the volume group snapshot in this field.
// If provided, CO MUST use this field to indicate that this snapshot
// is part of the specified group snapshot.
// 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 +1678,167 @@ 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 as
// the secrets provided in ControllerDeleteVolumeGroupSnapshot
// and ControllerGetVolumeGroupSnapshot requests for the same
// group snapshot unless if secrets are rotated after the
// group snapshot is created.
map<string, string> secrets = 3 [(csi_secret) = true];

// Volume secrets required by plugin to complete volume group
// snapshot creation request. This field is needed in case the
// volume level secrets are different from the above secrets
// for the group snapshot.
// This field is OPTIONAL.
repeated VolumeSecret volume_secrets = 4;

// 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 = 5;
}

message VolumeSecret {
// ID of the volume whose secrets are provided.
// This field is REQUIRED.
string volume_id = 1;

// Secrets required by plugin for a volume operation.
// This field is REQUIRED. Refer to the `Secrets Requirements`
// section on how to use this field.
map<string, string> secrets = 2 [(.csi.v1.csi_secret) = true];
}

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 created.
// This field is REQUIRED.
repeated Snapshot snapshots = 2;

// Timestamp when the volume group snapshot is taken.
// This field is REQUIRED.
.google.protobuf.Timestamp creation_time = 3;
}
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.
// Some SPs require this list to delete the snapshots in the group.
// 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 as
// the secrets provided in ControllerCreateVolumeGroupSnapshot
// request for the same group snapshot unless if secrets are rotated
// after the group snapshot is created.
// The secrets provided in the field SHOULD be passed to both
// the group snapshot and the individual snapshot members if needed.
map<string, string> secrets = 3 [(csi_secret) = true];
}

message DeleteVolumeGroupSnapshotResponse {
// Intentionally empty.
}
message ControllerGetVolumeGroupSnapshotRequest {
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;

// Secrets required by plugin to complete
// ControllerGetVolumeGroupSnapshot 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 as
// the secrets provided in ControllerCreateVolumeGroupSnapshot
// request for the same group snapshot unless if secrets are rotated
// after the group snapshot is created.
map<string, string> secrets = 2 [(csi_secret) = true];
}

message ControllerGetVolumeGroupSnapshotResponse {
option (alpha_message) = true;

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