sbcli-dev 3.9.3__zip → 3.9.5__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-3.9.3 → sbcli_dev-3.9.5}/PKG-INFO +1 -1
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/env_var +1 -1
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/sbcli_dev.egg-info/PKG-INFO +1 -1
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/sbcli_dev.egg-info/SOURCES.txt +0 -1
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/cluster_ops.py +2 -1
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/device_controller.py +13 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/lvol_controller.py +1 -1
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/distr_controller.py +4 -4
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/__init__.py +4 -2
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/deploy_stack.sh +1 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/docker-compose-swarm.yml +41 -14
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/health_check_service.py +0 -4
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/main_distr_event_collector.py +1 -1
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/templates/storage_deploy_spdk.yaml.j2 +2 -32
- sbcli_dev-3.9.3/simplyblock_core/services/distr_event_collector.py +0 -157
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/README.md +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/pyproject.toml +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/sbcli_dev.egg-info/dependency_links.txt +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/sbcli_dev.egg-info/entry_points.txt +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/sbcli_dev.egg-info/requires.txt +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/sbcli_dev.egg-info/top_level.txt +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/setup.cfg +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/setup.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_cli/cli.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_cli/main.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/__init__.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/cnode_client.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/compute_node_ops.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/constants.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/__init__.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/caching_node_controller.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/cluster_events.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/device_events.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/events_controller.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/health_controller.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/lvol_events.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/mgmt_events.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/pool_controller.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/pool_events.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/snapshot_controller.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/snapshot_events.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/storage_events.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/tasks_controller.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/controllers/tasks_events.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/kv_store.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/mgmt_node_ops.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/__init__.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/base_model.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/caching_node.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/cluster.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/compute_node.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/deployer.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/events.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/global_settings.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/iface.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/job_schedule.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/lvol_model.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/mgmt_node.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/nvme_device.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/pool.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/port_stat.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/snapshot.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/stats.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/models/storage_node.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/pci_utils.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/rpc_client.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2 +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/alerting/alert_rules.yaml +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/clean_local_storage_deploy.sh +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/config_docker.sh +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/dashboard.yml +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/dashboards/cluster.json +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/dashboards/devices.json +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/dashboards/lvols.json +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/dashboards/node-exporter.json +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/dashboards/nodes.json +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/dashboards/pools.json +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/datasource.yml +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/db_config_double.sh +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/db_config_single.sh +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/haproxy.cfg +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/install_deps.sh +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/objstore.yml +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/prometheus.yml +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/run_ssh.sh +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/set_db_config.sh +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/scripts/stack_deploy_wait.sh +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/__init__.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/cached_lvol_stat_collector.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/caching_node_monitor.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/cap_monitor.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/capacity_and_stats_collector.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/device_monitor.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/install_service.sh +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/log_agg_service.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/lvol_monitor.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/lvol_stat_collector.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/mgmt_node_monitor.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/new_device_discovery.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/port_stat_collector.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/remove_service.sh +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/service_template.service +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/spdk_http_proxy_server.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/storage_node_monitor.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/tasks_runner_failed_migration.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/tasks_runner_migration.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/tasks_runner_new_dev_migration.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/tasks_runner_node_add.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/tasks_runner_restart.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/shell_utils.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/snode_client.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/storage_node_ops.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/utils.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/__init__.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/app.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/auth_middleware.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/__init__.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/caching_node_ops.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/caching_node_ops_k8s.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/node_api_basic.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/node_api_caching_docker.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/node_api_caching_ks.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/snode_ops.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/snode_ops_k8s.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/web_api_caching_node.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/web_api_cluster.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/web_api_deployer.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/web_api_device.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/web_api_lvol.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/web_api_mgmt_node.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/web_api_pool.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/web_api_snapshot.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/blueprints/web_api_storage_node.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/caching_node_app.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/caching_node_app_k8s.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/node_utils.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/node_webapp.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/snode_app.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/snode_app_k8s.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/static/delete.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/static/deploy.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/static/deploy_cnode.yaml +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/static/deploy_spdk.yaml +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/static/is_up.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/static/list_deps.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/static/rpac.yaml +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/static/tst.py +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/templates/caching_deploy_spdk.yaml.j2 +0 -0
- {sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_web/utils.py +0 -0
|
@@ -90,7 +90,6 @@ simplyblock_core/services/caching_node_monitor.py
|
|
|
90
90
|
simplyblock_core/services/cap_monitor.py
|
|
91
91
|
simplyblock_core/services/capacity_and_stats_collector.py
|
|
92
92
|
simplyblock_core/services/device_monitor.py
|
|
93
|
-
simplyblock_core/services/distr_event_collector.py
|
|
94
93
|
simplyblock_core/services/health_check_service.py
|
|
95
94
|
simplyblock_core/services/install_service.sh
|
|
96
95
|
simplyblock_core/services/log_agg_service.py
|
|
@@ -215,8 +215,9 @@ def create_cluster(blk_size, page_size_in_blocks, cli_pass,
|
|
|
215
215
|
shutil.rmtree(temp_dir)
|
|
216
216
|
|
|
217
217
|
logger.info("Deploying swarm stack ...")
|
|
218
|
+
log_level = "DEBUG" if constants.LOG_WEB_DEBUG else "INFO"
|
|
218
219
|
ret = scripts.deploy_stack(cli_pass, DEV_IP, constants.SIMPLY_BLOCK_DOCKER_IMAGE, c.secret, c.uuid,
|
|
219
|
-
log_del_interval, metrics_retention_period)
|
|
220
|
+
log_del_interval, metrics_retention_period, log_level=log_level)
|
|
220
221
|
logger.info("Deploying swarm stack > Done")
|
|
221
222
|
|
|
222
223
|
if ret == 0:
|
|
@@ -80,6 +80,19 @@ def device_set_read_only(device_id):
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
def device_set_online(device_id):
|
|
83
|
+
db_controller = DBController()
|
|
84
|
+
dev = db_controller.get_storage_devices(device_id)
|
|
85
|
+
snode = db_controller.get_storage_node_by_id(dev.node_id)
|
|
86
|
+
logger.info("Make other nodes connect to the node devices")
|
|
87
|
+
snodes = db_controller.get_storage_nodes_by_cluster_id(snode.cluster_id)
|
|
88
|
+
for node in snodes:
|
|
89
|
+
if node.get_id() == snode.get_id() or node.status != StorageNode.STATUS_ONLINE:
|
|
90
|
+
continue
|
|
91
|
+
node.remote_devices = storage_node_ops._connect_to_remote_devs(node)
|
|
92
|
+
if node.enable_ha_jm:
|
|
93
|
+
node.remote_jm_devices = storage_node_ops._connect_to_remote_jm_devs(node)
|
|
94
|
+
node.write_to_db()
|
|
95
|
+
|
|
83
96
|
ret = device_set_state(device_id, NVMeDevice.STATUS_ONLINE)
|
|
84
97
|
if ret:
|
|
85
98
|
logger.info("Adding task to device data migration")
|
|
@@ -186,7 +186,7 @@ def _get_next_3_nodes(cluster_id, lvol_size=0):
|
|
|
186
186
|
# node_stat_list = db_controller.get_node_stats(node, limit=1000)
|
|
187
187
|
# combined_record = utils.sum_records(node_stat_list)
|
|
188
188
|
node_st = {
|
|
189
|
-
"lvol": len(node.lvols)
|
|
189
|
+
"lvol": len(node.lvols)+1,
|
|
190
190
|
# "cpu": 1 + (node.cpu * node.cpu_hz),
|
|
191
191
|
# "r_io": combined_record.read_io_ps,
|
|
192
192
|
# "w_io": combined_record.write_io_ps,
|
|
@@ -34,7 +34,6 @@ def send_node_status_event(node, node_status):
|
|
|
34
34
|
def send_dev_status_event(device, dev_status):
|
|
35
35
|
db_controller = DBController()
|
|
36
36
|
storage_ID = device.cluster_device_order
|
|
37
|
-
logging.info(f"Sending event updates, device: {storage_ID}, status: {dev_status}")
|
|
38
37
|
node_status_event = {
|
|
39
38
|
"timestamp": datetime.datetime.now().isoformat("T", "seconds") + 'Z',
|
|
40
39
|
"event_type": "device_status",
|
|
@@ -46,8 +45,8 @@ def send_dev_status_event(device, dev_status):
|
|
|
46
45
|
for node in snodes:
|
|
47
46
|
if node.status != node.STATUS_ONLINE:
|
|
48
47
|
continue
|
|
49
|
-
|
|
50
|
-
rpc_client = RPCClient(node.mgmt_ip, node.rpc_port, node.rpc_username, node.rpc_password, timeout=
|
|
48
|
+
logging.debug(f"Sending event updates, device: {storage_ID}, status: {dev_status}, node: {node.get_id()}")
|
|
49
|
+
rpc_client = RPCClient(node.mgmt_ip, node.rpc_port, node.rpc_username, node.rpc_password, timeout=3, retry=1)
|
|
51
50
|
ret = rpc_client.distr_status_events_update(events)
|
|
52
51
|
if not ret:
|
|
53
52
|
logger.warning("Failed to send event update")
|
|
@@ -82,7 +81,6 @@ def get_distr_cluster_map(snodes, target_node):
|
|
|
82
81
|
dev_w_map = []
|
|
83
82
|
node_w = 0
|
|
84
83
|
for i, dev in enumerate(snode.nvme_devices):
|
|
85
|
-
logger.debug(f"Device: {dev.get_id()}, status: {dev.status}")
|
|
86
84
|
if dev.status in [NVMeDevice.STATUS_JM, NVMeDevice.STATUS_NEW]:
|
|
87
85
|
continue
|
|
88
86
|
dev_w = int(dev.size/(1024*1024*1024)) or 1
|
|
@@ -100,6 +98,8 @@ def get_distr_cluster_map(snodes, target_node):
|
|
|
100
98
|
break
|
|
101
99
|
if not name:
|
|
102
100
|
name = f"remote_{dev.alceml_bdev}n1"
|
|
101
|
+
dev_status = NVMeDevice.STATUS_UNAVAILABLE
|
|
102
|
+
logger.debug(f"Device: {dev.get_id()}, status: {dev_status}, bdev_name: {name}")
|
|
103
103
|
dev_map[dev.cluster_device_order] = {
|
|
104
104
|
"UUID": dev.get_id(),
|
|
105
105
|
"bdev_name": name,
|
|
@@ -30,10 +30,12 @@ def configure_docker(docker_ip):
|
|
|
30
30
|
return __run_script(['bash', '-x', os.path.join(DIR_PATH, 'config_docker.sh'), docker_ip])
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
def deploy_stack(cli_pass, dev_ip, image_name, graylog_password, cluster_id,
|
|
33
|
+
def deploy_stack(cli_pass, dev_ip, image_name, graylog_password, cluster_id,
|
|
34
|
+
log_del_interval, metrics_retention_period, log_level):
|
|
34
35
|
pass_hash = hashlib.sha256(graylog_password.encode('utf-8')).hexdigest()
|
|
35
36
|
return __run_script(
|
|
36
|
-
['sudo', 'bash', '-x', os.path.join(DIR_PATH, 'deploy_stack.sh'), cli_pass, dev_ip, image_name, pass_hash,
|
|
37
|
+
['sudo', 'bash', '-x', os.path.join(DIR_PATH, 'deploy_stack.sh'), cli_pass, dev_ip, image_name, pass_hash,
|
|
38
|
+
graylog_password, cluster_id, log_del_interval, metrics_retention_period, log_level])
|
|
37
39
|
|
|
38
40
|
|
|
39
41
|
def deploy_cleaner():
|
|
@@ -6,6 +6,7 @@ services:
|
|
|
6
6
|
networks:
|
|
7
7
|
- hostnet
|
|
8
8
|
environment:
|
|
9
|
+
SIMPLYBLOCK_LOG_LEVEL: '$LOG_LEVEL'
|
|
9
10
|
FDB_CLUSTER_FILE_CONTENTS: '$FDB_CLUSTER_FILE_CONTENTS'
|
|
10
11
|
FDB_NETWORKING_MODE: 'container'
|
|
11
12
|
FDB_CLUSTER_FILE: '/etc/foundationdb/fdb.cluster'
|
|
@@ -32,8 +33,9 @@ services:
|
|
|
32
33
|
volumes:
|
|
33
34
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
34
35
|
environment:
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
37
|
+
FLASK_DEBUG: "False"
|
|
38
|
+
FLASK_ENV: "production"
|
|
37
39
|
|
|
38
40
|
StorageNodeMonitor:
|
|
39
41
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -45,6 +47,8 @@ services:
|
|
|
45
47
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
46
48
|
networks:
|
|
47
49
|
- hostnet
|
|
50
|
+
environment:
|
|
51
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
48
52
|
|
|
49
53
|
MgmtNodeMonitor:
|
|
50
54
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -56,6 +60,8 @@ services:
|
|
|
56
60
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
57
61
|
networks:
|
|
58
62
|
- hostnet
|
|
63
|
+
environment:
|
|
64
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
59
65
|
|
|
60
66
|
CachingNodeMonitor:
|
|
61
67
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -67,6 +73,8 @@ services:
|
|
|
67
73
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
68
74
|
networks:
|
|
69
75
|
- hostnet
|
|
76
|
+
environment:
|
|
77
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
70
78
|
|
|
71
79
|
LVolStatsCollector:
|
|
72
80
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -78,6 +86,8 @@ services:
|
|
|
78
86
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
79
87
|
networks:
|
|
80
88
|
- hostnet
|
|
89
|
+
environment:
|
|
90
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
81
91
|
|
|
82
92
|
CachedLVolStatsCollector:
|
|
83
93
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -89,18 +99,8 @@ services:
|
|
|
89
99
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
90
100
|
networks:
|
|
91
101
|
- hostnet
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
95
|
-
command: "python simplyblock_core/services/port_stat_collector.py"
|
|
96
|
-
networks:
|
|
97
|
-
- hostnet
|
|
98
|
-
deploy:
|
|
99
|
-
mode: global
|
|
100
|
-
placement:
|
|
101
|
-
constraints: [node.role == worker]
|
|
102
|
-
volumes:
|
|
103
|
-
- "/etc/foundationdb:/etc/foundationdb"
|
|
102
|
+
environment:
|
|
103
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
104
104
|
|
|
105
105
|
MainDistrEventCollector:
|
|
106
106
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -112,6 +112,8 @@ services:
|
|
|
112
112
|
constraints: [node.role == manager]
|
|
113
113
|
volumes:
|
|
114
114
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
115
|
+
environment:
|
|
116
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
115
117
|
|
|
116
118
|
HAProxy:
|
|
117
119
|
image: haproxytech/haproxy-debian:latest
|
|
@@ -127,6 +129,8 @@ services:
|
|
|
127
129
|
- monitoring-net
|
|
128
130
|
volumes:
|
|
129
131
|
- "$DIR/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg"
|
|
132
|
+
environment:
|
|
133
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
130
134
|
|
|
131
135
|
CapacityAndStatsCollector:
|
|
132
136
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -138,6 +142,8 @@ services:
|
|
|
138
142
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
139
143
|
networks:
|
|
140
144
|
- hostnet
|
|
145
|
+
environment:
|
|
146
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
141
147
|
|
|
142
148
|
CapacityMonitor:
|
|
143
149
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -149,6 +155,8 @@ services:
|
|
|
149
155
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
150
156
|
networks:
|
|
151
157
|
- hostnet
|
|
158
|
+
environment:
|
|
159
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
152
160
|
|
|
153
161
|
HealthCheck:
|
|
154
162
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -160,6 +168,8 @@ services:
|
|
|
160
168
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
161
169
|
networks:
|
|
162
170
|
- hostnet
|
|
171
|
+
environment:
|
|
172
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
163
173
|
|
|
164
174
|
DeviceMonitor:
|
|
165
175
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -171,6 +181,8 @@ services:
|
|
|
171
181
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
172
182
|
networks:
|
|
173
183
|
- hostnet
|
|
184
|
+
environment:
|
|
185
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
174
186
|
|
|
175
187
|
LVolMonitor:
|
|
176
188
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -182,10 +194,13 @@ services:
|
|
|
182
194
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
183
195
|
networks:
|
|
184
196
|
- hostnet
|
|
197
|
+
environment:
|
|
198
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
185
199
|
|
|
186
200
|
CleanupFDB:
|
|
187
201
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
188
202
|
environment:
|
|
203
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
189
204
|
LOG_DELETION_INTERVAL: "${LOG_DELETION_INTERVAL}"
|
|
190
205
|
command: "python simplyblock_core/workers/cleanup_foundationdb.py"
|
|
191
206
|
deploy:
|
|
@@ -206,6 +221,8 @@ services:
|
|
|
206
221
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
207
222
|
networks:
|
|
208
223
|
- hostnet
|
|
224
|
+
environment:
|
|
225
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
209
226
|
|
|
210
227
|
TasksRunnerMigration:
|
|
211
228
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -217,6 +234,8 @@ services:
|
|
|
217
234
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
218
235
|
networks:
|
|
219
236
|
- hostnet
|
|
237
|
+
environment:
|
|
238
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
220
239
|
|
|
221
240
|
TasksRunnerFailedMigration:
|
|
222
241
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -228,6 +247,8 @@ services:
|
|
|
228
247
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
229
248
|
networks:
|
|
230
249
|
- hostnet
|
|
250
|
+
environment:
|
|
251
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
231
252
|
|
|
232
253
|
TasksRunnerNewDeviceMigration:
|
|
233
254
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -239,6 +260,8 @@ services:
|
|
|
239
260
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
240
261
|
networks:
|
|
241
262
|
- hostnet
|
|
263
|
+
environment:
|
|
264
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
242
265
|
|
|
243
266
|
NewDeviceDiscovery:
|
|
244
267
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -250,6 +273,8 @@ services:
|
|
|
250
273
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
251
274
|
networks:
|
|
252
275
|
- hostnet
|
|
276
|
+
environment:
|
|
277
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
253
278
|
|
|
254
279
|
TasksNodeAddRunner:
|
|
255
280
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
|
@@ -261,6 +286,8 @@ services:
|
|
|
261
286
|
- "/etc/foundationdb:/etc/foundationdb"
|
|
262
287
|
networks:
|
|
263
288
|
- hostnet
|
|
289
|
+
environment:
|
|
290
|
+
SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL"
|
|
264
291
|
|
|
265
292
|
|
|
266
293
|
volumes:
|
|
@@ -68,10 +68,6 @@ while True:
|
|
|
68
68
|
node_api_check = health_controller._check_node_api(snode.mgmt_ip)
|
|
69
69
|
logger.info(f"Check: node API {snode.mgmt_ip}:5000 ... {node_api_check}")
|
|
70
70
|
|
|
71
|
-
if snode.status == StorageNode.STATUS_OFFLINE:
|
|
72
|
-
set_node_health_check(snode, ping_check & node_api_check)
|
|
73
|
-
continue
|
|
74
|
-
|
|
75
71
|
# 3- check node RPC
|
|
76
72
|
node_rpc_check = health_controller._check_node_rpc(
|
|
77
73
|
snode.mgmt_ip, snode.rpc_port, snode.rpc_username, snode.rpc_password)
|
|
@@ -56,7 +56,7 @@ def process_device_event(event):
|
|
|
56
56
|
new_remote_devices.append(rem_dev)
|
|
57
57
|
node.remote_devices = new_remote_devices
|
|
58
58
|
node.write_to_db(db_controller.kv_store)
|
|
59
|
-
|
|
59
|
+
device_controller.device_set_unavailable(device_id)
|
|
60
60
|
|
|
61
61
|
else:
|
|
62
62
|
if event.message == 'SPDK_BDEV_EVENT_REMOVE':
|
|
@@ -90,9 +90,9 @@ spec:
|
|
|
90
90
|
resources:
|
|
91
91
|
limits:
|
|
92
92
|
hugepages-2Mi: {{ MEM_GEGA }}Gi
|
|
93
|
-
memory:
|
|
93
|
+
memory: 4Gi
|
|
94
94
|
requests:
|
|
95
|
-
memory:
|
|
95
|
+
memory: 4Gi
|
|
96
96
|
|
|
97
97
|
- name: spdk-proxy-container
|
|
98
98
|
image: {{ SIMPLYBLOCK_DOCKER_IMAGE }}
|
|
@@ -110,33 +110,3 @@ spec:
|
|
|
110
110
|
value: "{{ RPC_USERNAME }}"
|
|
111
111
|
- name: RPC_PASSWORD
|
|
112
112
|
value: "{{ RPC_PASSWORD }}"
|
|
113
|
-
|
|
114
|
-
{# - name: node-exporter#}
|
|
115
|
-
{# image: prom/node-exporter:v1.7.0#}
|
|
116
|
-
{# user: root#}
|
|
117
|
-
{# command:#}
|
|
118
|
-
{# - '--path.procfs=/host/proc'#}
|
|
119
|
-
{# - '--path.sysfs=/host/sys'#}
|
|
120
|
-
{# - '--path.rootfs=/host'#}
|
|
121
|
-
{# - '--collector.filesystem.ignored-mount-points="^(/rootfs|/host|)/(sys|proc|dev|host|etc)($$|/)"'#}
|
|
122
|
-
{# - '--collector.filesystem.ignored-fs-types="^(sys|proc|auto|cgroup|devpts|ns|au|fuse\.lxc|mqueue)(fs|)$$"'#}
|
|
123
|
-
{# - '--no-collector.ipvs'#}
|
|
124
|
-
{# volumeMounts:#}
|
|
125
|
-
{# - name: host-sys#}
|
|
126
|
-
{# mountPath: /host/sys#}
|
|
127
|
-
{# readOnly: true#}
|
|
128
|
-
{# - name: host-proc#}
|
|
129
|
-
{# mountPath: /host/proc#}
|
|
130
|
-
{# readOnly: true#}
|
|
131
|
-
{# - name: host-rootfs#}
|
|
132
|
-
{# mountPath: /rootfs#}
|
|
133
|
-
{# readOnly: true#}
|
|
134
|
-
|
|
135
|
-
- name: distr-event-collector
|
|
136
|
-
image: {{ SIMPLYBLOCK_DOCKER_IMAGE }}
|
|
137
|
-
imagePullPolicy: "Always"
|
|
138
|
-
command: ["python", "simplyblock_core/services/distr_event_collector.py"]
|
|
139
|
-
volumeMounts:
|
|
140
|
-
- name: foundationdb
|
|
141
|
-
mountPath: /etc/foundationdb
|
|
142
|
-
readOnly: true
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
# coding=utf-8
|
|
2
|
-
import time
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
from simplyblock_core import constants, kv_store, utils, rpc_client
|
|
6
|
-
from simplyblock_core.controllers import events_controller, device_controller, lvol_events
|
|
7
|
-
from simplyblock_core.models.lvol_model import LVol
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
from simplyblock_core.models.nvme_device import NVMeDevice
|
|
11
|
-
from simplyblock_core.rpc_client import RPCClient
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
logger = utils.get_logger(__name__)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# get DB controller
|
|
18
|
-
db_controller = kv_store.DBController()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def process_device_event(event):
|
|
22
|
-
if event.message in ['SPDK_BDEV_EVENT_REMOVE', "error_open", 'error_read', "error_write", "error_unmap"]:
|
|
23
|
-
node_id = event.node_id
|
|
24
|
-
storage_id = event.storage_id
|
|
25
|
-
|
|
26
|
-
device = None
|
|
27
|
-
for node in db_controller.get_storage_nodes():
|
|
28
|
-
for dev in node.nvme_devices:
|
|
29
|
-
if dev.cluster_device_order == storage_id:
|
|
30
|
-
if dev.status not in [NVMeDevice.STATUS_ONLINE, NVMeDevice.STATUS_READONLY]:
|
|
31
|
-
logger.info(f"The storage device is not online, skipping. status: {dev.status}")
|
|
32
|
-
# event.status = 'skipped'
|
|
33
|
-
# return
|
|
34
|
-
device = dev
|
|
35
|
-
break
|
|
36
|
-
|
|
37
|
-
if not device:
|
|
38
|
-
logger.info(f"Device not found!, storage id: {storage_id} from node: {node_id}")
|
|
39
|
-
event.status = 'device_not_found'
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
device_id = device.get_id()
|
|
43
|
-
if event.message == 'SPDK_BDEV_EVENT_REMOVE':
|
|
44
|
-
if device.node_id == node_id:
|
|
45
|
-
logger.info(f"Removing storage id: {storage_id} from node: {node_id}")
|
|
46
|
-
device_controller.device_remove(device_id)
|
|
47
|
-
else:
|
|
48
|
-
logger.info(f"Removing remote storage id: {storage_id} from node: {node_id}")
|
|
49
|
-
new_remote_devices = []
|
|
50
|
-
device_node = db_controller.get_storage_node_by_id(node_id)
|
|
51
|
-
rpc_client = RPCClient(device_node.mgmt_ip, device_node.rpc_port,
|
|
52
|
-
device_node.rpc_username, device_node.rpc_password)
|
|
53
|
-
for rem_dev in device_node.remote_devices:
|
|
54
|
-
if rem_dev.get_id() == device.get_id():
|
|
55
|
-
ctrl_name = rem_dev.remote_bdev[:-2]
|
|
56
|
-
rpc_client.bdev_nvme_detach_controller(ctrl_name)
|
|
57
|
-
else:
|
|
58
|
-
new_remote_devices.append(rem_dev)
|
|
59
|
-
device_node.remote_devices = new_remote_devices
|
|
60
|
-
device_node.write_to_db(db_controller.kv_store)
|
|
61
|
-
|
|
62
|
-
elif event.message in ['error_write', 'error_unmap']:
|
|
63
|
-
logger.info(f"Setting device to read-only")
|
|
64
|
-
device_controller.device_set_io_error(device_id, True)
|
|
65
|
-
device_controller.device_set_read_only(device_id)
|
|
66
|
-
else:
|
|
67
|
-
logger.info(f"Setting device to unavailable")
|
|
68
|
-
device_controller.device_set_io_error(device_id, True)
|
|
69
|
-
device_controller.device_set_unavailable(device_id)
|
|
70
|
-
|
|
71
|
-
event.status = 'processed'
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def process_lvol_event(event):
|
|
75
|
-
if event.message in ["error_open", 'error_read', "error_write", "error_unmap"]:
|
|
76
|
-
# vuid = event.object_dict['vuid']
|
|
77
|
-
node_id = event.node_id
|
|
78
|
-
lvols = []
|
|
79
|
-
for lv in db_controller.get_lvols(): # pass
|
|
80
|
-
if lv.node_id == node_id:
|
|
81
|
-
lvols.append(lv)
|
|
82
|
-
|
|
83
|
-
if not lvols:
|
|
84
|
-
logger.error(f"LVols on node {node_id} not found")
|
|
85
|
-
event.status = 'lvols_not_found'
|
|
86
|
-
else:
|
|
87
|
-
for lvol in lvols:
|
|
88
|
-
if lvol.status == LVol.STATUS_ONLINE:
|
|
89
|
-
logger.info("Setting LVol to offline")
|
|
90
|
-
lvol.io_error = True
|
|
91
|
-
old_status = lvol.status
|
|
92
|
-
lvol.status = LVol.STATUS_OFFLINE
|
|
93
|
-
lvol.write_to_db(db_controller.kv_store)
|
|
94
|
-
lvol_events.lvol_status_change(lvol, lvol.status, old_status, caused_by="monitor")
|
|
95
|
-
lvol_events.lvol_io_error_change(lvol, True, False, caused_by="monitor")
|
|
96
|
-
event.status = 'processed'
|
|
97
|
-
else:
|
|
98
|
-
logger.error(f"Unknown LVol event message: {event.message}")
|
|
99
|
-
event.status = "event_unknown"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
def process_event(event_id):
|
|
103
|
-
event = db_controller.get_events(event_id)[0]
|
|
104
|
-
if event.event == "device_status":
|
|
105
|
-
if event.storage_id >= 0:
|
|
106
|
-
process_device_event(event)
|
|
107
|
-
|
|
108
|
-
if event.vuid >= 0:
|
|
109
|
-
process_lvol_event(event)
|
|
110
|
-
|
|
111
|
-
event.write_to_db(db_controller.kv_store)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
hostname = utils.get_hostname()
|
|
115
|
-
logger.info("Getting node info...")
|
|
116
|
-
while True:
|
|
117
|
-
time.sleep(constants.DISTR_EVENT_COLLECTOR_INTERVAL_SEC)
|
|
118
|
-
|
|
119
|
-
snode = db_controller.get_storage_node_by_hostname(hostname)
|
|
120
|
-
if not snode:
|
|
121
|
-
logger.error("This node is not part of the cluster, hostname: %s, Retrying..." % hostname)
|
|
122
|
-
continue
|
|
123
|
-
|
|
124
|
-
logger.info(f"Starting Distr event collector on node: {hostname}")
|
|
125
|
-
|
|
126
|
-
client = rpc_client.RPCClient(
|
|
127
|
-
snode.mgmt_ip,
|
|
128
|
-
snode.rpc_port,
|
|
129
|
-
snode.rpc_username,
|
|
130
|
-
snode.rpc_password,
|
|
131
|
-
timeout=10, retry=2)
|
|
132
|
-
|
|
133
|
-
try:
|
|
134
|
-
events = client.distr_status_events_discard_then_get(0, constants.DISTR_EVENT_COLLECTOR_NUM_OF_EVENTS)
|
|
135
|
-
|
|
136
|
-
if not events:
|
|
137
|
-
logger.debug("no events found")
|
|
138
|
-
continue
|
|
139
|
-
|
|
140
|
-
logger.info(f"Found events: {len(events)}")
|
|
141
|
-
event_ids = []
|
|
142
|
-
for ev in events:
|
|
143
|
-
logger.debug(ev)
|
|
144
|
-
ev_id = events_controller.log_distr_event(snode.cluster_id, snode.get_id(), ev)
|
|
145
|
-
event_ids.append(ev_id)
|
|
146
|
-
|
|
147
|
-
for eid in event_ids:
|
|
148
|
-
logger.info(f"Processing event: {eid}")
|
|
149
|
-
process_event(eid)
|
|
150
|
-
|
|
151
|
-
logger.info(f"Discarding events: {len(events)}")
|
|
152
|
-
client.distr_status_events_discard_then_get(len(events), 0)
|
|
153
|
-
|
|
154
|
-
except Exception as e:
|
|
155
|
-
logger.error("Failed to process distr events")
|
|
156
|
-
logger.exception(e)
|
|
157
|
-
continue
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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-3.9.3 → sbcli_dev-3.9.5}/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
|
{sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/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_dev-3.9.3 → sbcli_dev-3.9.5}/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
|
{sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/simplyblock_core/services/tasks_runner_failed_migration.py
RENAMED
|
File without changes
|
|
File without changes
|
{sbcli_dev-3.9.3 → sbcli_dev-3.9.5}/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
|