sbcli-pre 1.1.0__zip → 1.1.2__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.1.0 → sbcli_pre-1.1.2}/PKG-INFO +1 -1
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/env_var +1 -1
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/sbcli_pre.egg-info/PKG-INFO +1 -1
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_cli/cli.py +39 -68
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/constants.py +1 -1
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/device_controller.py +4 -2
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/lvol_controller.py +2 -1
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/snapshot_controller.py +3 -2
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/storage_node.py +4 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/rpc_client.py +29 -3
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/tasks_runner_migration.py +3 -1
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/tasks_runner_restart.py +25 -17
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/storage_node_ops.py +89 -11
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/utils.py +45 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/snode_ops.py +1 -14
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/web_api_storage_node.py +1 -9
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/README.md +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/pyproject.toml +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/sbcli_pre.egg-info/SOURCES.txt +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/sbcli_pre.egg-info/dependency_links.txt +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/sbcli_pre.egg-info/entry_points.txt +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/sbcli_pre.egg-info/requires.txt +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/sbcli_pre.egg-info/top_level.txt +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/setup.cfg +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/setup.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_cli/main.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/__init__.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/cluster_ops.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/cnode_client.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/compute_node_ops.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/__init__.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/caching_node_controller.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/cluster_events.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/device_events.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/events_controller.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/health_controller.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/lvol_events.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/mgmt_events.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/pool_controller.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/pool_events.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/snapshot_events.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/storage_events.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/tasks_controller.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/controllers/tasks_events.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/distr_controller.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/kv_store.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/mgmt_node_ops.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/__init__.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/base_model.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/caching_node.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/cluster.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/compute_node.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/events.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/global_settings.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/iface.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/job_schedule.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/lvol_model.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/mgmt_node.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/nvme_device.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/pool.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/port_stat.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/snapshot.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/models/stats.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/pci_utils.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/__init__.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/alerting/alert_resources.yaml +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/alerting/alert_rules.yaml +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/clean_local_storage_deploy.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/config_docker.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/dashboards/cluster.json +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/dashboards/devices.json +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/dashboards/lvols.json +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/dashboards/node-exporter.json +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/dashboards/nodes.json +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/dashboards/pools.json +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/datasource.yml +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/db_config_double.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/db_config_single.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/deploy_stack.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/docker-compose-swarm.yml +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/haproxy.cfg +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/install_deps.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/prometheus.yml +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/run_ssh.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/set_db_config.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/scripts/stack_deploy_wait.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/__init__.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/caching_node_monitor.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/cap_monitor.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/capacity_and_stats_collector.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/device_monitor.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/distr_event_collector.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/health_check_service.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/install_service.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/log_agg_service.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/lvol_monitor.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/lvol_stat_collector.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/mgmt_node_monitor.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/port_stat_collector.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/remove_service.sh +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/service_template.service +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/services/storage_node_monitor.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/shell_utils.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_core/snode_client.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/__init__.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/app.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/auth_middleware.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/__init__.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/caching_node_ops.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/caching_node_ops_k8s.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/node_api_basic.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/node_api_caching_docker.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/node_api_caching_ks.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/web_api_caching_node.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/web_api_cluster.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/web_api_device.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/web_api_lvol.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/web_api_mgmt_node.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/web_api_pool.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/blueprints/web_api_snapshot.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/caching_node_app.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/caching_node_app_k8s.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/node_utils.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/node_webapp.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/snode_app.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/static/delete.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/static/deploy.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/static/deploy_cnode.yaml +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/static/deploy_spdk.yaml +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/static/is_up.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/static/list_deps.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/static/rpac.yaml +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/static/tst.py +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/templates/deploy_spdk.yaml.j2 +0 -0
- {sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/simplyblock_web/utils.py +0 -0
@@ -277,7 +277,8 @@ def _create_storage_device_stack(rpc_client, nvme, snode, after_restart):
|
|
277
277
|
pba_init_mode = 3
|
278
278
|
if after_restart:
|
279
279
|
pba_init_mode = 2
|
280
|
-
ret = rpc_client.bdev_alceml_create(alceml_name, test_name, alceml_id, pba_init_mode=pba_init_mode
|
280
|
+
ret = rpc_client.bdev_alceml_create(alceml_name, test_name, alceml_id, pba_init_mode=pba_init_mode,
|
281
|
+
dev_cpu_mask=snode.dev_cpu_mask)
|
281
282
|
if not ret:
|
282
283
|
logger.error(f"Failed to create alceml bdev: {alceml_name}")
|
283
284
|
return False
|
@@ -479,7 +480,7 @@ def _connect_to_remote_devs(this_node):
|
|
479
480
|
return remote_devices
|
480
481
|
|
481
482
|
|
482
|
-
def add_node(cluster_id, node_ip, iface_name, data_nics_list,
|
483
|
+
def add_node(cluster_id, node_ip, iface_name, data_nics_list,
|
483
484
|
spdk_mem, spdk_image=None, spdk_debug=False,
|
484
485
|
small_pool_count=0, large_pool_count=0, small_bufsize=0, large_bufsize=0,
|
485
486
|
num_partitions_per_dev=0, jm_percent=0):
|
@@ -553,6 +554,27 @@ def add_node(cluster_id, node_ip, iface_name, data_nics_list, spdk_cpu_mask,
|
|
553
554
|
spdk_mem = huge_free
|
554
555
|
logger.info(f"Using the free hugepages for spdk memory: {utils.humanbytes(huge_free)}")
|
555
556
|
|
557
|
+
# Tune cpu maks parameters
|
558
|
+
cpu_count = node_info["cpu_count"]
|
559
|
+
pollers_mask = ""
|
560
|
+
app_thread_mask = ""
|
561
|
+
dev_cpu_mask = ""
|
562
|
+
if cpu_count < 8:
|
563
|
+
mask = (1 << (cpu_count - 1)) - 1
|
564
|
+
mask <<= 1
|
565
|
+
spdk_cpu_mask = f'0x{mask:X}'
|
566
|
+
os_cores = [0]
|
567
|
+
else:
|
568
|
+
os_cores, nvme_pollers_cores, app_thread_core, dev_cpu_cores = \
|
569
|
+
utils.calculate_core_allocation(cpu_count)
|
570
|
+
spdk_cores = nvme_pollers_cores + app_thread_core + dev_cpu_cores
|
571
|
+
|
572
|
+
pollers_mask = utils.generate_mask(nvme_pollers_cores)
|
573
|
+
app_thread_mask = utils.generate_mask(app_thread_core)
|
574
|
+
spdk_cpu_mask = utils.generate_mask(spdk_cores)
|
575
|
+
dev_cpu_mask = utils.generate_mask(dev_cpu_cores)
|
576
|
+
|
577
|
+
|
556
578
|
logger.info("Joining docker swarm...")
|
557
579
|
cluster_docker = utils.get_docker_client(cluster_id)
|
558
580
|
cluster_ip = cluster_docker.info()["Swarm"]["NodeAddr"]
|
@@ -630,6 +652,10 @@ def add_node(cluster_id, node_ip, iface_name, data_nics_list, spdk_cpu_mask,
|
|
630
652
|
snode.spdk_image = spdk_image or ""
|
631
653
|
snode.spdk_debug = spdk_debug or 0
|
632
654
|
snode.write_to_db(kv_store)
|
655
|
+
snode.app_thread_mask = app_thread_mask or ""
|
656
|
+
snode.pollers_mask = pollers_mask or ""
|
657
|
+
snode.dev_cpu_mask = dev_cpu_mask or ""
|
658
|
+
snode.os_cores = os_cores or []
|
633
659
|
|
634
660
|
snode.iobuf_small_pool_count = small_pool_count or 0
|
635
661
|
snode.iobuf_large_pool_count = large_pool_count or 0
|
@@ -656,13 +682,41 @@ def add_node(cluster_id, node_ip, iface_name, data_nics_list, spdk_cpu_mask,
|
|
656
682
|
logger.error("Failed to set iobuf options")
|
657
683
|
return False
|
658
684
|
|
659
|
-
# 2-
|
685
|
+
# 2- set socket implementation options
|
686
|
+
ret = rpc_client.sock_impl_set_options()
|
687
|
+
if not ret:
|
688
|
+
logger.error("Failed socket implement set options")
|
689
|
+
return False
|
690
|
+
|
691
|
+
# 3- set nvme config
|
692
|
+
if snode.pollers_mask:
|
693
|
+
ret = rpc_client.nvmf_set_config(snode.pollers_mask)
|
694
|
+
if not ret:
|
695
|
+
logger.error("Failed to set pollers mask")
|
696
|
+
return False
|
697
|
+
|
698
|
+
# 4- start spdk framework
|
660
699
|
ret = rpc_client.framework_start_init()
|
661
700
|
if not ret:
|
662
701
|
logger.error("Failed to start framework")
|
663
702
|
return False
|
664
703
|
|
665
|
-
#
|
704
|
+
# 5- set app_thread cpu mask
|
705
|
+
if snode.app_thread_mask:
|
706
|
+
ret = rpc_client.thread_get_stats()
|
707
|
+
app_thread_process_id = 0
|
708
|
+
if ret.get("threads"):
|
709
|
+
for entry in ret["threads"]:
|
710
|
+
if entry['name'] == 'app_thread':
|
711
|
+
app_thread_process_id = entry['id']
|
712
|
+
break
|
713
|
+
|
714
|
+
ret = rpc_client.thread_set_cpumask(app_thread_process_id, snode.app_thread_mask)
|
715
|
+
if not ret:
|
716
|
+
logger.error("Failed to set app thread mask")
|
717
|
+
return False
|
718
|
+
|
719
|
+
# 6- set nvme bdev options
|
666
720
|
ret = rpc_client.bdev_nvme_set_options()
|
667
721
|
if not ret:
|
668
722
|
logger.error("Failed to set nvme options")
|
@@ -1020,10 +1074,6 @@ def restart_storage_node(
|
|
1020
1074
|
logger.info(f"Node info: {node_info}")
|
1021
1075
|
|
1022
1076
|
logger.info("Restarting SPDK")
|
1023
|
-
cpu = snode.spdk_cpu_mask
|
1024
|
-
if spdk_cpu_mask:
|
1025
|
-
cpu = spdk_cpu_mask
|
1026
|
-
snode.spdk_cpu_mask = cpu
|
1027
1077
|
mem = snode.spdk_mem
|
1028
1078
|
if spdk_mem:
|
1029
1079
|
mem = spdk_mem
|
@@ -1039,7 +1089,7 @@ def restart_storage_node(
|
|
1039
1089
|
|
1040
1090
|
cluster_docker = utils.get_docker_client(snode.cluster_id)
|
1041
1091
|
cluster_ip = cluster_docker.info()["Swarm"]["NodeAddr"]
|
1042
|
-
results, err = snode_api.spdk_process_start(
|
1092
|
+
results, err = snode_api.spdk_process_start(snode.spdk_cpu_mask, mem, img, spdk_debug, cluster_ip)
|
1043
1093
|
|
1044
1094
|
if not results:
|
1045
1095
|
logger.error(f"Failed to start spdk: {err}")
|
@@ -1073,13 +1123,41 @@ def restart_storage_node(
|
|
1073
1123
|
logger.error("Failed to set iobuf options")
|
1074
1124
|
return False
|
1075
1125
|
|
1076
|
-
# 2-
|
1126
|
+
# 2- set socket implementation options
|
1127
|
+
ret = rpc_client.sock_impl_set_options()
|
1128
|
+
if not ret:
|
1129
|
+
logger.error("Failed socket implement set options")
|
1130
|
+
return False
|
1131
|
+
|
1132
|
+
# 3- set nvme config
|
1133
|
+
if snode.pollers_mask:
|
1134
|
+
ret = rpc_client.nvmf_set_config(snode.pollers_mask)
|
1135
|
+
if not ret:
|
1136
|
+
logger.error("Failed to set pollers mask")
|
1137
|
+
return False
|
1138
|
+
|
1139
|
+
# 4- start spdk framework
|
1077
1140
|
ret = rpc_client.framework_start_init()
|
1078
1141
|
if not ret:
|
1079
1142
|
logger.error("Failed to start framework")
|
1080
1143
|
return False
|
1081
1144
|
|
1082
|
-
#
|
1145
|
+
# 5- set app_thread cpu mask
|
1146
|
+
if snode.app_thread_mask:
|
1147
|
+
ret = rpc_client.thread_get_stats()
|
1148
|
+
app_thread_process_id = 0
|
1149
|
+
if ret.get("threads"):
|
1150
|
+
for entry in ret["threads"]:
|
1151
|
+
if entry['name'] == 'app_thread':
|
1152
|
+
app_thread_process_id = entry['id']
|
1153
|
+
break
|
1154
|
+
|
1155
|
+
ret = rpc_client.thread_set_cpumask(app_thread_process_id, snode.app_thread_mask)
|
1156
|
+
if not ret:
|
1157
|
+
logger.error("Failed to set app thread mask")
|
1158
|
+
return False
|
1159
|
+
|
1160
|
+
# 6- set nvme bdev options
|
1083
1161
|
ret = rpc_client.bdev_nvme_set_options()
|
1084
1162
|
if not ret:
|
1085
1163
|
logger.error("Failed to set nvme options")
|
@@ -280,3 +280,48 @@ def sum_records(records):
|
|
280
280
|
|
281
281
|
def get_random_vuid():
|
282
282
|
return 1 + int(random.random() * 10000)
|
283
|
+
|
284
|
+
|
285
|
+
def calculate_core_allocation(cpu_count):
|
286
|
+
'''
|
287
|
+
If number of cpu cores >= 8, tune cpu core mask
|
288
|
+
1. Never use core 0 for spdk.
|
289
|
+
2. For every 8 cores, leave one core to the operating system
|
290
|
+
3. Do not use more than 15% of remaining available cores for nvme pollers
|
291
|
+
4. Use one dedicated core for app_thread
|
292
|
+
5. distribute distrib bdevs and alceml bdevs to all other cores
|
293
|
+
JIRA ticket link/s
|
294
|
+
https://simplyblock.atlassian.net/browse/SFAM-885
|
295
|
+
'''
|
296
|
+
|
297
|
+
all_cores = list(range(0, cpu_count))
|
298
|
+
# Calculate the number of cores to exclude for the OS
|
299
|
+
if cpu_count == 8:
|
300
|
+
os_cores_count = 1
|
301
|
+
else:
|
302
|
+
os_cores_count = 1 + (cpu_count // 8)
|
303
|
+
|
304
|
+
# Calculate os cores
|
305
|
+
os_cores = all_cores[0:os_cores_count]
|
306
|
+
|
307
|
+
# Calculate available cores
|
308
|
+
available_cores_count = cpu_count - os_cores_count
|
309
|
+
|
310
|
+
# Calculate NVMe pollers
|
311
|
+
nvme_pollers_count = int(available_cores_count * 0.15)
|
312
|
+
nvme_pollers_cores = all_cores[os_cores_count:os_cores_count + nvme_pollers_count]
|
313
|
+
|
314
|
+
# Allocate core for app_thread
|
315
|
+
app_thread_core = all_cores[os_cores_count + nvme_pollers_count:os_cores_count + nvme_pollers_count + 1]
|
316
|
+
|
317
|
+
# Calculate bdb_lcpu cores
|
318
|
+
bdb_lcpu_cores = all_cores[os_cores_count + nvme_pollers_count + 1:]
|
319
|
+
|
320
|
+
return os_cores, nvme_pollers_cores, app_thread_core, bdb_lcpu_cores
|
321
|
+
|
322
|
+
|
323
|
+
def generate_mask(cores):
|
324
|
+
mask = 0
|
325
|
+
for core in cores:
|
326
|
+
mask |= (1 << core)
|
327
|
+
return f'0x{mask:X}'
|
@@ -81,23 +81,10 @@ def spdk_process_start():
|
|
81
81
|
spdk_cpu_mask = None
|
82
82
|
if 'spdk_cpu_mask' in data:
|
83
83
|
spdk_cpu_mask = data['spdk_cpu_mask']
|
84
|
+
|
84
85
|
spdk_mem = None
|
85
86
|
if 'spdk_mem' in data:
|
86
87
|
spdk_mem = data['spdk_mem']
|
87
|
-
node_cpu_count = os.cpu_count()
|
88
|
-
|
89
|
-
if spdk_cpu_mask:
|
90
|
-
try:
|
91
|
-
requested_cpu_count = len(format(int(spdk_cpu_mask, 16), 'b'))
|
92
|
-
if requested_cpu_count > node_cpu_count:
|
93
|
-
return utils.get_response(
|
94
|
-
False,
|
95
|
-
f"The requested cpu count: {requested_cpu_count} "
|
96
|
-
f"is larger than the node's cpu count: {node_cpu_count}")
|
97
|
-
except:
|
98
|
-
spdk_cpu_mask = hex(int(math.pow(2, node_cpu_count)) - 1)
|
99
|
-
else:
|
100
|
-
spdk_cpu_mask = hex(int(math.pow(2, node_cpu_count)) - 1)
|
101
88
|
|
102
89
|
if spdk_mem:
|
103
90
|
spdk_mem = int(utils.parse_size(spdk_mem) / (1000 * 1000))
|
@@ -180,14 +180,6 @@ def storage_node_add():
|
|
180
180
|
data_nics = req_data['data_nics']
|
181
181
|
data_nics = data_nics.split(",")
|
182
182
|
|
183
|
-
spdk_cpu_mask = None
|
184
|
-
if 'spdk_cpu_mask' in req_data:
|
185
|
-
msk = req_data['spdk_cpu_mask']
|
186
|
-
if utils.validate_cpu_mask(msk):
|
187
|
-
spdk_cpu_mask = msk
|
188
|
-
else:
|
189
|
-
return utils.get_response_error(f"Invalid cpu mask value: {msk}", 400)
|
190
|
-
|
191
183
|
spdk_mem = None
|
192
184
|
if 'spdk_mem' in req_data:
|
193
185
|
mem = req_data['spdk_mem']
|
@@ -196,7 +188,7 @@ def storage_node_add():
|
|
196
188
|
return utils.get_response_error(f"SPDK memory:{mem} must be larger than 1G", 400)
|
197
189
|
|
198
190
|
out = storage_node_ops.add_node(
|
199
|
-
cluster_id, node_ip, ifname, data_nics,
|
191
|
+
cluster_id, node_ip, ifname, data_nics, spdk_mem,
|
200
192
|
spdk_image=spdk_image, spdk_debug=spdk_debug)
|
201
193
|
|
202
194
|
return utils.get_response(out)
|
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
|
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.1.0 → sbcli_pre-1.1.2}/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
|
{sbcli_pre-1.1.0 → sbcli_pre-1.1.2}/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
|