Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(replica/resize): api for resizing a replica
Browse files Browse the repository at this point in the history
Signed-off-by: Diwakar Sharma <[email protected]>
dsharma-dc committed Nov 7, 2023

Unverified

This user has not yet uploaded their public signing key.
1 parent 2a43512 commit 171e1c4
Showing 3 changed files with 22 additions and 2 deletions.
5 changes: 5 additions & 0 deletions apis/io-engine/protobuf/v1/common.proto
Original file line number Diff line number Diff line change
@@ -7,3 +7,8 @@ enum ShareProtocol {
NVMF = 1; // NVMe over Fabrics (TCP)
ISCSI = 2; // iSCSI
}

message ResizeContext {
uint64 requested_size = 1;
uint32 status_code = 2;
}
14 changes: 14 additions & 0 deletions apis/io-engine/protobuf/v1/replica.proto
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ service ReplicaRpc {
rpc ListReplicas (ListReplicaOptions) returns (ListReplicasResponse) {}
rpc ShareReplica (ShareReplicaRequest) returns (Replica) {}
rpc UnshareReplica (UnshareReplicaRequest) returns (Replica) {}
rpc ResizeReplica (ResizeReplicaRequest) returns (ResizeReplicaResponse) {}
}

// Replica space usage
@@ -78,11 +79,24 @@ message UnshareReplicaRequest {
string uuid = 1; // uuid of the replica
}

// Resize(expand or shrink) a replica. Only valid for normal lvol
// replicas, and not lvols that are a snapshot.
message ResizeReplicaRequest {
string uuid = 1; // uuid of the replica.
uint64 requested_size = 2; // indicates the requested new size of replica.
}

// List of replicas and their properties.
message ListReplicasResponse {
repeated Replica replicas = 1; // list of the replicas
}

// Response containing updated replica information and result.
message ResizeReplicaResponse {
Replica replica = 1; // replica requested for resize.
ResizeContext resize_ctx = 2; // context info for resize operation.
}

message ListReplicaOptions {
google.protobuf.StringValue name = 1; // list the replica with the name if provided
google.protobuf.StringValue poolname = 2; // list the replicas on the provided pool, by name
5 changes: 3 additions & 2 deletions apis/io-engine/src/v1.rs
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ mod pb {
}

pub mod common {
pub use super::pb::ShareProtocol;
pub use super::pb::{ResizeContext, ShareProtocol};
}

/// v1 version of bdev grpc API
@@ -55,7 +55,8 @@ pub mod replica {
replica_rpc_client::ReplicaRpcClient,
replica_rpc_server::{ReplicaRpc, ReplicaRpcServer},
CreateReplicaRequest, DestroyReplicaRequest, ListReplicaOptions, ListReplicasResponse,
Replica, ReplicaSpaceUsage, ShareReplicaRequest, SnapshotInfo, UnshareReplicaRequest,
Replica, ReplicaSpaceUsage, ResizeReplicaRequest, ResizeReplicaResponse,
ShareReplicaRequest, SnapshotInfo, UnshareReplicaRequest,
};
}
pub mod snapshot {

0 comments on commit 171e1c4

Please sign in to comment.