@@ -95,6 +95,11 @@ service Controller {
95
95
96
96
rpc ControllerExpandVolume (ControllerExpandVolumeRequest )
97
97
returns (ControllerExpandVolumeResponse ) {}
98
+
99
+ rpc ControllerGetVolume (ControllerGetVolumeRequest )
100
+ returns (ControllerGetVolumeResponse ) {
101
+ option (alpha_method) = true ;
102
+ }
98
103
}
99
104
100
105
service Node {
@@ -849,6 +854,12 @@ message ListVolumesResponse {
849
854
// published_node_ids MAY include nodes not published to or
850
855
// reported by the SP. The CO MUST be resilient to that.
851
856
repeated string published_node_ids = 1 ;
857
+
858
+ // Information about the current condition of the volume.
859
+ // This field is OPTIONAL.
860
+ // This field MUST be specified if the
861
+ // VOLUME_CONDITION controller capability is supported.
862
+ VolumeCondition volume_condition = 2 [(alpha_field) = true ];
852
863
}
853
864
854
865
message Entry {
@@ -871,6 +882,40 @@ message ListVolumesResponse {
871
882
// An empty string is equal to an unspecified field value.
872
883
string next_token = 2 ;
873
884
}
885
+ message ControllerGetVolumeRequest {
886
+ option (alpha_message) = true ;
887
+
888
+ // The ID of the volume to fetch current volume information for.
889
+ // This field is REQUIRED.
890
+ string volume_id = 1 ;
891
+ }
892
+
893
+ message ControllerGetVolumeResponse {
894
+ option (alpha_message) = true ;
895
+
896
+ message VolumeStatus {
897
+ // A list of all the `node_id` of nodes that this volume is
898
+ // controller published on.
899
+ // This field is OPTIONAL.
900
+ // This field MUST be specified if the PUBLISH_UNPUBLISH_VOLUME
901
+ // controller capability is supported.
902
+ // published_node_ids MAY include nodes not published to or
903
+ // reported by the SP. The CO MUST be resilient to that.
904
+ repeated string published_node_ids = 1 ;
905
+
906
+ // Information about the current condition of the volume.
907
+ // This field is OPTIONAL.
908
+ // This field MUST be specified if the
909
+ // VOLUME_CONDITION controller capability is supported.
910
+ VolumeCondition volume_condition = 2 ;
911
+ }
912
+
913
+ // This field is REQUIRED
914
+ Volume volume = 1 ;
915
+
916
+ // This field is REQUIRED.
917
+ VolumeStatus status = 2 ;
918
+ }
874
919
message GetCapacityRequest {
875
920
// If specified, the Plugin SHALL report the capacity of the storage
876
921
// that can be used to provision volumes that satisfy ALL of the
@@ -945,6 +990,24 @@ message ControllerServiceCapability {
945
990
// Indicates the SP supports the
946
991
// ListVolumesResponse.entry.published_nodes field
947
992
LIST_VOLUMES_PUBLISHED_NODES = 10 ;
993
+
994
+ // Indicates that the Controller service can report volume
995
+ // conditions.
996
+ // An SP MAY implement `VolumeCondition` in only the Controller
997
+ // Plugin, only the Node Plugin, or both.
998
+ // If `VolumeCondition` is implemented in both the Controller and
999
+ // Node Plugins, it SHALL report from different perspectives.
1000
+ // If for some reason Controller and Node Plugins report
1001
+ // misaligned volume conditions, CO SHALL assume the worst case
1002
+ // is the truth.
1003
+ // Note that, for alpha, `VolumeCondition` is intended be
1004
+ // informative for humans only, not for automation.
1005
+ VOLUME_CONDITION = 11 [(alpha_enum_value) = true ];
1006
+
1007
+ // Indicates the SP supports the ControllerGetVolume RPC.
1008
+ // This enables COs to, for example, fetch per volume
1009
+ // condition after a volume is provisioned.
1010
+ GET_VOLUME = 12 [(alpha_enum_value) = true ];
948
1011
}
949
1012
950
1013
Type type = 1 ;
@@ -1273,6 +1336,11 @@ message NodeGetVolumeStatsRequest {
1273
1336
message NodeGetVolumeStatsResponse {
1274
1337
// This field is OPTIONAL.
1275
1338
repeated VolumeUsage usage = 1 ;
1339
+ // Information about the current condition of the volume.
1340
+ // This field is OPTIONAL.
1341
+ // This field MUST be specified if the VOLUME_CONDITION node
1342
+ // capability is supported.
1343
+ VolumeCondition volume_condition = 2 [(alpha_field) = true ];
1276
1344
}
1277
1345
1278
1346
message VolumeUsage {
@@ -1296,6 +1364,20 @@ message VolumeUsage {
1296
1364
// Units by which values are measured. This field is REQUIRED.
1297
1365
Unit unit = 4 ;
1298
1366
}
1367
+
1368
+ // VolumeCondition represents the current condition of a volume.
1369
+ message VolumeCondition {
1370
+ option (alpha_message) = true ;
1371
+
1372
+ // Normal volumes are available for use and operating optimally.
1373
+ // An abnormal volume does not meet these criteria.
1374
+ // This field is REQUIRED.
1375
+ bool abnormal = 1 ;
1376
+
1377
+ // The message describing the condition of the volume.
1378
+ // This field is REQUIRED.
1379
+ string message = 2 ;
1380
+ }
1299
1381
message NodeGetCapabilitiesRequest {
1300
1382
// Intentionally empty.
1301
1383
}
@@ -1318,6 +1400,18 @@ message NodeServiceCapability {
1318
1400
GET_VOLUME_STATS = 2 ;
1319
1401
// See VolumeExpansion for details.
1320
1402
EXPAND_VOLUME = 3 ;
1403
+ // Indicates that the Node service can report volume conditions.
1404
+ // An SP MAY implement `VolumeCondition` in only the Node
1405
+ // Plugin, only the Controller Plugin, or both.
1406
+ // If `VolumeCondition` is implemented in both the Node and
1407
+ // Controller Plugins, it SHALL report from different
1408
+ // perspectives.
1409
+ // If for some reason Node and Controller Plugins report
1410
+ // misaligned volume conditions, CO SHALL assume the worst case
1411
+ // is the truth.
1412
+ // Note that, for alpha, `VolumeCondition` is intended to be
1413
+ // informative for humans only, not for automation.
1414
+ VOLUME_CONDITION = 4 [(alpha_enum_value) = true ];
1321
1415
}
1322
1416
1323
1417
Type type = 1 ;
0 commit comments