Skip to content

Commit b956716

Browse files
committed
Allow modifying volume topology
1 parent a539b4f commit b956716

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

csi.proto

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,10 +1041,43 @@ message ControllerModifyVolumeRequest {
10411041
// on the absence of keys, only keys that are specified should result
10421042
// in modifications to the volume.
10431043
map<string, string> mutable_parameters = 3;
1044+
1045+
// Indicates whether the CO allows the SP to update the topology
1046+
// as a part of the modification.
1047+
bool allow_topology_updates = 4;
10441048
}
10451049

10461050
message ControllerModifyVolumeResponse {
10471051
option (alpha_message) = true;
1052+
1053+
// Specifies where (regions, zones, racks, etc.) the modified
1054+
// volume is accessible from.
1055+
// A plugin that returns this field MUST also set the
1056+
// VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability.
1057+
// An SP MAY specify multiple topologies to indicate the volume is
1058+
// accessible from multiple locations.
1059+
// COs MAY use this information along with the topology information
1060+
// returned by NodeGetInfo to ensure that a given volume is accessible
1061+
// from a given node when scheduling workloads.
1062+
// This field is OPTIONAL. It is effective to replace the
1063+
// accessible_topology returned by CreateVolume if the plugin has
1064+
// MODIFY_VOLUME_TOPOLOGY controller capability.
1065+
// If it is not specified, the CO MAY assume
1066+
// the volume is equally accessible from all nodes in the cluster and
1067+
// MAY schedule workloads referencing the volume on any available
1068+
// node.
1069+
//
1070+
// SP MUST only set this field if allow_topology_updates is set
1071+
// in the request. SP SHOULD fail the request if it needs to update
1072+
// the topology but is not allowed by the CO.
1073+
repeated Topology accessible_topology = 1;
1074+
1075+
// Indicates whether the modification is still in progress.
1076+
// SPs MAY set in_progress to update the accessible_topology
1077+
// before the modification finishes to reduce possible race conditions.
1078+
// COs SHOULD retry the request if in_progress is set to true,
1079+
// until in_progress is set to false.
1080+
bool in_progress = 2;
10481081
}
10491082

10501083
message GetCapacityRequest {
@@ -1194,6 +1227,10 @@ message ControllerServiceCapability {
11941227
// Indicates the SP supports the GetSnapshot RPC.
11951228
// This enables COs to fetch an existing snapshot.
11961229
GET_SNAPSHOT = 15 [(alpha_enum_value) = true];
1230+
1231+
// Indicates the SP supports modifying volume topology.
1232+
// See ControllerModifyVolume for details.
1233+
MODIFY_VOLUME_TOPOLOGY = 16 [(alpha_enum_value) = true];
11971234
}
11981235

11991236
Type type = 1;

spec.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ The CO MUST implement the specified error recovery behavior when it encounters t
16711671
#### `ControllerModifyVolume`
16721672

16731673
A Controller plugin MUST implement this RPC call if the plugin has the MODIFY_VOLUME controller capability.
1674-
This RPC allows the CO to change mutable key attributes of a volume.
1674+
This RPC allows the CO to change mutable key attributes and the accessible topology of a volume.
16751675

16761676
This operation MUST be idempotent.
16771677
The new mutable parameters in ControllerModifyVolume can be different from the existing mutable parameters.
@@ -1714,6 +1714,7 @@ message ControllerModifyVolumeResponse {
17141714
| Parameters not supported | 3 INVALID_ARGUMENT | Indicates that the CO has specified mutable parameters not supported by the volume. | Caller MAY verify mutable parameters. |
17151715
| 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. |
17161716
| 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. |
1717+
| Topology conflict | 9 FAILED_PRECONDITION | Indicates that the CO has requested a modification that would make the volume inaccessible to some already attached nodes. | Caller MAY detach the volume from the nodes that are in conflict and retry. |
17171718

17181719
#### `GetCapacity`
17191720

0 commit comments

Comments
 (0)