From 06706f1c4f0f11257568b809bb008d4dea640d84 Mon Sep 17 00:00:00 2001 From: hamdykhader Date: Wed, 10 Jun 2026 02:36:08 +0300 Subject: [PATCH 1/2] fix: remove QoS parameters from CLI and APIv1/v2 on pool add/set --- simplyblock_cli/cli-reference.yaml | 38 +------------------ simplyblock_cli/cli.py | 9 ----- simplyblock_cli/clibase.py | 23 ++--------- .../controllers/pool_controller.py | 4 +- simplyblock_web/api/v1/pool.py | 31 ++++----------- simplyblock_web/api/v2/pool.py | 20 ++++------ 6 files changed, 22 insertions(+), 103 deletions(-) diff --git a/simplyblock_cli/cli-reference.yaml b/simplyblock_cli/cli-reference.yaml index 29cd6cee72..8efd412aa6 100644 --- a/simplyblock_cli/cli-reference.yaml +++ b/simplyblock_cli/cli-reference.yaml @@ -2041,27 +2041,6 @@ commands: dest: lvol_max type: size default: "0" - - name: "--max-rw-iops" - help: "Maximum Read Write IO Per Second." - dest: max_rw_iops - type: int - - name: "--max-rw-mbytes" - help: "Maximum Read Write Megabytes Per Second." - dest: max_rw_mbytes - type: int - - name: "--max-r-mbytes" - help: "Maximum Read Megabytes Per Second." - dest: max_r_mbytes - type: int - - name: "--max-w-mbytes" - help: "Maximum Write Megabytes Per Second." - dest: max_w_mbytes - type: int - - name: "--qos-host" - help: "The node id for QoS pool." - dest: qos_host - type: str - required: false - name: "--dhchap" help: "Enable DH-HMAC-CHAP authentication for all volumes in the pool." dest: dhchap @@ -2083,22 +2062,7 @@ commands: help: "Logical volume maximum size: 20M, 20G." dest: lvol_max type: size - - name: "--max-rw-iops" - help: "Maximum Read Write IO Per Second." - dest: max_rw_iops - type: int - - name: "--max-rw-mbytes" - help: "Maximum Read Write Megabytes Per Second." - dest: max_rw_mbytes - type: int - - name: "--max-r-mbytes" - help: "Maximum Read Megabytes Per Second." - dest: max_r_mbytes - type: int - - name: "--max-w-mbytes" - help: "Maximum Write Megabytes Per Second." - dest: max_w_mbytes - type: int + - name: list help: "Lists all storage pools." arguments: diff --git a/simplyblock_cli/cli.py b/simplyblock_cli/cli.py index e9d481e8b1..ff17f20876 100755 --- a/simplyblock_cli/cli.py +++ b/simplyblock_cli/cli.py @@ -815,11 +815,6 @@ def init_storage_pool__add(self, subparser): subcommand.add_argument('cluster_id', help='The cluster id.', type=str) argument = subcommand.add_argument('--pool-max', help='Pool maximum size: 20M, 20G, 0. Default: `0`.', type=size_type(), default='0', dest='pool_max') argument = subcommand.add_argument('--lvol-max', help='Logical volume maximum size: 20M, 20G, 0. Default: `0`.', type=size_type(), default='0', dest='lvol_max') - argument = subcommand.add_argument('--max-rw-iops', help='Maximum Read Write IO Per Second.', type=int, dest='max_rw_iops') - argument = subcommand.add_argument('--max-rw-mbytes', help='Maximum Read Write Megabytes Per Second.', type=int, dest='max_rw_mbytes') - argument = subcommand.add_argument('--max-r-mbytes', help='Maximum Read Megabytes Per Second.', type=int, dest='max_r_mbytes') - argument = subcommand.add_argument('--max-w-mbytes', help='Maximum Write Megabytes Per Second.', type=int, dest='max_w_mbytes') - argument = subcommand.add_argument('--qos-host', help='The node id for QoS pool.', type=str, dest='qos_host', required=False) argument = subcommand.add_argument('--dhchap', help='Enable DH-HMAC-CHAP authentication for all volumes in the pool.', default=False, dest='dhchap', action='store_true') def init_storage_pool__set(self, subparser): @@ -827,10 +822,6 @@ def init_storage_pool__set(self, subparser): subcommand.add_argument('pool_id', help='The storage pool id.', type=str) argument = subcommand.add_argument('--pool-max', help='Pool maximum size: 20M, 20G.', type=size_type(), dest='pool_max') argument = subcommand.add_argument('--lvol-max', help='Logical volume maximum size: 20M, 20G.', type=size_type(), dest='lvol_max') - argument = subcommand.add_argument('--max-rw-iops', help='Maximum Read Write IO Per Second.', type=int, dest='max_rw_iops') - argument = subcommand.add_argument('--max-rw-mbytes', help='Maximum Read Write Megabytes Per Second.', type=int, dest='max_rw_mbytes') - argument = subcommand.add_argument('--max-r-mbytes', help='Maximum Read Megabytes Per Second.', type=int, dest='max_r_mbytes') - argument = subcommand.add_argument('--max-w-mbytes', help='Maximum Write Megabytes Per Second.', type=int, dest='max_w_mbytes') def init_storage_pool__list(self, subparser): subcommand = self.add_sub_command(subparser, 'list', 'Lists all storage pools.') diff --git a/simplyblock_cli/clibase.py b/simplyblock_cli/clibase.py index 501ca00021..16382df629 100755 --- a/simplyblock_cli/clibase.py +++ b/simplyblock_cli/clibase.py @@ -719,29 +719,14 @@ def control_plane__remove(self, sub_command, args): def storage_pool__add(self, sub_command, args): return pool_controller.add_pool( args.name, - args.pool_max, - args.lvol_max, - args.max_rw_iops, - args.max_rw_mbytes, - args.max_r_mbytes, - args.max_w_mbytes, - args.cluster_id, - args.qos_host, + pool_max=args.pool_max, + lvol_max=args.lvol_max, + cluster_id=args.cluster_id, dhchap=args.dhchap, ) def storage_pool__set(self, sub_command, args): - pool_max = args.pool_max - lvol_max = args.lvol_max - - ret, err = pool_controller.set_pool( - args.pool_id, - pool_max, - lvol_max, - args.max_rw_iops, - args.max_rw_mbytes, - args.max_r_mbytes, - args.max_w_mbytes) + ret, err = pool_controller.set_pool(args.pool_id, args.pool_max, args.lvol_max) return ret def storage_pool__list(self, sub_command, args): diff --git a/simplyblock_core/controllers/pool_controller.py b/simplyblock_core/controllers/pool_controller.py index 68e4afa54e..41d9e3ec5f 100644 --- a/simplyblock_core/controllers/pool_controller.py +++ b/simplyblock_core/controllers/pool_controller.py @@ -23,8 +23,8 @@ def _generate_string(length): string.ascii_letters + string.digits) for _ in range(length)) -def add_pool(name, pool_max, lvol_max, max_rw_iops, max_rw_mbytes, max_r_mbytes, max_w_mbytes, cluster_id, - cr_name=None, cr_namespace=None, cr_plural=None, qos_host=None, sec_options=None, dhchap=False): +def add_pool(name, pool_max=0, lvol_max=0, max_rw_iops=0, max_rw_mbytes=0, max_r_mbytes=0, max_w_mbytes=0, + cluster_id=None, cr_name=None, cr_namespace=None, cr_plural=None, qos_host=None, sec_options=None, dhchap=False): db_controller = DBController() if not name: logger.error("Pool name is empty!") diff --git a/simplyblock_web/api/v1/pool.py b/simplyblock_web/api/v1/pool.py index 09709a3f47..b7bdcabace 100644 --- a/simplyblock_web/api/v1/pool.py +++ b/simplyblock_web/api/v1/pool.py @@ -49,10 +49,7 @@ def add_pool(): | cluster_id (required) | Cluster uuid | pool_max | Pool maximum size: 10M, 10G, 10(bytes) | lvol_max | LVol maximum size: 10M, 10G, 10(bytes) - | max_rw_iops | Maximum Read Write IO Per Second - | max_rw_mbytes | Maximum Read Write Mega Bytes Per Second - | max_r_mbytes | Maximum Read Mega Bytes Per Second - | max_w_mbytes | Maximum Write Mega Bytes Per Second + | dhchap | Enable DHCHAP authentication for this pool's lvols. Default false. """ pool_data = request.get_json() if 'name' not in pool_data: @@ -75,17 +72,15 @@ def add_pool(): if 'lvol_max' in pool_data: lvol_max_size = core_utils.parse_size(pool_data['lvol_max']) - max_rw_iops = utils.get_int_value_or_default(pool_data, "max_rw_iops", 0) - max_rw_mbytes = utils.get_int_value_or_default(pool_data, "max_rw_mbytes", 0) - max_r_mbytes_per_sec = utils.get_int_value_or_default(pool_data, "max_r_mbytes", 0) - max_w_mbytes_per_sec = utils.get_int_value_or_default(pool_data, "max_w_mbytes", 0) - dhchap = bool(pool_data.get('dhchap', False)) ret = pool_controller.add_pool( - name, pool_max_size, lvol_max_size, max_rw_iops, max_rw_mbytes, - max_r_mbytes_per_sec, max_w_mbytes_per_sec, cluster_id, - dhchap=dhchap) + name, + pool_max=pool_max_size, + lvol_max=lvol_max_size, + cluster_id=cluster_id, + dhchap=dhchap + ) return utils.get_response(ret) @@ -135,18 +130,6 @@ def update_pool(uuid): if 'lvol_max' in pool_data: fn_params['lvol_max'] = core_utils.parse_size(pool_data['lvol_max']) - if 'max_rw_iops' in pool_data: - fn_params['max_rw_iops'] = core_utils.parse_size(pool_data['max_rw_iops']) - - if 'max_rw_mbytes' in pool_data: - fn_params['max_rw_mbytes'] = core_utils.parse_size(pool_data['max_rw_mbytes']) - - if 'max_r_mbytes' in pool_data: - fn_params['max_r_mbytes'] = core_utils.parse_size(pool_data['max_r_mbytes']) - - if 'max_w_mbytes' in pool_data: - fn_params['max_w_mbytes'] = core_utils.parse_size(pool_data['max_w_mbytes']) - ret, err = pool_controller.set_pool(**fn_params) return utils.get_response(ret, err) diff --git a/simplyblock_web/api/v2/pool.py b/simplyblock_web/api/v2/pool.py index b880911fe4..2ec7b5d5a6 100644 --- a/simplyblock_web/api/v2/pool.py +++ b/simplyblock_web/api/v2/pool.py @@ -32,10 +32,6 @@ class StoragePoolParams(BaseModel): name: str pool_max: util.Unsigned = 0 volume_max_size: util.Unsigned = 0 - max_rw_iops: util.Unsigned = 0 - max_rw_mbytes: util.Unsigned = 0 - max_r_mbytes: util.Unsigned = 0 - max_w_mbytes: util.Unsigned = 0 dhchap: bool = False cr_name: str = "" cr_namespace: str = "" @@ -48,11 +44,15 @@ def add(request: Request, cluster: Cluster, parameters: StoragePoolParams) -> Re if pool.pool_name == parameters.name: raise HTTPException(409, f'Pool {parameters.name} already exists') - id_or_false = pool_controller.add_pool( - parameters.name, parameters.pool_max, parameters.volume_max_size, parameters.max_rw_iops, parameters.max_rw_mbytes, - parameters.max_r_mbytes, parameters.max_w_mbytes, cluster.get_id(), - parameters.cr_name, parameters.cr_namespace, parameters.cr_plural, + id_or_false = pool_controller.add_pool( + parameters.name, + pool_max=parameters.pool_max, + lvol_max=parameters.volume_max_size, + cluster_id=cluster.get_id(), dhchap=parameters.dhchap, + cr_name=parameters.cr_name, + cr_namespace=parameters.cr_namespace, + cr_plural=parameters.cr_plural, ) if not id_or_false: @@ -99,10 +99,6 @@ class UpdatableStoragePoolParams(BaseModel): name: Optional[str] = None max_size: Optional[util.Unsigned] = None volume_max_size: Optional[util.Unsigned] = None - max_rw_iops: Optional[util.Unsigned] = None - max_rw_mbytes: Optional[util.Unsigned] = None - max_r_mbytes: Optional[util.Unsigned] = None - max_w_mbytes: Optional[util.Unsigned] = None lvols_cr_name: Optional[str] = None lvols_cr_namespace: Optional[str] = None lvols_cr_plural: Optional[str] = None From 15d32fc3316d2b89f86405be521e4942e2d9ff5e Mon Sep 17 00:00:00 2001 From: hamdykhader Date: Wed, 10 Jun 2026 04:12:31 +0300 Subject: [PATCH 2/2] Fix linter issue --- scripts/aws_capacity_namespace_churn_soak.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/aws_capacity_namespace_churn_soak.py b/scripts/aws_capacity_namespace_churn_soak.py index bc2b588fef..8a980f065a 100644 --- a/scripts/aws_capacity_namespace_churn_soak.py +++ b/scripts/aws_capacity_namespace_churn_soak.py @@ -58,7 +58,6 @@ import shlex import signal import subprocess -import sys import threading import time from collections import defaultdict