Skip to content

Commit 6eb7c8c

Browse files
committed
Support online and offline expansion without requiring them to be declared in plugin capabilities.
Ability for a plugin to delcare online and offline controller expansion capabilities via GetPluginCapabilities is deprecated. A plugin may support either mode of operation without having to declare them in GetPluginCapabilities call. If a plugin can not support controller expansion of published volume it may return Volume-in-use error and CO should ensure that volume is not published before retrying with exponential backoff.
1 parent e129a75 commit 6eb7c8c

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

spec.md

+6-16
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ message PluginCapability {
625625
ONLINE = 1;
626626
627627
// OFFLINE indicates that volumes currently published and
628-
// available on a node SHALL NOT be expanded via
628+
// available on a node SHOULD NOT be expanded via
629629
// ControllerExpandVolume. When a plugin supports OFFLINE volume
630630
// expansion it MUST implement either the EXPAND_VOLUME controller
631631
// capability or both the EXPAND_VOLUME controller capability and
@@ -644,6 +644,7 @@ message PluginCapability {
644644
oneof type {
645645
// Service that the plugin supports.
646646
Service service = 1;
647+
// deprecated
647648
VolumeExpansion volume_expansion = 2;
648649
}
649650
}
@@ -1930,24 +1931,15 @@ This RPC allows the CO to expand the size of a volume.
19301931
This operation MUST be idempotent.
19311932
If a volume corresponding to the specified volume ID is already larger than or equal to the target capacity of the expansion request, the plugin SHOULD reply 0 OK.
19321933

1933-
This call MAY be made by the CO during any time in the lifecycle of the volume after creation if plugin has `VolumeExpansion.ONLINE` capability.
1934+
This call MAY be made by the CO during any time in the lifecycle of the volume after creation but an SP may not permit controller expansion of volumes which are controller published or available on a node. In which case - the plugin may return gRPC error code`FAILED_PRECONDITION` (Volume in use) and CO SHOULD ensure that volume is not published and retry with exponential backoff.
1935+
19341936
If plugin has `EXPAND_VOLUME` node capability, then `NodeExpandVolume` MUST be called after successful `ControllerExpandVolume` and `node_expansion_required` in `ControllerExpandVolumeResponse` is `true`.
19351937

19361938
If specified, the `volume_capability` in `ControllerExpandVolumeRequest` should be same as what CO would pass in `ControllerPublishVolumeRequest`.
19371939

1938-
If the plugin has only `VolumeExpansion.OFFLINE` expansion capability and volume is currently published or available on a node then `ControllerExpandVolume` MUST be called ONLY after either:
1939-
- The plugin has controller `PUBLISH_UNPUBLISH_VOLUME` capability and `ControllerUnpublishVolume` has been invoked successfully.
1940-
1941-
OR ELSE
1942-
1943-
- The plugin does NOT have controller `PUBLISH_UNPUBLISH_VOLUME` capability, the plugin has node `STAGE_UNSTAGE_VOLUME` capability, and `NodeUnstageVolume` has been completed successfully.
1944-
1945-
OR ELSE
1946-
1947-
- The plugin does NOT have controller `PUBLISH_UNPUBLISH_VOLUME` capability, nor node `STAGE_UNSTAGE_VOLUME` capability, and `NodeUnpublishVolume` has completed successfully.
19481940

19491941
Examples:
1950-
* Offline Volume Expansion:
1942+
* Offline Volume Expansion(SP does not permit controller expansion of controller published volume):
19511943
Given an ElasticSearch process that runs on Azure Disk and needs more space.
19521944
- The administrator takes the Elasticsearch server offline by stopping the workload and CO calls `ControllerUnpublishVolume`.
19531945
- The administrator requests more space for the volume from CO.
@@ -2003,7 +1995,7 @@ message ControllerExpandVolumeResponse {
20031995
|-----------|-----------|-------------|-------------------|
20041996
| Exceeds capabilities | 3 INVALID_ARGUMENT | Indicates that CO has specified capabilities not supported by the volume. | Caller MAY verify volume capabilities by calling ValidateVolumeCapabilities and retry with matching capabilities. |
20051997
| 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. |
2006-
| Volume in use | 9 FAILED_PRECONDITION | Indicates that the volume corresponding to the specified `volume_id` could not be expanded because it is currently published on a node but the plugin does not have ONLINE expansion capability. | Caller SHOULD ensure that volume is not published and retry with exponential back off. |
1998+
| Volume in use | 9 FAILED_PRECONDITION | Indicates that the volume corresponding to the specified `volume_id` could not be expanded because it is currently published on a node. | Caller SHOULD ensure that volume is not published and retry with exponential back off. |
20071999
| Unsupported `capacity_range` | 11 OUT_OF_RANGE | Indicates that the capacity range is not allowed by the Plugin. More human-readable information MAY be provided in the gRPC `status.message` field. | Caller MUST fix the capacity range before retrying. |
20082000

20092001
#### RPC Interactions
@@ -2523,8 +2515,6 @@ If plugin has `STAGE_UNSTAGE_VOLUME` node capability then:
25232515

25242516
Otherwise `NodeExpandVolume` MUST be called after successful `NodePublishVolume`.
25252517

2526-
If a plugin only supports expansion via the `VolumeExpansion.OFFLINE` capability, then the volume MUST first be taken offline and expanded via `ControllerExpandVolume` (see `ControllerExpandVolume` for more details), and then node-staged or node-published before it can be expanded on the node via `NodeExpandVolume`.
2527-
25282518
The `staging_target_path` field is not required, for backwards compatibility, but the CO SHOULD supply it.
25292519
Plugins can use this field to determine if `volume_path` is where the volume is published or staged,
25302520
and setting this field to non-empty allows plugins to function with less stored state on the node.

0 commit comments

Comments
 (0)