@@ -165,9 +165,12 @@ message CreateVolumeResponse {
165
165
166
166
// Specify a capability of a volume.
167
167
message VolumeCapability {
168
+ // Indicate that the volume will be accessed via the block device API.
168
169
message BlockVolume {
169
170
// Intentionally empty, for now.
170
171
}
172
+
173
+ // Indicate that the volume will be accessed via the filesystem API.
171
174
message MountVolume {
172
175
// The filesystem type. This field is OPTIONAL.
173
176
string fs_type = 1 ;
@@ -179,11 +182,41 @@ message VolumeCapability {
179
182
repeated string mount_flags = 2 ;
180
183
}
181
184
182
- // One of the following fields MUST be specified.
183
- oneof value {
185
+ // Specify how a volume can be accessed.
186
+ message AccessMode {
187
+ enum Mode {
188
+ UNKNOWN = 0 ;
189
+
190
+ // Can be published as read/write at one node at a time.
191
+ SINGLE_NODE_WRITER = 1 ;
192
+
193
+ // Can be published as readonly at one node at a time.
194
+ SINGLE_NODE_READER_ONLY = 2 ;
195
+
196
+ // Can be published as readonly at multiple nodes simultaneously.
197
+ MULTI_NODE_READER_ONLY = 3 ;
198
+
199
+ // Can be published at multiple nodes simultaneously. Only one of
200
+ // the node can be used as read/write. The rest will be readonly.
201
+ MULTI_NODE_SINGLE_WRITER = 4 ;
202
+
203
+ // Can be published as read/write at multiple nodes simultaneously.
204
+ MULTI_NODE_MULTI_WRITER = 5 ;
205
+ }
206
+
207
+ // This field is REQUIRED.
208
+ Mode mode = 1 ;
209
+ }
210
+
211
+ // Specifies what API the volume will be accessed using. One of the
212
+ // following fields MUST be specified.
213
+ oneof access_type {
184
214
BlockVolume block = 1 ;
185
215
MountVolume mount = 2 ;
186
216
}
217
+
218
+ // This is a REQUIRED field.
219
+ AccessMode access_mode = 3 ;
187
220
}
188
221
189
222
// The capacity of the storage space in bytes. To specify an exact size,
@@ -204,10 +237,6 @@ message VolumeInfo {
204
237
// NFS share). If set, it MUST be non-zero.
205
238
uint64 capacity_bytes = 1 ;
206
239
207
- // Contains information about how the volume can be accessed. This
208
- // field is REQUIRED.
209
- AccessMode access_mode = 2 ;
210
-
211
240
// Contains identity information for the created volume. This field is
212
241
// REQUIRED. The identity information will be used by the CO in
213
242
// subsequent calls to refer to the provisioned volume.
@@ -219,32 +248,6 @@ message VolumeInfo {
219
248
VolumeMetadata metadata = 5 ;
220
249
}
221
250
222
- // Specify how a volume can be accessed.
223
- message AccessMode {
224
- enum Mode {
225
- UNKNOWN = 0 ;
226
-
227
- // Can be published as read/write at one node at a time.
228
- SINGLE_NODE_WRITER = 1 ;
229
-
230
- // Can be published as readonly at one node at a time.
231
- SINGLE_NODE_READER_ONLY = 2 ;
232
-
233
- // Can be published as readonly at multiple nodes simultaneously.
234
- MULTI_NODE_READER_ONLY = 3 ;
235
-
236
- // Can be published at multiple nodes simultaneously. Only one of
237
- // the node can be used as read/write. The rest will be readonly.
238
- MULTI_NODE_SINGLE_WRITER = 4 ;
239
-
240
- // Can be published as read/write at multiple nodes simultaneously.
241
- MULTI_NODE_MULTI_WRITER = 5 ;
242
- }
243
-
244
- // This field is REQUIRED.
245
- Mode mode = 1 ;
246
- }
247
-
248
251
// The identity of the volume.
249
252
message VolumeID {
250
253
// The identity of the provisioned volume specified by the Plugin in
@@ -306,6 +309,10 @@ message ControllerPublishVolumeRequest {
306
309
// in such cases the CO SHALL NOT specify this field.
307
310
NodeID node_id = 4 ;
308
311
312
+ // The capability of the volume the CO expects the volume to have.
313
+ // This is a REQUIRED field.
314
+ VolumeCapability volume_capability = 6 ;
315
+
309
316
// Whether to publish the volume in readonly mode. This field is
310
317
// REQUIRED.
311
318
bool readonly = 5 ;
@@ -510,12 +517,6 @@ message ControllerServiceCapability {
510
517
oneof type {
511
518
// RPC that the controller supports.
512
519
RPC rpc = 1 ;
513
-
514
- // Volume capability the Controller Plugin supports. An SP SHOULD
515
- // avoid setting different volume capability for Controller and Node
516
- // Plugins if possible. If this happens during the upgrade of the
517
- // Plugins, the behavior is UNDEFINED.
518
- VolumeCapability volume_capability = 2 ;
519
520
}
520
521
}
521
522
////////
@@ -542,8 +543,8 @@ message NodePublishVolumeRequest {
542
543
// request. This is a REQUIRED field.
543
544
string target_path = 5 ;
544
545
545
- // The capability of the volume to be published. This is a REQUIRED
546
- // field.
546
+ // The capability of the volume the CO expects the volume to have.
547
+ // This is a REQUIRED field.
547
548
VolumeCapability volume_capability = 6 ;
548
549
549
550
// Whether to publish the volume in readonly mode. This field is
@@ -659,12 +660,6 @@ message NodeServiceCapability {
659
660
oneof type {
660
661
// RPC that the controller supports.
661
662
RPC rpc = 1 ;
662
-
663
- // Volume capability the Node Plugin supports. An SP SHOULD avoid
664
- // setting different volume capability for Controller and Node
665
- // Plugins if possible. If this happens during the upgrade of the
666
- // Plugins, the behavior is UNDEFINED.
667
- VolumeCapability volume_capability = 2 ;
668
663
}
669
664
}
670
665
////////
@@ -971,6 +966,10 @@ message Error {
971
966
// retrying with exponential backoff.
972
967
MAX_ATTACHED_NODES = 8 ;
973
968
969
+ UNSUPPORTED_MOUNT_FLAGS = 10 ;
970
+ UNSUPPORTED_VOLUME_TYPE = 11 ;
971
+ UNSUPPORTED_FS_TYPE = 12 ;
972
+
974
973
// Indicates that the specified `NodeID` is not allowed or
975
974
// understood by the Plugin, or the Plugin does not support the
976
975
// operation without a `NodeID`. More human-readable information
0 commit comments