sbcli-dev 4.0.5__zip → 4.0.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_dev-4.0.5 → sbcli_dev-4.0.7}/PKG-INFO +1 -1
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/env_var +1 -1
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/sbcli_dev.egg-info/PKG-INFO +1 -1
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/device_controller.py +77 -45
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/storage_node_ops.py +28 -9
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/README.md +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/pyproject.toml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/sbcli_dev.egg-info/SOURCES.txt +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/sbcli_dev.egg-info/dependency_links.txt +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/sbcli_dev.egg-info/entry_points.txt +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/sbcli_dev.egg-info/requires.txt +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/sbcli_dev.egg-info/top_level.txt +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/setup.cfg +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/setup.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_cli/cli.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_cli/main.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/__init__.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/cluster_ops.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/cnode_client.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/compute_node_ops.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/constants.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/__init__.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/caching_node_controller.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/cluster_events.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/device_events.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/events_controller.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/health_controller.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/lvol_controller.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/lvol_events.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/mgmt_events.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/pool_controller.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/pool_events.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/snapshot_controller.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/snapshot_events.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/storage_events.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/tasks_controller.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/controllers/tasks_events.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/distr_controller.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/kv_store.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/mgmt_node_ops.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/__init__.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/base_model.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/caching_node.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/cluster.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/compute_node.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/deployer.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/events.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/global_settings.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/iface.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/job_schedule.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/lvol_model.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/mgmt_node.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/nvme_device.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/pool.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/port_stat.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/snapshot.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/stats.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/models/storage_node.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/pci_utils.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/rpc_client.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/__init__.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2 +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/alerting/alert_rules.yaml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/clean_local_storage_deploy.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/config_docker.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/dashboard.yml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/dashboards/cluster.json +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/dashboards/devices.json +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/dashboards/lvols.json +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/dashboards/node-exporter.json +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/dashboards/nodes.json +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/dashboards/pools.json +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/datasource.yml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/db_config_double.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/db_config_single.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/deploy_stack.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/docker-compose-swarm.yml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/haproxy.cfg +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/install_deps.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/objstore.yml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/prometheus.yml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/run_ssh.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/set_db_config.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/scripts/stack_deploy_wait.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/__init__.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/cached_lvol_stat_collector.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/caching_node_monitor.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/cap_monitor.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/capacity_and_stats_collector.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/device_monitor.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/health_check_service.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/install_service.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/log_agg_service.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/lvol_monitor.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/lvol_stat_collector.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/main_distr_event_collector.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/mgmt_node_monitor.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/new_device_discovery.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/port_stat_collector.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/remove_service.sh +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/service_template.service +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/spdk_http_proxy_server.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/storage_node_monitor.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/tasks_runner_failed_migration.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/tasks_runner_migration.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/tasks_runner_new_dev_migration.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/tasks_runner_node_add.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/tasks_runner_restart.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/shell_utils.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/snode_client.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/utils.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/__init__.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/app.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/auth_middleware.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/__init__.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/caching_node_ops.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/caching_node_ops_k8s.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/node_api_basic.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/node_api_caching_docker.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/node_api_caching_ks.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/snode_ops.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/snode_ops_k8s.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/web_api_caching_node.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/web_api_cluster.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/web_api_deployer.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/web_api_device.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/web_api_lvol.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/web_api_mgmt_node.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/web_api_pool.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/web_api_snapshot.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/blueprints/web_api_storage_node.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/caching_node_app.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/caching_node_app_k8s.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/node_utils.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/node_webapp.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/snode_app.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/snode_app_k8s.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/static/delete.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/static/deploy.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/static/deploy_cnode.yaml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/static/deploy_spdk.yaml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/static/is_up.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/static/list_deps.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/static/rpac.yaml +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/static/tst.py +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/templates/caching_deploy_spdk.yaml.j2 +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/templates/storage_deploy_spdk.yaml.j2 +0 -0
- {sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_web/utils.py +0 -0
|
@@ -620,64 +620,91 @@ def add_device(device_id):
|
|
|
620
620
|
break
|
|
621
621
|
|
|
622
622
|
logger.info(f"Adding device {device_id}")
|
|
623
|
+
if snode.num_partitions_per_dev == 0:
|
|
624
|
+
ret = _def_create_device_stack(device_obj, snode)
|
|
625
|
+
if not ret:
|
|
626
|
+
logger.error("Failed to create device stack")
|
|
627
|
+
return False
|
|
628
|
+
dev_order = storage_node_ops.get_next_cluster_device_order(db_controller, snode.cluster_id)
|
|
629
|
+
device_obj.cluster_device_order = dev_order
|
|
630
|
+
logger.info("Setting device online")
|
|
631
|
+
device_obj.status = NVMeDevice.STATUS_ONLINE
|
|
632
|
+
snode.write_to_db(db_controller.kv_store)
|
|
633
|
+
device_events.device_create(device_obj)
|
|
623
634
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
635
|
+
logger.info("Make other nodes connect to the node devices")
|
|
636
|
+
snodes = db_controller.get_storage_nodes_by_cluster_id(snode.cluster_id)
|
|
637
|
+
for node in snodes:
|
|
638
|
+
if node.get_id() == snode.get_id() or node.status != StorageNode.STATUS_ONLINE:
|
|
639
|
+
continue
|
|
640
|
+
node.remote_devices = storage_node_ops._connect_to_remote_devs(node)
|
|
641
|
+
node.write_to_db()
|
|
628
642
|
|
|
629
|
-
|
|
630
|
-
|
|
643
|
+
tasks_controller.add_new_device_mig_task(device_id)
|
|
644
|
+
return device_id
|
|
631
645
|
|
|
632
|
-
logger.info("Setting device online")
|
|
633
|
-
device_obj.status = NVMeDevice.STATUS_ONLINE
|
|
634
|
-
snode.write_to_db(db_controller.kv_store)
|
|
635
646
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
647
|
+
# create partitions
|
|
648
|
+
partitions = snode.num_partitions_per_dev
|
|
649
|
+
rpc_client = RPCClient(snode.mgmt_ip, snode.rpc_port, snode.rpc_username, snode.rpc_password)
|
|
650
|
+
# look for partitions
|
|
651
|
+
partitioned_devices = storage_node_ops._search_for_partitions(rpc_client, device_obj)
|
|
652
|
+
logger.debug("partitioned_devices")
|
|
653
|
+
logger.debug(partitioned_devices)
|
|
654
|
+
if len(partitioned_devices) == partitions+1:
|
|
655
|
+
logger.info("Partitioned devices found")
|
|
656
|
+
else:
|
|
657
|
+
logger.info(f"Creating partitions for {device_obj.nvme_bdev}")
|
|
658
|
+
storage_node_ops._create_device_partitions(rpc_client, device_obj, snode, partitions, snode.jm_percent)
|
|
659
|
+
partitioned_devices = storage_node_ops._search_for_partitions(rpc_client, device_obj)
|
|
660
|
+
if len(partitioned_devices) == partitions+1:
|
|
661
|
+
logger.info("Device partitions created")
|
|
662
|
+
else:
|
|
663
|
+
logger.error("Failed to create partitions")
|
|
664
|
+
return False
|
|
643
665
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
666
|
+
jm_part = partitioned_devices.pop(0)
|
|
667
|
+
new_devices = []
|
|
668
|
+
dev_order = storage_node_ops.get_next_cluster_device_order(db_controller, snode.cluster_id)
|
|
669
|
+
for dev in partitioned_devices:
|
|
670
|
+
new_device = storage_node_ops._create_storage_device_stack(rpc_client, dev, snode, after_restart=False)
|
|
671
|
+
if not new_device:
|
|
672
|
+
logger.error("failed to create dev stack")
|
|
650
673
|
continue
|
|
651
674
|
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
idx = i
|
|
657
|
-
break
|
|
658
|
-
if idx >= 0:
|
|
659
|
-
node.remote_devices[idx] = device_obj
|
|
660
|
-
else:
|
|
661
|
-
node.remote_devices.append(device_obj)
|
|
662
|
-
node.write_to_db(db_controller.kv_store)
|
|
663
|
-
time.sleep(1)
|
|
675
|
+
new_device.cluster_device_order = dev_order
|
|
676
|
+
dev_order += 1
|
|
677
|
+
device_events.device_create(new_device)
|
|
678
|
+
new_devices.append(new_device)
|
|
664
679
|
|
|
665
|
-
|
|
680
|
+
if new_devices:
|
|
681
|
+
snode.nvme_devices.remove(device_obj)
|
|
682
|
+
snode.nvme_devices.extend(new_devices)
|
|
683
|
+
snode.write_to_db(db_controller.kv_store)
|
|
684
|
+
else:
|
|
685
|
+
logger.error("failed to create devices")
|
|
686
|
+
return False
|
|
666
687
|
|
|
667
|
-
|
|
688
|
+
logger.info("Make other nodes connect to the node devices")
|
|
689
|
+
snodes = db_controller.get_storage_nodes_by_cluster_id(snode.cluster_id)
|
|
690
|
+
for node in snodes:
|
|
691
|
+
if node.get_id() == snode.get_id() or node.status != StorageNode.STATUS_ONLINE:
|
|
692
|
+
continue
|
|
693
|
+
node.remote_devices = storage_node_ops._connect_to_remote_devs(node)
|
|
694
|
+
node.write_to_db()
|
|
668
695
|
|
|
669
|
-
|
|
696
|
+
for dev in new_devices:
|
|
697
|
+
tasks_controller.add_new_device_mig_task(dev.get_id())
|
|
670
698
|
|
|
671
699
|
# add to jm raid
|
|
672
|
-
if snode.jm_device and snode.jm_device.raid_bdev:
|
|
700
|
+
if snode.jm_device and snode.jm_device.raid_bdev and jm_part:
|
|
673
701
|
# looking for jm partition
|
|
674
|
-
|
|
675
|
-
jm_dev_part = f"{dev.nvme_bdev[:-1]}1"
|
|
702
|
+
jm_dev_part = jm_part.nvme_bdev
|
|
676
703
|
ret = rpc_client.get_bdevs(jm_dev_part)
|
|
677
704
|
if ret:
|
|
678
705
|
logger.info(f"JM part found: {jm_dev_part}")
|
|
679
|
-
if snode.jm_device.status
|
|
680
|
-
restart_jm_device(snode.jm_device.get_id(), force=True)
|
|
706
|
+
if snode.jm_device.status in [JMDevice.STATUS_UNAVAILABLE, JMDevice.STATUS_REMOVED]:
|
|
707
|
+
restart_jm_device(snode.jm_device.get_id(), force=True, format_alceml=True)
|
|
681
708
|
|
|
682
709
|
if snode.jm_device.status == JMDevice.STATUS_ONLINE and \
|
|
683
710
|
jm_dev_part not in snode.jm_device.jm_nvme_bdev_list:
|
|
@@ -714,6 +741,10 @@ def set_jm_device_state(device_id, state):
|
|
|
714
741
|
for node_index, node in enumerate(snodes):
|
|
715
742
|
if node.get_id() == snode.get_id() or node.status != StorageNode.STATUS_ONLINE:
|
|
716
743
|
continue
|
|
744
|
+
for jm_dev in node.remote_jm_devices:
|
|
745
|
+
if jm_dev.get_id() == device_id and jm_device.status != JMDevice.STATUS_ONLINE:
|
|
746
|
+
node.remote_jm_devices.remove(jm_dev)
|
|
747
|
+
break
|
|
717
748
|
logger.info(f"Connecting to node: {node.get_id()}")
|
|
718
749
|
node.remote_jm_devices = storage_node_ops._connect_to_remote_jm_devs(node)
|
|
719
750
|
node.write_to_db(db_controller.kv_store)
|
|
@@ -770,7 +801,7 @@ def remove_jm_device(device_id, force=False):
|
|
|
770
801
|
return True
|
|
771
802
|
|
|
772
803
|
|
|
773
|
-
def restart_jm_device(device_id, force=False):
|
|
804
|
+
def restart_jm_device(device_id, force=False, format_alceml=False):
|
|
774
805
|
db_controller = DBController()
|
|
775
806
|
jm_device = None
|
|
776
807
|
snode = None
|
|
@@ -796,13 +827,14 @@ def restart_jm_device(device_id, force=False):
|
|
|
796
827
|
for dev in snode.nvme_devices:
|
|
797
828
|
if dev.status != NVMeDevice.STATUS_ONLINE:
|
|
798
829
|
continue
|
|
799
|
-
dev_part = f"{dev.nvme_bdev[:-
|
|
830
|
+
dev_part = f"{dev.nvme_bdev[:-2]}p1"
|
|
800
831
|
if dev_part in bdevs_names:
|
|
801
832
|
if dev_part not in jm_nvme_bdevs:
|
|
802
833
|
jm_nvme_bdevs.append(dev_part)
|
|
803
834
|
|
|
804
835
|
if len(jm_nvme_bdevs) > 0:
|
|
805
|
-
new_jm = storage_node_ops._create_jm_stack_on_raid(
|
|
836
|
+
new_jm = storage_node_ops._create_jm_stack_on_raid(
|
|
837
|
+
rpc_client, jm_nvme_bdevs, snode, after_restart=not format_alceml)
|
|
806
838
|
if not new_jm:
|
|
807
839
|
logger.error("failed to create jm stack")
|
|
808
840
|
return False
|
|
@@ -514,15 +514,14 @@ def _create_storage_device_stack(rpc_client, nvme, snode, after_restart):
|
|
|
514
514
|
return nvme
|
|
515
515
|
|
|
516
516
|
|
|
517
|
-
def _create_device_partitions(rpc_client, nvme, snode):
|
|
517
|
+
def _create_device_partitions(rpc_client, nvme, snode, num_partitions_per_dev, jm_percent):
|
|
518
518
|
nbd_device = rpc_client.nbd_start_disk(nvme.nvme_bdev)
|
|
519
519
|
time.sleep(3)
|
|
520
520
|
if not nbd_device:
|
|
521
521
|
logger.error(f"Failed to start nbd dev")
|
|
522
522
|
return False
|
|
523
523
|
snode_api = SNodeClient(snode.api_endpoint)
|
|
524
|
-
result, error = snode_api.make_gpt_partitions(
|
|
525
|
-
nbd_device, snode.jm_percent, snode.num_partitions_per_dev)
|
|
524
|
+
result, error = snode_api.make_gpt_partitions(nbd_device, jm_percent, num_partitions_per_dev)
|
|
526
525
|
if error:
|
|
527
526
|
logger.error(f"Failed to make partitions")
|
|
528
527
|
logger.error(error)
|
|
@@ -563,7 +562,7 @@ def _prepare_cluster_devices_partitions(snode, devices):
|
|
|
563
562
|
logger.info("Partitioned devices found")
|
|
564
563
|
else:
|
|
565
564
|
logger.info(f"Creating partitions for {nvme.nvme_bdev}")
|
|
566
|
-
_create_device_partitions(rpc_client, nvme, snode)
|
|
565
|
+
_create_device_partitions(rpc_client, nvme, snode, snode.num_partitions_per_dev, snode.jm_percent)
|
|
567
566
|
partitioned_devices = _search_for_partitions(rpc_client, nvme)
|
|
568
567
|
if len(partitioned_devices) == (1 + snode.num_partitions_per_dev):
|
|
569
568
|
logger.info("Device partitions created")
|
|
@@ -798,16 +797,24 @@ def _connect_to_remote_jm_devs(this_node, jm_ids=[]):
|
|
|
798
797
|
if jm_ids:
|
|
799
798
|
for jm_id in jm_ids:
|
|
800
799
|
jm_dev = db_controller.get_jm_device_by_id(jm_id)
|
|
801
|
-
|
|
800
|
+
if jm_dev:
|
|
801
|
+
remote_devices.append(jm_dev)
|
|
802
802
|
elif len(this_node.remote_jm_devices) > 0:
|
|
803
803
|
remote_devices = this_node.remote_jm_devices
|
|
804
804
|
else:
|
|
805
805
|
for node in db_controller.get_storage_nodes_by_cluster_id(this_node.cluster_id):
|
|
806
806
|
if node.get_id() == this_node.get_id() or node.status != StorageNode.STATUS_ONLINE:
|
|
807
807
|
continue
|
|
808
|
-
if node.jm_device:
|
|
808
|
+
if node.jm_device and node.jm_device.status == JMDevice.STATUS_ONLINE:
|
|
809
809
|
remote_devices.append(node.jm_device)
|
|
810
810
|
|
|
811
|
+
if len(remote_devices) < 2:
|
|
812
|
+
online_jms = get_next_ha_jms(this_node)
|
|
813
|
+
for jm_id in online_jms:
|
|
814
|
+
jm_dev = db_controller.get_jm_device_by_id(jm_id)
|
|
815
|
+
if jm_dev:
|
|
816
|
+
remote_devices.append(jm_dev)
|
|
817
|
+
|
|
811
818
|
for jm_dev in remote_devices:
|
|
812
819
|
name = f"remote_{jm_dev.jm_bdev}"
|
|
813
820
|
bdev_name = f"{name}n1"
|
|
@@ -1354,6 +1361,10 @@ def remove_storage_node(node_id, force_remove=False, force_migrate=False):
|
|
|
1354
1361
|
distr_controller.disconnect_device(dev)
|
|
1355
1362
|
device_controller.device_set_failed(dev.get_id())
|
|
1356
1363
|
|
|
1364
|
+
if snode.jm_device:
|
|
1365
|
+
logger.info("Removing JM")
|
|
1366
|
+
device_controller.remove_jm_device(snode.jm_device.get_id(), force=True)
|
|
1367
|
+
|
|
1357
1368
|
logger.info("Removing storage node")
|
|
1358
1369
|
|
|
1359
1370
|
logger.debug("Leaving swarm...")
|
|
@@ -1687,6 +1698,7 @@ def restart_storage_node(
|
|
|
1687
1698
|
|
|
1688
1699
|
if snode.enable_ha_jm:
|
|
1689
1700
|
logger.info("Connecting to remote JMs")
|
|
1701
|
+
snode.remote_jm_devices = []
|
|
1690
1702
|
snode.remote_jm_devices = _connect_to_remote_jm_devs(snode)
|
|
1691
1703
|
|
|
1692
1704
|
logger.info("Setting node status to Online")
|
|
@@ -1714,6 +1726,9 @@ def restart_storage_node(
|
|
|
1714
1726
|
continue
|
|
1715
1727
|
tasks_controller.add_device_mig_task(dev.get_id())
|
|
1716
1728
|
|
|
1729
|
+
if cluster.status == cluster.STATUS_UNREADY:
|
|
1730
|
+
logger.info("Done")
|
|
1731
|
+
return "Success"
|
|
1717
1732
|
# Create distribs, raid0, and lvstore and expose lvols to the fabrics
|
|
1718
1733
|
if snode.lvstore_stack:
|
|
1719
1734
|
temp_rpc_client = RPCClient(
|
|
@@ -2562,12 +2577,15 @@ def get_next_ha_jms(current_node):
|
|
|
2562
2577
|
for node in db_controller.get_storage_nodes_by_cluster_id(current_node.cluster_id):
|
|
2563
2578
|
if node.get_id() == current_node.get_id() or node.status != StorageNode.STATUS_ONLINE:
|
|
2564
2579
|
continue
|
|
2565
|
-
if node.jm_device:
|
|
2580
|
+
if node.jm_device and node.jm_device.status == JMDevice.STATUS_ONLINE:
|
|
2566
2581
|
jm_count[node.jm_device.get_id()] = 1 + jm_count.get(node.jm_device.get_id(), 0)
|
|
2567
2582
|
for rem_jm_device in node.remote_jm_devices:
|
|
2568
2583
|
if rem_jm_device.get_id() != current_node.jm_device.get_id():
|
|
2569
|
-
|
|
2570
|
-
|
|
2584
|
+
try:
|
|
2585
|
+
if db_controller.get_jm_device_by_id(rem_jm_device.get_id()).status == JMDevice.STATUS_ONLINE:
|
|
2586
|
+
jm_count[rem_jm_device.get_id()] = 1 + jm_count.get(rem_jm_device.get_id(), 0)
|
|
2587
|
+
except :
|
|
2588
|
+
pass
|
|
2571
2589
|
jm_count = dict(sorted(jm_count.items(), key=lambda x: x[1]))
|
|
2572
2590
|
return list(jm_count.keys())[:2]
|
|
2573
2591
|
|
|
@@ -2597,6 +2615,7 @@ def create_lvstore(snode, ndcs, npcs, distr_bs, distr_chunk_bs, page_size_in_blo
|
|
|
2597
2615
|
if snode.enable_ha_jm:
|
|
2598
2616
|
jm_vuid = utils.get_random_vuid()
|
|
2599
2617
|
online_jms = get_next_ha_jms(snode)
|
|
2618
|
+
logger.debug(f"online_jms: {str(online_jms)}")
|
|
2600
2619
|
snode.remote_jm_devices = _connect_to_remote_jm_devs(snode, online_jms)
|
|
2601
2620
|
snode.write_to_db()
|
|
2602
2621
|
|
|
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_dev-4.0.5 → sbcli_dev-4.0.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_dev-4.0.5 → sbcli_dev-4.0.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
|
|
File without changes
|
{sbcli_dev-4.0.5 → sbcli_dev-4.0.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
|
{sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/tasks_runner_failed_migration.py
RENAMED
|
File without changes
|
|
File without changes
|
{sbcli_dev-4.0.5 → sbcli_dev-4.0.7}/simplyblock_core/services/tasks_runner_new_dev_migration.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
|