Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions apis/io-engine/protobuf/v1/pool.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ message CreatePoolRequest {
EncryptionData data = 7;
EncryptionSecret secret = 8;
}
// The pool configuration specifying raid type and configuration if number of
// disks exceeds 1.
optional RaidConfig raid_config = 9;
}

// Pool metadata arguments.
Expand Down Expand Up @@ -88,6 +91,22 @@ message ImportPoolRequest {
EncryptionData data = 5;
EncryptionSecret secret = 6;
}
// The pool configuration specifying raid type and configuration if number of
// disks exceeds 1.
optional RaidConfig raid_config = 7;
}

// Pool raid configuration
message RaidConfig {
oneof config {
Raid0Config raid0 = 1;
}
}

// RAID0 configuration parameters
message Raid0Config {
// Strip size in KB (default 64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any advantage to using KB instead of just bytes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SPDK you configure 'strip_size_kb'. I used to use quantity type and bytes initially, but dealing with conversions it became a little confusing at some point. So to make it easier I opted to pass the value with the unit expected in io-engine/SPDK, while using Quantity-type in the CRD and ensure I have the conversion in one single place only.

uint32 strip_size_kb = 1;
}

// State of the storage pool (terminology comes from ZFS).
Expand Down Expand Up @@ -133,6 +152,8 @@ message Pool {
optional bool encrypted = 13;
// Maximum capacity upto which this pool can be expanded, in bytes.
optional uint64 max_expandable_size = 14;
// Optional RAID information if the pool is configured to use a RAID setup.
optional RaidInfo raid_info = 15;
}

// Pool metadata info.
Expand All @@ -152,6 +173,14 @@ message PoolMetadataInfo {
uint64 md_used_pages = 3;
}

// Pool RAID information.
message RaidInfo {
// RAID level (e.g., "raid0", "raid1", "raid5").
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these could be enums?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it could be an enum. Just used a 'string' here so we don't have to modify the RPC when we want to introduce other raid types.

string level = 1;
// RAID state (e.g., "online", "configuring", "offline").
string state = 2;
}

// Destroy pool arguments.
message DestroyPoolRequest {
string name = 1; // name of the pool
Expand Down
5 changes: 3 additions & 2 deletions apis/io-engine/src/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ pub mod pool {
pub use super::pb::{
pool_rpc_client::PoolRpcClient,
pool_rpc_server::{PoolRpc, PoolRpcServer},
CreatePoolRequest, DestroyPoolRequest, ExportPoolRequest, GrowPoolRequest,
raid_config, CreatePoolRequest, DestroyPoolRequest, ExportPoolRequest, GrowPoolRequest,
GrowPoolResponse, ImportPoolRequest, ListPoolOptions, ListPoolsResponse, Pool,
PoolMetadataArgs, PoolMetadataInfo, PoolState, PoolType, PoolTypeValue,
PoolMetadataArgs, PoolMetadataInfo, PoolState, PoolType, PoolTypeValue, Raid0Config,
RaidConfig, RaidInfo,
};
}

Expand Down