container-storage-interface / spec

Container Storage Interface (CSI) Specification.
Apache License 2.0
1.34k stars 373 forks source link

Add volume capability for controller and node expansion requests #380

Closed gnufied closed 5 years ago

gnufied commented 5 years ago

Currently ControllerExpandVolumeRequest and NodeExpandVolumeRequest do not contain volume capability information. This could be problematic because - a plugin may use this information to tweak resizing flow. Such as:

  1. A plugin may skip doing file system resizing(on node) if volume is of type block.
  2. A plugin may return false from ControllerExpandVolume call if for certain types of volumes (raw block) no NodeExpandVolume call is necessary.

cc @bswartz @msau42 @wongma7

ShyamsundarR commented 5 years ago

By extension, wouldn't it be required that NodeGetVolumeStats also receive volume_capability information, to distinguish between when to return block stats and when to return filesystem stats created on the block device, based on volume type?

I am asking to understand if this or a subsequent request should cover this requirement as well, thanks.

gnufied commented 5 years ago

May be.. I am interested in learning how a plugin will use that information for NodeGetVolumeStats call. In many cases for raw block devices - it is not possible to get used capacity etc. Lets open another issue to track that?

ShyamsundarR commented 5 years ago

May be.. I am interested in learning how a plugin will use that information for NodeGetVolumeStats call. In many cases for raw block devices - it is not possible to get used capacity etc. Lets open another issue to track that?

For block volumes we may omit used and available as per the spec [1].

I do not have this problem yet, so I am not opening an issue on this, unless we want to invite further feedback.

I dropped the comment here as, if we are unable to auto detect a block volume without the volume_capability information in NodeExpandVolumeRequest RPC, the problem would persist for the NodeGetVolumeStats RPC (and other such RPCs) as well. Hence should this issue expand the initial problem statement when considering a solution?

leakingtapan commented 5 years ago

If we add volume_capability in ControllerExpandVolume this helps establish an explicit contract between CSI driver and CO. So that CSI driver can use node_expansion_required filed to indicate CO to call NodeExpandVolume or not.