-
Notifications
You must be signed in to change notification settings - Fork 379
CreateVolumeRequest: add requested AccessMode #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CreateVolumeRequest: add requested AccessMode #61
Conversation
User should be able to specify (via CO) what kind of volume should be created. Some applications may require a SINGLE_NODE_WRITER volume for a database, while others may want MULTI_NODE_MULTI_WRITER for say sharing of pictures.
974b462
to
c381d18
Compare
+1, this LGTM |
Thanks for the PR! This PR made me think: should we move For the sake of consistency, we should either add Something like the following: message VolumeCapability {
...
message AccessMode {
...
}
// One of the following fields MUST be specified.
oneof value {
BlockVolume block = 1;
MountVolume mount = 2;
AccessMode access_mode = 3;
}
}
message VolumeInfo {
uint64 capacity_bytes = 1;
VolumeID id = 4;
VolumeMetadata metadata = 5;
repeated VolumeCapability volume_capabilities = 6;
} Another nice thing about this proposal is that we now can get the |
I did not want to put it into Also, what would be in |
@jsafrane good point on
Why 3*6, not 3+6? |
// The requested minimal access mode. The Plugin MAY return a volume | ||
// that allows a broader access mode, e.g. MULTI_NODE_MULTI_WRITER | ||
// when CO asked just for SINGLE_NODE_WRITER. The Plugin MUST NOT | ||
// return a volume with more restrictive access mode than the CO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to clearly define what "restrictive" means if we want to go with this route. If we define the order in AccessMode based on "restrictiveness", I don't think that forms a total order (it's a partial order meaning that there might not be an order between two enums).
My interpretation of
How CO knows what fs supports which access mode? You must return the allowed combinations:
And that's too ugly I think. |
@jsafrane I thought about it a bit more. I agree with you that asking the plugin to return a complete combination of I think a more practical way is to let the CO drive the volume capability check. So here is my proposal:
@jsafrane let me know if that makes sense to you or not. If you agree, let me know if you're interested in updating the spec. If not, I'm happy to prepare a PR for this. |
Just thinking out loud...
I could imagine a GUI where CO asks user what kind of FS should be created on a volume. There should be a way how CO asks the plugin "give me list of everything you support" so the GUI provides a list of filesystems. This is not possible with Is it a valid use case for CSI? The rest of the proposal looks solid to me. Feel free to prepare a PR on my behalf, thanks in advance :-). |
Is the intent to also modify Perhaps we amend Jie's point (1) such that supported filesystems (not filesystem/mount-option combos) can still be queried?
|
This patch moved `AccessMode` to `VolumeCapability`, because access mode is strongly related to the filesystem type. For instance, a plugin might support `SINGLE_NODE_WRITER` for `xfs`, and `MULTI_NODE_READER_ONLY` for `gfs2`. This patch also removed `VolumeCapability` fields from `ControllerGetCapabilities` and `NodeGetCapabilities` RPCs. It becomes very tedious to ask the plugins to enumerate all volume capabilities that a plugin supports, and probably provides less value. To check the capablities of a volume, the CO should use `ValidateVolumeCapabilities`. This applies to both newly provisioned volumes and pre-existing volumes. See discussion in container-storage-interface#61.
Does it make sense to move the mount/block fields into access mode at this point? |
This patch moved `AccessMode` to `VolumeCapability`, because access mode is strongly related to the filesystem type. For instance, a plugin might support `SINGLE_NODE_WRITER` for `xfs`, and `MULTI_NODE_READER_ONLY` for `gfs2`. This patch also removed `VolumeCapability` fields from `ControllerGetCapabilities` and `NodeGetCapabilities` RPCs. It becomes very tedious to ask the plugins to enumerate all volume capabilities that a plugin supports, and probably provides less value. To check the capablities of a volume, the CO should use `ValidateVolumeCapabilities`. This applies to both newly provisioned volumes and pre-existing volumes. See discussion in #61.
Close this one as #82 is merged. |
User should be able to specify (via CO) what kind of volume should be created.
Some applications running on CO may require a
SINGLE_NODE_WRITER
volume for a database, while others may wantMULTI_NODE_MULTI_WRITER
for say sharing of pictures. The Plugin should 1) see what the application needs and 2) be able to raise an error if it's not able to provision a volume with requested access mode.