sbcli-pre 1.4.5__zip → 1.4.7__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/PKG-INFO +1 -1
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/env_var +1 -1
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/sbcli_pre.egg-info/PKG-INFO +1 -1
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_cli/cli.py +8 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/caching_node_controller.py +82 -28
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/lvol_controller.py +8 -2
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/README.md +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/pyproject.toml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/sbcli_pre.egg-info/SOURCES.txt +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/sbcli_pre.egg-info/dependency_links.txt +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/sbcli_pre.egg-info/entry_points.txt +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/sbcli_pre.egg-info/requires.txt +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/sbcli_pre.egg-info/top_level.txt +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/setup.cfg +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/setup.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_cli/main.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/__init__.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/cluster_ops.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/cnode_client.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/compute_node_ops.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/constants.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/__init__.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/cluster_events.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/device_controller.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/device_events.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/events_controller.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/health_controller.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/lvol_events.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/mgmt_events.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/pool_controller.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/pool_events.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/snapshot_controller.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/snapshot_events.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/storage_events.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/tasks_controller.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/controllers/tasks_events.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/distr_controller.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/kv_store.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/mgmt_node_ops.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/__init__.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/base_model.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/caching_node.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/cluster.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/compute_node.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/deployer.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/events.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/global_settings.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/iface.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/job_schedule.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/lvol_model.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/mgmt_node.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/nvme_device.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/pool.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/port_stat.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/snapshot.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/stats.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/models/storage_node.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/pci_utils.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/rpc_client.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/__init__.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2 +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/alerting/alert_rules.yaml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/clean_local_storage_deploy.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/config_docker.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/dashboard.yml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/dashboards/cluster.json +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/dashboards/devices.json +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/dashboards/lvols.json +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/dashboards/node-exporter.json +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/dashboards/nodes.json +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/dashboards/pools.json +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/datasource.yml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/db_config_double.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/db_config_single.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/deploy_stack.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/docker-compose-swarm.yml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/haproxy.cfg +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/install_deps.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/objstore.yml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/prometheus.yml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/run_ssh.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/set_db_config.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/stack_deploy_wait.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/__init__.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/caching_node_monitor.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/cap_monitor.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/capacity_and_stats_collector.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/device_monitor.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/distr_event_collector.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/health_check_service.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/install_service.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/log_agg_service.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/lvol_monitor.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/lvol_stat_collector.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/mgmt_node_monitor.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/port_stat_collector.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/remove_service.sh +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/service_template.service +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/storage_node_monitor.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/tasks_runner_migration.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/tasks_runner_restart.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/shell_utils.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/snode_client.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/storage_node_ops.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/utils.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/__init__.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/app.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/auth_middleware.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/__init__.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/caching_node_ops.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/caching_node_ops_k8s.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/node_api_basic.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/node_api_caching_docker.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/node_api_caching_ks.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/snode_ops.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/web_api_caching_node.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/web_api_cluster.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/web_api_deployer.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/web_api_device.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/web_api_lvol.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/web_api_mgmt_node.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/web_api_pool.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/web_api_snapshot.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/blueprints/web_api_storage_node.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/caching_node_app.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/caching_node_app_k8s.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/node_utils.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/node_webapp.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/snode_app.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/static/delete.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/static/deploy.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/static/deploy_cnode.yaml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/static/deploy_spdk.yaml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/static/is_up.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/static/list_deps.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/static/rpac.yaml +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/static/tst.py +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/templates/deploy_spdk.yaml.j2 +0 -0
- {sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_web/utils.py +0 -0
@@ -608,6 +608,12 @@ class CLIWrapper:
|
|
608
608
|
sub_command = self.add_sub_command(subparser, 'recreate', 'recreate Caching node bdevs')
|
609
609
|
sub_command.add_argument("node_id", help='Caching node UUID')
|
610
610
|
|
611
|
+
sub_command = self.add_sub_command(subparser, 'get-lvol-stats', 'Get LVol stats')
|
612
|
+
sub_command.add_argument("node_id", help='Caching node UUID')
|
613
|
+
sub_command.add_argument("lvol_id", help='LVol UUID')
|
614
|
+
sub_command.add_argument("--duration", help='collection duration in seconds, default: 5', type=int, default=5)
|
615
|
+
|
616
|
+
|
611
617
|
def init_parser(self):
|
612
618
|
self.parser = argparse.ArgumentParser(prog=constants.SIMPLY_BLOCK_CLI_NAME, description='SimplyBlock management CLI')
|
613
619
|
self.parser.add_argument("-d", '--debug', help='Print debug messages', required=False, action='store_true')
|
@@ -1104,6 +1110,8 @@ class CLIWrapper:
|
|
1104
1110
|
if sub_command == "recreate":
|
1105
1111
|
ret = caching_node_controller.recreate(args.node_id)
|
1106
1112
|
|
1113
|
+
if sub_command == "get-lvol-stats":
|
1114
|
+
ret = caching_node_controller.get_lvol_stats(args.node_id, args.lvol_id, args.duration)
|
1107
1115
|
|
1108
1116
|
else:
|
1109
1117
|
self.parser.print_help()
|
@@ -211,43 +211,57 @@ def add_node(cluster_id, node_ip, iface_name, data_nics_list, spdk_cpu_mask, spd
|
|
211
211
|
|
212
212
|
ssd_size = ssd_dev.size
|
213
213
|
supported_ssd_size = mem * 100 / 2.25
|
214
|
+
split_factor = math.ceil(ssd_size/supported_ssd_size)
|
214
215
|
|
215
216
|
logger.info(f"Supported SSD size: {utils.humanbytes(supported_ssd_size)}")
|
216
217
|
logger.info(f"SSD size: {utils.humanbytes(ssd_size)}")
|
217
218
|
|
219
|
+
cache_size = 0
|
220
|
+
cache_bdev = None
|
218
221
|
if supported_ssd_size < ssd_size:
|
219
|
-
logger.info(f"SSD size is bigger than the supported size,
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
logger.error(f"Failed to start nbd dev")
|
225
|
-
return False
|
226
|
-
|
227
|
-
jm_percent = int((supported_ssd_size/ssd_size) * 100)
|
228
|
-
result, error = cnode_api.make_gpt_partitions(nbd_device, jm_percent)
|
229
|
-
if error:
|
230
|
-
logger.error(f"Failed to make partitions")
|
231
|
-
logger.error(error)
|
232
|
-
return False
|
233
|
-
time.sleep(3)
|
234
|
-
rpc_client.nbd_stop_disk(nbd_device)
|
235
|
-
time.sleep(1)
|
236
|
-
rpc_client.bdev_nvme_detach_controller(ssd_dev.nvme_controller)
|
237
|
-
time.sleep(1)
|
238
|
-
rpc_client.bdev_nvme_controller_attach(ssd_dev.nvme_controller, ssd_dev.pcie_address)
|
239
|
-
time.sleep(1)
|
240
|
-
rpc_client.bdev_examine(ssd_dev.nvme_bdev)
|
241
|
-
time.sleep(1)
|
242
|
-
|
243
|
-
cache_bdev = f"{ssd_dev.nvme_bdev}p1"
|
244
|
-
cache_size = int(supported_ssd_size)
|
245
|
-
|
222
|
+
logger.info(f"SSD size is bigger than the supported size, will use split bdev: {split_factor}")
|
223
|
+
ret = rpc_client.bdev_split(ssd_dev.nvme_bdev, split_factor)
|
224
|
+
cache_bdev = ret[0]
|
225
|
+
cache_size = int(ssd_dev.size/split_factor)
|
226
|
+
snode.cache_split_factor = split_factor
|
246
227
|
else:
|
247
|
-
|
228
|
+
snode.cache_split_factor = 0
|
248
229
|
cache_bdev = ssd_dev.nvme_bdev
|
249
230
|
cache_size = ssd_dev.size
|
250
231
|
|
232
|
+
# if supported_ssd_size < ssd_size:
|
233
|
+
# logger.info(f"SSD size is bigger than the supported size, creating partition")
|
234
|
+
#
|
235
|
+
# nbd_device = rpc_client.nbd_start_disk(ssd_dev.nvme_bdev)
|
236
|
+
# time.sleep(3)
|
237
|
+
# if not nbd_device:
|
238
|
+
# logger.error(f"Failed to start nbd dev")
|
239
|
+
# return False
|
240
|
+
#
|
241
|
+
# jm_percent = int((supported_ssd_size/ssd_size) * 100)
|
242
|
+
# result, error = cnode_api.make_gpt_partitions(nbd_device, jm_percent)
|
243
|
+
# if error:
|
244
|
+
# logger.error(f"Failed to make partitions")
|
245
|
+
# logger.error(error)
|
246
|
+
# return False
|
247
|
+
# time.sleep(3)
|
248
|
+
# rpc_client.nbd_stop_disk(nbd_device)
|
249
|
+
# time.sleep(1)
|
250
|
+
# rpc_client.bdev_nvme_detach_controller(ssd_dev.nvme_controller)
|
251
|
+
# time.sleep(1)
|
252
|
+
# rpc_client.bdev_nvme_controller_attach(ssd_dev.nvme_controller, ssd_dev.pcie_address)
|
253
|
+
# time.sleep(1)
|
254
|
+
# rpc_client.bdev_examine(ssd_dev.nvme_bdev)
|
255
|
+
# time.sleep(1)
|
256
|
+
#
|
257
|
+
# cache_bdev = f"{ssd_dev.nvme_bdev}p1"
|
258
|
+
# cache_size = int(supported_ssd_size)
|
259
|
+
#
|
260
|
+
# else:
|
261
|
+
#
|
262
|
+
# cache_bdev = ssd_dev.nvme_bdev
|
263
|
+
# cache_size = ssd_dev.size
|
264
|
+
|
251
265
|
logger.info(f"Cache size: {utils.humanbytes(cache_size)}")
|
252
266
|
|
253
267
|
snode.cache_bdev = cache_bdev
|
@@ -717,3 +731,43 @@ def remove_node(node_id, force=False):
|
|
717
731
|
|
718
732
|
snode.remove(db_controller.kv_store)
|
719
733
|
logger.info("done")
|
734
|
+
|
735
|
+
|
736
|
+
def get_lvol_stats(caching_node_id, lvol_id, duration=5):
|
737
|
+
db_controller = DBController()
|
738
|
+
cnode = db_controller.get_caching_node_by_id(caching_node_id)
|
739
|
+
if not cnode:
|
740
|
+
logger.info(f"Caching node uuid not found: {caching_node_id}")
|
741
|
+
cnode = db_controller.get_caching_node_by_hostname(caching_node_id)
|
742
|
+
if not cnode:
|
743
|
+
logger.error("Caching node not found")
|
744
|
+
return False
|
745
|
+
|
746
|
+
lvol = db_controller.get_lvol_by_id(lvol_id)
|
747
|
+
if not lvol:
|
748
|
+
logger.error(f"LVol not found: {lvol_id}")
|
749
|
+
return False
|
750
|
+
|
751
|
+
rpc_client = RPCClient(
|
752
|
+
cnode.mgmt_ip, cnode.rpc_port,
|
753
|
+
cnode.rpc_username, cnode.rpc_password,
|
754
|
+
timeout=3, retry=2)
|
755
|
+
|
756
|
+
ocf_bdev = None
|
757
|
+
for lv in cnode.lvols:
|
758
|
+
if lv.lvol_id == lvol.get_id():
|
759
|
+
ocf_bdev = lv.ocf_bdev
|
760
|
+
|
761
|
+
if not ocf_bdev:
|
762
|
+
logger.error(f"LVol is not connected to caching node")
|
763
|
+
return False
|
764
|
+
|
765
|
+
logger.info("Getting bdev stats: %s", ocf_bdev)
|
766
|
+
|
767
|
+
while True:
|
768
|
+
stats_dict = rpc_client.get_lvol_stats(ocf_bdev)
|
769
|
+
print(datetime.datetime.now())
|
770
|
+
print(json.dumps(stats_dict, indent=2))
|
771
|
+
time.sleep(duration)
|
772
|
+
|
773
|
+
return True
|
@@ -9,9 +9,8 @@ import uuid
|
|
9
9
|
from typing import Tuple
|
10
10
|
|
11
11
|
from simplyblock_core import utils, constants, distr_controller
|
12
|
-
from simplyblock_core.controllers import snapshot_controller, pool_controller, lvol_events
|
12
|
+
from simplyblock_core.controllers import snapshot_controller, pool_controller, lvol_events, caching_node_controller
|
13
13
|
from simplyblock_core.kv_store import DBController
|
14
|
-
from simplyblock_core.models.cluster import Cluster
|
15
14
|
from simplyblock_core.models.nvme_device import NVMeDevice
|
16
15
|
from simplyblock_core.models.pool import Pool
|
17
16
|
from simplyblock_core.models.lvol_model import LVol
|
@@ -1016,6 +1015,13 @@ def delete_lvol(id_or_name, force_delete=False):
|
|
1016
1015
|
lvol.status = LVol.STATUS_IN_DELETION
|
1017
1016
|
lvol.write_to_db(db_controller.kv_store)
|
1018
1017
|
|
1018
|
+
# disconnect from caching nodes:
|
1019
|
+
cnodes = db_controller.get_caching_nodes()
|
1020
|
+
for cnode in cnodes:
|
1021
|
+
for lv in cnode.lvols:
|
1022
|
+
if lv.lvol_id == lvol.get_id():
|
1023
|
+
caching_node_controller.disconnect(cnode.get_id(), lvol.get_id())
|
1024
|
+
|
1019
1025
|
if lvol.ha_type == 'single':
|
1020
1026
|
ret = delete_lvol_from_node(lvol.get_id(), lvol.node_id)
|
1021
1027
|
if not ret:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sbcli_pre-1.4.5 → sbcli_pre-1.4.7}/simplyblock_core/services/capacity_and_stats_collector.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|