Skip to content

Commit

Permalink
Merge pull request container-storage-interface#415 from xing-yang/vol…
Browse files Browse the repository at this point in the history
…umehealth

Add Volume Health Support to CSI
  • Loading branch information
saad-ali committed Apr 15, 2020
2 parents e4404c3 + ecaa329 commit e129a75
Show file tree
Hide file tree
Showing 3 changed files with 791 additions and 267 deletions.
94 changes: 94 additions & 0 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ service Controller {

rpc ControllerExpandVolume (ControllerExpandVolumeRequest)
returns (ControllerExpandVolumeResponse) {}

rpc ControllerGetVolume (ControllerGetVolumeRequest)
returns (ControllerGetVolumeResponse) {
option (alpha_method) = true;
}
}

service Node {
Expand Down Expand Up @@ -849,6 +854,12 @@ message ListVolumesResponse {
// published_node_ids MAY include nodes not published to or
// reported by the SP. The CO MUST be resilient to that.
repeated string published_node_ids = 1;

// Information about the current condition of the volume.
// This field is OPTIONAL.
// This field MUST be specified if the
// VOLUME_CONDITION controller capability is supported.
VolumeCondition volume_condition = 2 [(alpha_field) = true];
}

message Entry {
Expand All @@ -871,6 +882,40 @@ message ListVolumesResponse {
// An empty string is equal to an unspecified field value.
string next_token = 2;
}
message ControllerGetVolumeRequest {
option (alpha_message) = true;

// The ID of the volume to fetch current volume information for.
// This field is REQUIRED.
string volume_id = 1;
}

message ControllerGetVolumeResponse {
option (alpha_message) = true;

message VolumeStatus{
// A list of all the `node_id` of nodes that this volume is
// controller published on.
// This field is OPTIONAL.
// This field MUST be specified if the PUBLISH_UNPUBLISH_VOLUME
// controller capability is supported.
// published_node_ids MAY include nodes not published to or
// reported by the SP. The CO MUST be resilient to that.
repeated string published_node_ids = 1;

// Information about the current condition of the volume.
// This field is OPTIONAL.
// This field MUST be specified if the
// VOLUME_CONDITION controller capability is supported.
VolumeCondition volume_condition = 2;
}

// This field is REQUIRED
Volume volume = 1;

// This field is REQUIRED.
VolumeStatus status = 2;
}
message GetCapacityRequest {
// If specified, the Plugin SHALL report the capacity of the storage
// that can be used to provision volumes that satisfy ALL of the
Expand Down Expand Up @@ -945,6 +990,24 @@ message ControllerServiceCapability {
// Indicates the SP supports the
// ListVolumesResponse.entry.published_nodes field
LIST_VOLUMES_PUBLISHED_NODES = 10;

// Indicates that the Controller service can report volume
// conditions.
// An SP MAY implement `VolumeCondition` in only the Controller
// Plugin, only the Node Plugin, or both.
// If `VolumeCondition` is implemented in both the Controller and
// Node Plugins, it SHALL report from different perspectives.
// If for some reason Controller and Node Plugins report
// misaligned volume conditions, CO SHALL assume the worst case
// is the truth.
// Note that, for alpha, `VolumeCondition` is intended be
// informative for humans only, not for automation.
VOLUME_CONDITION = 11 [(alpha_enum_value) = true];

// Indicates the SP supports the ControllerGetVolume RPC.
// This enables COs to, for example, fetch per volume
// condition after a volume is provisioned.
GET_VOLUME = 12 [(alpha_enum_value) = true];
}

Type type = 1;
Expand Down Expand Up @@ -1273,6 +1336,11 @@ message NodeGetVolumeStatsRequest {
message NodeGetVolumeStatsResponse {
// This field is OPTIONAL.
repeated VolumeUsage usage = 1;
// Information about the current condition of the volume.
// This field is OPTIONAL.
// This field MUST be specified if the VOLUME_CONDITION node
// capability is supported.
VolumeCondition volume_condition = 2 [(alpha_field) = true];
}

message VolumeUsage {
Expand All @@ -1296,6 +1364,20 @@ message VolumeUsage {
// Units by which values are measured. This field is REQUIRED.
Unit unit = 4;
}

// VolumeCondition represents the current condition of a volume.
message VolumeCondition {
option (alpha_message) = true;

// Normal volumes are available for use and operating optimally.
// An abnormal volume does not meet these criteria.
// This field is REQUIRED.
bool abnormal = 1;

// The message describing the condition of the volume.
// This field is REQUIRED.
string message = 2;
}
message NodeGetCapabilitiesRequest {
// Intentionally empty.
}
Expand All @@ -1318,6 +1400,18 @@ message NodeServiceCapability {
GET_VOLUME_STATS = 2;
// See VolumeExpansion for details.
EXPAND_VOLUME = 3;
// Indicates that the Node service can report volume conditions.
// An SP MAY implement `VolumeCondition` in only the Node
// Plugin, only the Controller Plugin, or both.
// If `VolumeCondition` is implemented in both the Node and
// Controller Plugins, it SHALL report from different
// perspectives.
// If for some reason Node and Controller Plugins report
// misaligned volume conditions, CO SHALL assume the worst case
// is the truth.
// Note that, for alpha, `VolumeCondition` is intended to be
// informative for humans only, not for automation.
VOLUME_CONDITION = 4 [(alpha_enum_value) = true];
}

Type type = 1;
Expand Down
Loading

0 comments on commit e129a75

Please sign in to comment.