Skip to content

Commit

Permalink
WIP: Add Volume Health Support to CSI
Browse files Browse the repository at this point in the history
  • Loading branch information
xing-yang committed Feb 11, 2020
1 parent 4731db0 commit 277cefe
Show file tree
Hide file tree
Showing 3 changed files with 730 additions and 258 deletions.
66 changes: 66 additions & 0 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ service Controller {

rpc ControllerExpandVolume (ControllerExpandVolumeRequest)
returns (ControllerExpandVolumeResponse) {}

rpc GetVolume (GetVolumeRequest)
returns (GetVolumeResponse) {}
}

service Node {
Expand Down Expand Up @@ -834,6 +837,27 @@ message ListVolumesResponse {
// An empty string is equal to an unspecified field value.
string next_token = 2;
}
message GetVolumeRequest {
// Identity information for a specific volume. This field is
// REQUIRED. GetVolume will return with current volume information.
string volume_id = 1;
}

message GetVolumeResponse {
message VolumeStatus{
// volume_health shows error conditions reported by the SP.
// This field MUST be specified if the
// GET_VOLUME_HEALTH controller capability is supported.
repeated VolumeHealth volume_health = 1;
}

// This field is REQUIRED
Volume volume = 1;

// This field is OPTIONAL. This field MUST be specified if the
// GET_VOLUME_HEALTH controller capability is supported.
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 @@ -908,6 +932,13 @@ message ControllerServiceCapability {
// Indicates the SP supports the
// ListVolumesResponse.entry.published_nodes field
LIST_VOLUMES_PUBLISHED_NODES = 10;

// Indicates the SP supports the GetVolume RPC
GET_VOLUME = 11;

// Indicates the SP supports the
// GetVolumeResponse.volume_health field
GET_VOLUME_HEALTH = 12;
}

Type type = 1;
Expand Down Expand Up @@ -1234,6 +1265,8 @@ message NodeGetVolumeStatsRequest {
message NodeGetVolumeStatsResponse {
// This field is OPTIONAL.
repeated VolumeUsage usage = 1;
// This field is OPTIONAL.
repeated VolumeHealth volume_health = 2;
}

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

message VolumeHealth {
enum Severity {
// Volume health condition is unknown; treat it as healthy.
UNKNOWN = 0;
// Volume is healthy.
HEALTHY = 1;
// Volume is temporarily unhealthy, but will likely become healthy.
TEMPORARY_UNHEALTHY = 2;
// Volume will fail soon. Move your data off and replace volume or
// you may lose your data.
FATAL_EMINENT = 3;
// Volume is unusable. Data loss is likely.
FATAL = 4;
}

// The severity level of the health condition of the volume.
// This field is REQUIRED.
Severity severity = 1;

// The error code describing the health condition of the volume.
// This is an opaque field to CO.
// This field is REQUIRED.
string error_code = 2;

// The error message associated with the above error_code.
// This field is OPTIONAL.
string message = 3;
}
message NodeGetCapabilitiesRequest {
// Intentionally empty.
}
Expand All @@ -1279,6 +1341,10 @@ message NodeServiceCapability {
GET_VOLUME_STATS = 2;
// See VolumeExpansion for details.
EXPAND_VOLUME = 3;
// If Plugin implements GET_VOLUME_STATS_HEALTH capability
// then it MUST implement NodeGetVolumeStats RPC
// call for fetching volume health information.
GET_VOLUME_STATS_HEALTH = 4;
}

Type type = 1;
Expand Down
Loading

0 comments on commit 277cefe

Please sign in to comment.