Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cd30f47

Browse files
committedJul 14, 2023
Spec ModifyVolume for QoS kep-3751
1 parent b01039c commit cd30f47

File tree

3 files changed

+647
-331
lines changed

3 files changed

+647
-331
lines changed
 

‎csi.proto

+55-4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ service Controller {
100100
returns (ControllerGetVolumeResponse) {
101101
option (alpha_method) = true;
102102
}
103+
104+
rpc ControllerModifyVolume (ControllerModifyVolumeRequest)
105+
returns (ControllerModifyVolumeResponse) {
106+
option (alpha_method) = true;
107+
}
103108
}
104109

105110
service GroupController {
@@ -350,9 +355,10 @@ message CreateVolumeRequest {
350355
// This field is REQUIRED.
351356
repeated VolumeCapability volume_capabilities = 3;
352357

353-
// Plugin specific parameters passed in as opaque key-value pairs.
354-
// This field is OPTIONAL. The Plugin is responsible for parsing and
355-
// validating these parameters. COs will treat these as opaque.
358+
// Plugin specific creation-time parameters passed in as opaque
359+
// key-value pairs. This field is OPTIONAL. The Plugin is responsible
360+
// for parsing and validating these parameters. COs will treat
361+
// these as opaque.
356362
map<string, string> parameters = 4;
357363

358364
// Secrets required by plugin to complete volume creation request.
@@ -376,6 +382,13 @@ message CreateVolumeRequest {
376382
// VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability, the SP MAY
377383
// choose where the provisioned volume is accessible from.
378384
TopologyRequirement accessibility_requirements = 7;
385+
386+
// Plugin specific mutable parameters passed in as opaque key-value
387+
// pairs. This field is OPTIONAL. The Plugin is responsible for
388+
// parsing and validating these parameters. COs will treat these
389+
// as opaque. Plugins SHOULD treat these as if they take precedence
390+
// over the parameters field.
391+
map<string, string> mutable_parameters = 8 [(alpha_field) = true];
379392
}
380393

381394
// Specifies what source the volume will be created from. One of the
@@ -845,10 +858,14 @@ message ValidateVolumeCapabilitiesRequest {
845858
// This field is OPTIONAL.
846859
map<string, string> parameters = 4;
847860

861+
// See CreateVolumeRequest.mutable_parameters.
862+
// This field is OPTIONAL.
863+
map<string, string> mutable_parameters = 5;
864+
848865
// Secrets required by plugin to complete volume validation request.
849866
// This field is OPTIONAL. Refer to the `Secrets Requirements`
850867
// section on how to use this field.
851-
map<string, string> secrets = 5 [(csi_secret) = true];
868+
map<string, string> secrets = 6 [(csi_secret) = true];
852869
}
853870

854871
message ValidateVolumeCapabilitiesResponse {
@@ -864,6 +881,10 @@ message ValidateVolumeCapabilitiesResponse {
864881
// The volume creation parameters validated by the plugin.
865882
// This field is OPTIONAL.
866883
map<string, string> parameters = 3;
884+
885+
// The volume creation mutable_parameters validated by the plugin.
886+
// This field is OPTIONAL.
887+
map<string, string> mutable_parameters = 4;
867888
}
868889

869890
// Confirmed indicates to the CO the set of capabilities that the
@@ -974,6 +995,32 @@ message ControllerGetVolumeResponse {
974995
// This field is REQUIRED.
975996
VolumeStatus status = 2;
976997
}
998+
message ControllerModifyVolumeRequest {
999+
option (alpha_message) = true;
1000+
1001+
// Contains identity information for the existing volume.
1002+
// This field is REQUIRED.
1003+
string volume_id = 1;
1004+
1005+
// Secrets required by plugin to complete modify volume request.
1006+
// This field is OPTIONAL. Refer to the `Secrets Requirements`
1007+
// section on how to use this field.
1008+
map<string, string> secrets = 2 [(csi_secret) = true];
1009+
1010+
// Plugin specific parameters to apply, passed in as opaque key-value
1011+
// pairs. This field is OPTIONAL. The Plugin is responsible for
1012+
// parsing and validating these parameters. COs will treat these
1013+
// as opaque. COs MUST specify the intended value of every mutable
1014+
// parameter. Absent keys that were previously assigned a value MUST
1015+
// be interpreted as a deletion of the key from the set of mutable
1016+
// parameters.
1017+
map<string, string> mutable_parameters = 3;
1018+
}
1019+
1020+
message ControllerModifyVolumeResponse {
1021+
option (alpha_message) = true;
1022+
}
1023+
9771024
message GetCapacityRequest {
9781025
// If specified, the Plugin SHALL report the capacity of the storage
9791026
// that can be used to provision volumes that satisfy ALL of the
@@ -1113,6 +1160,10 @@ message ControllerServiceCapability {
11131160
// SINGLE_NODE_SINGLE_WRITER and/or SINGLE_NODE_MULTI_WRITER are
11141161
// supported, in order to permit older COs to continue working.
11151162
SINGLE_NODE_MULTI_WRITER = 13 [(alpha_enum_value) = true];
1163+
1164+
// Indicates the SP supports modifying volume with mutable
1165+
// parameters. See ControllerModifyVolume for details.
1166+
MODIFY_VOLUME = 14 [(alpha_enum_value) = true];
11161167
}
11171168

11181169
Type type = 1;

‎lib/go/csi/csi.pb.go

+511-322
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎spec.md

+81-5
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ service Controller {
381381
returns (ControllerGetVolumeResponse) {
382382
option (alpha_method) = true;
383383
}
384+
385+
rpc ControllerModifyVolume (ControllerModifyVolumeRequest)
386+
returns (ControllerModifyVolumeResponse) {
387+
option (alpha_method) = true;
388+
}
384389
}
385390
386391
service GroupController {
@@ -752,7 +757,11 @@ A Controller Plugin MUST implement this RPC call if it has `CREATE_DELETE_VOLUME
752757
This RPC will be called by the CO to provision a new volume on behalf of a user (to be consumed as either a block device or a mounted filesystem).
753758

754759
This operation MUST be idempotent.
755-
If a volume corresponding to the specified volume `name` already exists, is accessible from `accessibility_requirements`, and is compatible with the specified `capacity_range`, `volume_capabilities` and `parameters` in the `CreateVolumeRequest`, the Plugin MUST reply `0 OK` with the corresponding `CreateVolumeResponse`.
760+
If a volume corresponding to the specified volume `name` already exists, is accessible from `accessibility_requirements`, and is compatible with the specified `capacity_range`, `volume_capabilities`, `parameters` and `mutable_parameters` in the `CreateVolumeRequest`, the Plugin MUST reply `0 OK` with the corresponding `CreateVolumeResponse`.
761+
762+
The `parameters` field SHALL contain opaque volume attributes to be specified at creation time.
763+
The `mutable_parameters` field SHALL contain opaque volume attributes that are defined at creation time but MAY also be changed during the lifetime of the volume via a subsequent `ControllerModifyVolume` RPC.
764+
Values specified in `mutable_parameters` SHOULD take precedence over the values from `parameters`.
756765

757766
Plugins MAY create 3 types of volumes:
758767

@@ -817,9 +826,10 @@ message CreateVolumeRequest {
817826
// This field is REQUIRED.
818827
repeated VolumeCapability volume_capabilities = 3;
819828
820-
// Plugin specific parameters passed in as opaque key-value pairs.
821-
// This field is OPTIONAL. The Plugin is responsible for parsing and
822-
// validating these parameters. COs will treat these as opaque.
829+
// Plugin specific creation-time parameters passed in as opaque
830+
// key-value pairs. This field is OPTIONAL. The Plugin is responsible
831+
// for parsing and validating these parameters. COs will treat
832+
// these as opaque.
823833
map<string, string> parameters = 4;
824834
825835
// Secrets required by plugin to complete volume creation request.
@@ -843,6 +853,13 @@ message CreateVolumeRequest {
843853
// VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability, the SP MAY
844854
// choose where the provisioned volume is accessible from.
845855
TopologyRequirement accessibility_requirements = 7;
856+
857+
// Plugin specific mutable parameters passed in as opaque key-value
858+
// pairs. This field is OPTIONAL. The Plugin is responsible for
859+
// parsing and validating these parameters. COs will treat these
860+
// as opaque. Plugins SHOULD treat these as if they take precedence
861+
// over the parameters field.
862+
map<string, string> mutable_parameters = 8 [(alpha_field) = true];
846863
}
847864
848865
// Specifies what source the volume will be created from. One of the
@@ -1429,10 +1446,14 @@ message ValidateVolumeCapabilitiesRequest {
14291446
// This field is OPTIONAL.
14301447
map<string, string> parameters = 4;
14311448
1449+
// See CreateVolumeRequest.mutable_parameters.
1450+
// This field is OPTIONAL.
1451+
map<string, string> mutable_parameters = 5;
1452+
14321453
// Secrets required by plugin to complete volume validation request.
14331454
// This field is OPTIONAL. Refer to the `Secrets Requirements`
14341455
// section on how to use this field.
1435-
map<string, string> secrets = 5 [(csi_secret) = true];
1456+
map<string, string> secrets = 6 [(csi_secret) = true];
14361457
}
14371458
14381459
message ValidateVolumeCapabilitiesResponse {
@@ -1448,6 +1469,10 @@ message ValidateVolumeCapabilitiesResponse {
14481469
// The volume creation parameters validated by the plugin.
14491470
// This field is OPTIONAL.
14501471
map<string, string> parameters = 3;
1472+
1473+
// The volume creation mutable_parameters validated by the plugin.
1474+
// This field is OPTIONAL.
1475+
map<string, string> mutable_parameters = 4;
14511476
}
14521477
14531478
// Confirmed indicates to the CO the set of capabilities that the
@@ -1617,6 +1642,53 @@ The CO MUST implement the specified error recovery behavior when it encounters t
16171642
|-----------|-----------|-------------|-------------------|
16181643
| Volume does not exist | 5 NOT_FOUND | Indicates that a volume corresponding to the specified `volume_id` does not exist. | Caller MUST verify that the `volume_id` is correct and that the volume is accessible and has not been deleted before retrying with exponential back off. |
16191644

1645+
1646+
#### `ControllerModifyVolume`
1647+
1648+
A Controller plugin MUST implement this RPC call if plugin has MODIFY_VOLUME controller capability.
1649+
This RPC allows the CO to change mutable key attributes of a volume.
1650+
1651+
This operation MUST be idempotent.
1652+
The new mutable parameters in ControllerModifyVolume can be different from the existing mutable parameters.
1653+
1654+
1655+
```protobuf
1656+
message ControllerModifyVolumeRequest {
1657+
option (alpha_message) = true;
1658+
1659+
// Contains identity information for the existing volume.
1660+
// This field is REQUIRED.
1661+
string volume_id = 1;
1662+
1663+
// Secrets required by plugin to complete modify volume request.
1664+
// This field is OPTIONAL. Refer to the `Secrets Requirements`
1665+
// section on how to use this field.
1666+
map<string, string> secrets = 2 [(csi_secret) = true];
1667+
1668+
// Plugin specific parameters to apply, passed in as opaque key-value
1669+
// pairs. This field is OPTIONAL. The Plugin is responsible for
1670+
// parsing and validating these parameters. COs will treat these
1671+
// as opaque. COs MUST specify the intended value of every mutable
1672+
// parameter. Absent keys that were previously assigned a value MUST
1673+
// be interpreted as a deletion of the key from the set of mutable
1674+
// parameters.
1675+
map<string, string> mutable_parameters = 3;
1676+
}
1677+
1678+
message ControllerModifyVolumeResponse {
1679+
option (alpha_message) = true;
1680+
}
1681+
1682+
```
1683+
1684+
##### ControllerModifyVolume Errors
1685+
1686+
| Condition | gRPC Code | Description | Recovery Behavior |
1687+
|-----------|-----------|-------------|-------------------|
1688+
| Parameters not supported | 3 INVALID_ARGUMENT | Indicates that the CO has specified mutable parameters not supported by the volume. | Caller MAY verify mutable parameters. |
1689+
| Exceeds capabilities | 3 INVALID_ARGUMENT | Indicates that the CO has specified capabilities not supported by the volume. | Caller MAY verify volume capabilities by calling ValidateVolumeCapabilities and retry with matching capabilities. |
1690+
| Volume does not exist | 5 NOT FOUND | Indicates that a volume corresponding to the specified volume_id does not exist. | Caller MUST verify that the volume_id is correct and that the volume is accessible and has not been deleted before retrying with exponential back off. |
1691+
16201692
#### `GetCapacity`
16211693

16221694
A Controller Plugin MUST implement this RPC call if it has `GET_CAPACITY` controller capability.
@@ -1773,6 +1845,10 @@ message ControllerServiceCapability {
17731845
// SINGLE_NODE_SINGLE_WRITER and/or SINGLE_NODE_MULTI_WRITER are
17741846
// supported, in order to permit older COs to continue working.
17751847
SINGLE_NODE_MULTI_WRITER = 13 [(alpha_enum_value) = true];
1848+
1849+
// Indicates the SP supports modifying volume with mutable
1850+
// parameters. See ControllerModifyVolume for details.
1851+
MODIFY_VOLUME = 14 [(alpha_enum_value) = true];
17761852
}
17771853
17781854
Type type = 1;

0 commit comments

Comments
 (0)
Please sign in to comment.