Spdk/proto/sma.proto

195 lines
5.3 KiB
Protocol Buffer
Raw Normal View History

sma: initial Storage Management Agent structures Storage Management Agent is a gRPC server that provides an abstraction layer above the SPDK RPC interface. The interface aims to provide a set of methods for managing various protocols (e.g. NVMe, virtio-blk) while hiding the details of a particular transport. The external API is defined by `lib/python/spdk/sma/proto/sma.proto` protobuf file. It defines the generic gRPC service methods and their requests/responses. Device-specific messages are defined in their own files. This patch also defines messages for creating NVMe and NVMe/TCP devices. This patch implements a gRPC service that delegates the work to a specific device type. A DeviceManager is a class that implements some of the methods defined by the service for a given type of devices (e.g. NVMe, virtio-blk, NVMe/TCP, etc.). For now, only the RPC for creating a device is implemented, others are added in subsequent patches. The series implements the generic calls as well as their NVMe/TCP implementation. Support for other devce types could be easily added by creating a new device manager and defining its protobuf parameter definition. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I17cde3b31d3514878f1027cfcd112b48848f6123 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10273 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-01-05 09:32:09 +00:00
syntax = "proto3";
import "nvme.proto";
import "virtio_blk.proto";
import "nvmf_tcp.proto";
import "nvmf.proto";
// This file provides the generic definitions for the Storage Management Agent
// gRPC calls. All of the methods are supposed to be idempotent. Errors are
// reported as standard gRPC status codes.
package sma;
option go_package = "spdk.io/sma";
// Enumeration defining types of devices
enum DeviceType {
DEVICE_TYPE_INVALID = 0;
DEVICE_TYPE_NVME = 1;
DEVICE_TYPE_VIRTIO_BLK = 2;
DEVICE_TYPE_NVMF_TCP = 3;
}
// Volume's crypto parameters
message VolumeCryptoParameters {
// Key to be used for encryption
bytes key = 1;
// Second key (only required by some ciphers)
bytes key2 = 2;
enum Cipher {
AES_CBC = 0;
AES_XTS = 1;
}
// Cipher to use
Cipher cipher = 3;
}
sma: initial Storage Management Agent structures Storage Management Agent is a gRPC server that provides an abstraction layer above the SPDK RPC interface. The interface aims to provide a set of methods for managing various protocols (e.g. NVMe, virtio-blk) while hiding the details of a particular transport. The external API is defined by `lib/python/spdk/sma/proto/sma.proto` protobuf file. It defines the generic gRPC service methods and their requests/responses. Device-specific messages are defined in their own files. This patch also defines messages for creating NVMe and NVMe/TCP devices. This patch implements a gRPC service that delegates the work to a specific device type. A DeviceManager is a class that implements some of the methods defined by the service for a given type of devices (e.g. NVMe, virtio-blk, NVMe/TCP, etc.). For now, only the RPC for creating a device is implemented, others are added in subsequent patches. The series implements the generic calls as well as their NVMe/TCP implementation. Support for other devce types could be easily added by creating a new device manager and defining its protobuf parameter definition. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I17cde3b31d3514878f1027cfcd112b48848f6123 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10273 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-01-05 09:32:09 +00:00
// Parameters describing a volume
message VolumeParameters {
// Volume GUID/UUID
bytes volume_id = 1;
oneof connection_params {
// NVMeoF volume
nvmf.VolumeConnectionParameters nvmf = 2;
}
// Crypto parameters (optional)
VolumeCryptoParameters crypto = 3;
sma: initial Storage Management Agent structures Storage Management Agent is a gRPC server that provides an abstraction layer above the SPDK RPC interface. The interface aims to provide a set of methods for managing various protocols (e.g. NVMe, virtio-blk) while hiding the details of a particular transport. The external API is defined by `lib/python/spdk/sma/proto/sma.proto` protobuf file. It defines the generic gRPC service methods and their requests/responses. Device-specific messages are defined in their own files. This patch also defines messages for creating NVMe and NVMe/TCP devices. This patch implements a gRPC service that delegates the work to a specific device type. A DeviceManager is a class that implements some of the methods defined by the service for a given type of devices (e.g. NVMe, virtio-blk, NVMe/TCP, etc.). For now, only the RPC for creating a device is implemented, others are added in subsequent patches. The series implements the generic calls as well as their NVMe/TCP implementation. Support for other devce types could be easily added by creating a new device manager and defining its protobuf parameter definition. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I17cde3b31d3514878f1027cfcd112b48848f6123 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10273 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-01-05 09:32:09 +00:00
}
// Create device request
message CreateDeviceRequest {
// Volume to immediately attach to the created device. This field may be
// optional for some device types (e.g. NVMe), while it may be required for
// others (e.g. virtio-blk).
VolumeParameters volume = 1;
// Device-specific parameters
oneof params {
// NVMe parameters
nvme.DeviceParameters nvme = 2;
// Virtio-blk parameters
virtio_blk.DeviceParameters virtio_blk = 3;
// NVMe/TCP parameters
nvmf_tcp.DeviceParameters nvmf_tcp = 4;
}
}
// Create device response
message CreateDeviceResponse {
// Device handle that can uniquely identify a device within an instance of
// Storage Management Agent
string handle = 1;
}
// Delete device request
message DeleteDeviceRequest {
// Device handle
string handle = 1;
}
// Delete device response
message DeleteDeviceResponse {}
// Attach volume request
message AttachVolumeRequest {
// Volume parameters
VolumeParameters volume = 1;
// Device handle
string device_handle = 2;
}
// Attach volume response
message AttachVolumeResponse {}
// Detach volume request
message DetachVolumeRequest {
// Volume GUID/UUID
bytes volume_id = 1;
// Device handle
string device_handle = 2;
}
// Detach volume response
message DetachVolumeResponse {}
// QoS limit values. 0 means unlimited, while UINT64_MAX means to leave the
// current limit value unchanged. If one of the limits isn't supported by a
// given device/volume, it must be set to 0.
message QosLimit {
// Read kIOPS
uint64 rd_iops = 1;
// Write kIOPS
uint64 wr_iops = 2;
// Read/write kIOPS
uint64 rw_iops = 3;
// Read bandwidth (MB/s)
uint64 rd_bandwidth = 4;
// Write bandwidth (MB/s)
uint64 wr_bandwidth = 5;
// Read/write bandwidth (MB/s)
uint64 rw_bandwidth = 6;
}
// SetQos request
message SetQosRequest {
// Device handle
string device_handle = 1;
// GUID/UUID of a volume to configure QoS on. If this parameter is omitted,
// the QoS will be set up on the whole device (all volumes attached to that
// device will share QoS settings). Some device types might only support
// configuring QoS on per-device (volume_id must be empty) or per-volume level
// (volume_id cannot be empty). This information can be obtained by sending a
// GetQosCapabilities request.
bytes volume_id = 2;
// Maximum allowed IOPS/bandwidth
QosLimit maximum = 3;
}
// SetQos response
message SetQosResponse {}
// Get QoS capabilities request
message GetQosCapabilitiesRequest {
// Type of a device to query for QoS capabilities
DeviceType device_type = 1;
}
// Get QoS capabilities response
message GetQosCapabilitiesResponse {
message QosCapabilities {
// Read IOPS
bool rd_iops = 1;
// Write IOPS
bool wr_iops = 2;
// Read/write IOPS
bool rw_iops = 3;
// Read bandwidth
bool rd_bandwidth = 4;
// Write bandwidth
bool wr_bandwidth = 5;
// Read/write bandwidth
bool rw_bandwidth = 6;
}
// Device level maximum QoS limits
QosCapabilities max_device_caps = 1;
// Volume level maximum QoS limits
QosCapabilities max_volume_caps = 2;
};
sma: initial Storage Management Agent structures Storage Management Agent is a gRPC server that provides an abstraction layer above the SPDK RPC interface. The interface aims to provide a set of methods for managing various protocols (e.g. NVMe, virtio-blk) while hiding the details of a particular transport. The external API is defined by `lib/python/spdk/sma/proto/sma.proto` protobuf file. It defines the generic gRPC service methods and their requests/responses. Device-specific messages are defined in their own files. This patch also defines messages for creating NVMe and NVMe/TCP devices. This patch implements a gRPC service that delegates the work to a specific device type. A DeviceManager is a class that implements some of the methods defined by the service for a given type of devices (e.g. NVMe, virtio-blk, NVMe/TCP, etc.). For now, only the RPC for creating a device is implemented, others are added in subsequent patches. The series implements the generic calls as well as their NVMe/TCP implementation. Support for other devce types could be easily added by creating a new device manager and defining its protobuf parameter definition. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I17cde3b31d3514878f1027cfcd112b48848f6123 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10273 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-01-05 09:32:09 +00:00
// Storage Management Agent gRPC service definition
service StorageManagementAgent {
// Creates a new device. A device is an entity that can be used to expose
// volumes (e.g. an NVMeoF subsystem).
rpc CreateDevice (CreateDeviceRequest)
returns (CreateDeviceResponse) {}
// Deletes a device
rpc DeleteDevice (DeleteDeviceRequest)
returns (DeleteDeviceResponse) {}
// Attaches a volume to a specified device making it available through that
// device (e.g. for NVMeoF this results in adding a namespace to an NVMeoF
// subsystem). The type of volume doesn't need to match the type of device
// (e.g. it's perfectly fine to attach an NVMe/TCP volume to a virtio-blk
// device).
rpc AttachVolume (AttachVolumeRequest)
returns (AttachVolumeResponse) {}
// Detaches a volume from a device
rpc DetachVolume (DetachVolumeRequest)
returns (DetachVolumeResponse) {}
// Configures QoS on a device/volume
rpc SetQos (SetQosRequest)
returns (SetQosResponse) {}
// Returns QoS capabilities of a given device type
rpc GetQosCapabilities (GetQosCapabilitiesRequest)
returns (GetQosCapabilitiesResponse) {}
sma: initial Storage Management Agent structures Storage Management Agent is a gRPC server that provides an abstraction layer above the SPDK RPC interface. The interface aims to provide a set of methods for managing various protocols (e.g. NVMe, virtio-blk) while hiding the details of a particular transport. The external API is defined by `lib/python/spdk/sma/proto/sma.proto` protobuf file. It defines the generic gRPC service methods and their requests/responses. Device-specific messages are defined in their own files. This patch also defines messages for creating NVMe and NVMe/TCP devices. This patch implements a gRPC service that delegates the work to a specific device type. A DeviceManager is a class that implements some of the methods defined by the service for a given type of devices (e.g. NVMe, virtio-blk, NVMe/TCP, etc.). For now, only the RPC for creating a device is implemented, others are added in subsequent patches. The series implements the generic calls as well as their NVMe/TCP implementation. Support for other devce types could be easily added by creating a new device manager and defining its protobuf parameter definition. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I17cde3b31d3514878f1027cfcd112b48848f6123 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10273 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-01-05 09:32:09 +00:00
}