Skip to content

Proposal: Add device_config to Device #764

@mariash

Description

@mariash

What is the problem?

The Device Object in the Volume Mount Object currently only supports existing shared devices. It allows to pass mount_config, which is used by the volume driver to mount volume.

There is no mechanism for a service broker to provide configuration that driver can use to create a device on demand.

Who does this affect?

Volume service broker authors who need to create devices on-demand rather than using existing volumes.

Do you have any proposed solutions?

Add a new optional field device_config of type object to the Device Object. This field contains configuration used to define the device, separate from mount_config which is used to mount it.

Spec changes

Device Object:

Response Field Type Description
volume_id* string ID of the shared volume to mount on every app instance.
mount_config object Configuration object to be passed to the driver when the volume is mounted.
device_config object **Configuration object to be passed to the driver when the device is created. **

Updated JSON example:

{
  "volume_mounts": [{
    "driver": "cephdriver",
    "container_dir": "/data/images",
    "mode": "r",
    "device_type": "shared",
    "device": {
      "volume_id": "bc2c1eab-05b9-482d-b0cf-750ee07de311",
      "device_config": {
        "size_mb": 10240,
        "fs_type": "ext4"
      },
      "mount_config": {
        "key": "value"
      }
    }
  }]
}

Semantics

  • device_config is an object, its schema is driver-specific, same as mount_config.
  • The platform passes device_config to the volume driver at device creation, and passes mount_config to the driver at mount.
  • The change is backwards compatible. The field is optional.

Additional context

Volume services that create and mount devices on demand need a way to pass configuration separately from mount configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions