sbcli-hmdi 0.0.8__tar.gz → 0.0.9__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/PKG-INFO +1 -1
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/sbcli_hmdi.egg-info/PKG-INFO +1 -1
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/lvol_controller.py +39 -23
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/snapshot_controller.py +148 -134
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/env_var +1 -1
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/README.md +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/pyproject.toml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/requirements.txt +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/sbcli_hmdi.egg-info/SOURCES.txt +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/sbcli_hmdi.egg-info/dependency_links.txt +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/sbcli_hmdi.egg-info/entry_points.txt +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/sbcli_hmdi.egg-info/requires.txt +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/sbcli_hmdi.egg-info/top_level.txt +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/setup.cfg +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/setup.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_cli/__init__.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_cli/cli.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_cli/main.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/__init__.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/cluster_ops.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/cnode_client.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/constants.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/__init__.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/caching_node_controller.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/cluster_events.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/device_controller.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/device_events.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/events_controller.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/health_controller.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/lvol_events.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/mgmt_events.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/pool_controller.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/pool_events.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/snapshot_events.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/storage_events.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/tasks_controller.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/tasks_events.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/db_controller.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/distr_controller.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/mgmt_node_ops.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/__init__.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/base_model.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/caching_node.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/cluster.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/deployer.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/events.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/iface.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/job_schedule.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/lvol_model.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/mgmt_node.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/nvme_device.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/pool.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/port_stat.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/snapshot.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/stats.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/models/storage_node.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/pci_utils.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/rpc_client.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/__init__.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2 +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/alerting/alert_rules.yaml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/clean_local_storage_deploy.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/config_docker.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/dashboard.yml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/dashboards/cluster.json +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/dashboards/devices.json +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/dashboards/lvols.json +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/dashboards/node-exporter.json +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/dashboards/nodes.json +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/dashboards/pools.json +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/datasource.yml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/db_config_double.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/db_config_single.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/deploy_fdb.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/deploy_stack.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/docker-compose-swarm.yml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/foundation.yml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/haproxy.cfg +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/install_deps.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/objstore.yml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/prepare_fdb.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/prometheus.yml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/run_ssh.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/set_db_config.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/stack_deploy_wait.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/__init__.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/cached_lvol_stat_collector.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/caching_node_monitor.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/cap_monitor.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/capacity_and_stats_collector.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/device_monitor.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/health_check_service.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/install_service.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/log_agg_service.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/lvol_monitor.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/lvol_stat_collector.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/main_distr_event_collector.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/mgmt_node_monitor.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/new_device_discovery.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/port_stat_collector.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/remove_service.sh +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/service_template.service +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/spdk_http_proxy_server.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/storage_node_monitor.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/tasks_runner_failed_migration.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/tasks_runner_migration.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/tasks_runner_new_dev_migration.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/tasks_runner_node_add.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/tasks_runner_restart.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/shell_utils.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/snode_client.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/storage_node_ops.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/utils.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/workers/cleanup_foundationdb.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/README.md +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/__init__.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/app.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/auth_middleware.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/__init__.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/caching_node_ops.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/caching_node_ops_k8s.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/node_api_basic.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/node_api_caching_docker.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/node_api_caching_ks.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/snode_ops.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/snode_ops_k8s.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/web_api_caching_node.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/web_api_cluster.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/web_api_deployer.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/web_api_device.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/web_api_lvol.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/web_api_mgmt_node.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/web_api_pool.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/web_api_snapshot.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/blueprints/web_api_storage_node.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/caching_node_app.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/caching_node_app_k8s.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/node_utils.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/node_webapp.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/requirements.txt +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/snode_app.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/snode_app_k8s.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/static/delete.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/static/deploy.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/static/deploy_cnode.yaml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/static/deploy_spdk.yaml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/static/is_up.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/static/list_deps.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/static/rpac.yaml +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/static/tst.py +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/templates/caching_deploy_spdk.yaml.j2 +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/templates/storage_deploy_spdk.yaml.j2 +0 -0
- {sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_web/utils.py +0 -0
@@ -492,32 +492,48 @@ def add_lvol_ha(name, size, host_id_or_name, ha_type, pool_id_or_name, use_comp,
|
|
492
492
|
|
493
493
|
lvol.write_to_db(db_controller.kv_store)
|
494
494
|
|
495
|
-
|
496
|
-
if error:
|
497
|
-
lvol.remove(db_controller.kv_store)
|
498
|
-
return False, error
|
499
|
-
lvol.nodes = [host_node.get_id()]
|
500
|
-
lvol.lvol_uuid = lvol_bdev['uuid']
|
501
|
-
lvol.blobid = lvol_bdev['driver_specific']['lvol']['blobid']
|
495
|
+
if host_node.status == StorageNode.STATUS_ONLINE:
|
502
496
|
|
503
|
-
|
504
|
-
|
497
|
+
lvol_bdev, error = add_lvol_on_node(lvol, host_node)
|
498
|
+
if error:
|
499
|
+
lvol.remove(db_controller.kv_store)
|
500
|
+
return False, error
|
501
|
+
lvol.nodes = [host_node.get_id()]
|
502
|
+
lvol.lvol_uuid = lvol_bdev['uuid']
|
503
|
+
lvol.blobid = lvol_bdev['driver_specific']['lvol']['blobid']
|
504
|
+
|
505
|
+
if ha_type == "ha":
|
506
|
+
lvol.nodes.append(host_node.secondary_node_id)
|
507
|
+
sec_node = db_controller.get_storage_node_by_id(host_node.secondary_node_id)
|
508
|
+
if sec_node and sec_node.status == StorageNode.STATUS_ONLINE:
|
509
|
+
ret, error = add_lvol_on_node(lvol, sec_node, ha_inode_self=1)
|
510
|
+
if error:
|
511
|
+
logger.error(error)
|
512
|
+
logger.error(f"Failed to add lvol on node: {sec_node.get_id()}")
|
513
|
+
logger.info(f"Removing LVol from {host_node.get_id()}")
|
514
|
+
lvol.status = LVol.STATUS_IN_DELETION
|
515
|
+
lvol.write_to_db(db_controller.kv_store)
|
516
|
+
ret=delete_lvol_from_node(lvol.get_id(), host_node.get_id())
|
517
|
+
if ret:
|
518
|
+
lvol.remove(db_controller.kv_store)
|
519
|
+
else:
|
520
|
+
logger.error(f"Failed to remove lvol from node {host_node.get_id()}, LVol status: {lvol.status}")
|
521
|
+
return False, error
|
522
|
+
|
523
|
+
else:
|
505
524
|
sec_node = db_controller.get_storage_node_by_id(host_node.secondary_node_id)
|
506
|
-
if sec_node
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
logger.error(f"Failed to add lvol on node: {sec_node.get_id()}")
|
511
|
-
logger.info(f"Removing LVol from {host_node.get_id()}")
|
512
|
-
lvol.status = LVol.STATUS_IN_DELETION
|
513
|
-
lvol.write_to_db(db_controller.kv_store)
|
514
|
-
ret=delete_lvol_from_node(lvol.get_id(), host_node.get_id())
|
515
|
-
if ret:
|
516
|
-
lvol.remove(db_controller.kv_store)
|
517
|
-
else:
|
518
|
-
logger.error(f"Failed to remove lvol from node {host_node.get_id()}, LVol status: {lvol.status}")
|
519
|
-
return False, error
|
525
|
+
if not sec_node or sec_node.status != StorageNode.STATUS_ONLINE:
|
526
|
+
msg = f"Host nodes are not online"
|
527
|
+
logger.error(msg)
|
528
|
+
return False, msg
|
520
529
|
|
530
|
+
lvol_bdev, error = add_lvol_on_node(lvol, sec_node)
|
531
|
+
if error:
|
532
|
+
lvol.remove(db_controller.kv_store)
|
533
|
+
return False, error
|
534
|
+
lvol.nodes = [host_node.get_id(), sec_node.get_id()]
|
535
|
+
lvol.lvol_uuid = lvol_bdev['uuid']
|
536
|
+
lvol.blobid = lvol_bdev['driver_specific']['lvol']['blobid']
|
521
537
|
|
522
538
|
lvol.pool_uuid = pool.get_id()
|
523
539
|
lvol.status = LVol.STATUS_ONLINE
|
@@ -53,12 +53,6 @@ def add(lvol_id, snapshot_name):
|
|
53
53
|
logger.info(f"Creating snapshot: {snapshot_name} from LVol: {lvol.get_id()}")
|
54
54
|
snode = db_controller.get_storage_node_by_id(lvol.node_id)
|
55
55
|
|
56
|
-
if snode.status != StorageNode.STATUS_ONLINE:
|
57
|
-
msg = f"Node is not online, {snode.status}"
|
58
|
-
logger.error(msg)
|
59
|
-
return False, msg
|
60
|
-
|
61
|
-
|
62
56
|
rec = db_controller.get_lvol_stats(lvol, 1)
|
63
57
|
if rec:
|
64
58
|
size = rec[0].size_used
|
@@ -76,28 +70,6 @@ def add(lvol_id, snapshot_name):
|
|
76
70
|
f"Pool max size has reached {utils.humanbytes(total+size)} of {utils.humanbytes(pool.pool_max_size)}")
|
77
71
|
return False
|
78
72
|
|
79
|
-
|
80
|
-
##############################################################################
|
81
|
-
# # Validate adding snap on storage node
|
82
|
-
# snode_api = SNodeClient(snode.api_endpoint)
|
83
|
-
# result, _ = snode_api.info()
|
84
|
-
# memory_free = result["memory_details"]["free"]
|
85
|
-
# huge_free = result["memory_details"]["huge_free"]
|
86
|
-
# total_node_capacity = db_controller.get_snode_size(snode.get_id())
|
87
|
-
#
|
88
|
-
# error = utils.validate_add_lvol_or_snap_on_node(
|
89
|
-
# memory_free,
|
90
|
-
# huge_free,
|
91
|
-
# snode.max_snap,
|
92
|
-
# lvol.size,
|
93
|
-
# total_node_capacity,
|
94
|
-
# len(db_controller.get_snapshots_by_node_id(lvol.node_id)))
|
95
|
-
#
|
96
|
-
# if error:
|
97
|
-
# logger.error(f"Failed to add snap on node {lvol.node_id}")
|
98
|
-
# logger.error(error)
|
99
|
-
# return False
|
100
|
-
|
101
73
|
if pool.pool_max_size > 0:
|
102
74
|
total = pool_controller.get_pool_total_capacity(pool.get_id())
|
103
75
|
if total + lvol.size > pool.pool_max_size:
|
@@ -105,53 +77,64 @@ def add(lvol_id, snapshot_name):
|
|
105
77
|
logger.error(msg)
|
106
78
|
return False, msg
|
107
79
|
|
108
|
-
|
109
|
-
# cnt = db_controller.get_snapshots_by_node_id(snode.get_id())
|
110
|
-
# if cnt and len(cnt)+1 > snode.max_snap:
|
111
|
-
# msg = f"Storage node snapshots count must be less than max_snap:{snode.max_snap}"
|
112
|
-
# logger.error(msg)
|
113
|
-
# return False, msg
|
114
|
-
|
115
|
-
##############################################################################
|
116
|
-
|
80
|
+
cluster = db_controller.get_cluster_by_id(pool.cluster_id)
|
117
81
|
snap_bdev_name = f"SNAP_{utils.get_random_vuid()}"
|
118
|
-
|
119
|
-
|
82
|
+
size = lvol.size
|
120
83
|
blobid = 0
|
121
84
|
snap_uuid = ""
|
122
|
-
rpc_client.bdev_lvol_set_leader(True, lvs_name=lvol.lvs_name)
|
123
|
-
logger.info("Creating Snapshot bdev")
|
124
|
-
ret = rpc_client.lvol_create_snapshot(f"{lvol.lvs_name}/{lvol.lvol_bdev}", snap_bdev_name)
|
125
|
-
if not ret:
|
126
|
-
return False, f"Failed to create snapshot on node: {snode.get_id()}"
|
127
|
-
|
128
|
-
size = lvol.size
|
129
85
|
used_size = 0
|
130
|
-
|
131
|
-
if
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
86
|
+
|
87
|
+
if snode.status == StorageNode.STATUS_ONLINE:
|
88
|
+
rpc_client = RPCClient(snode.mgmt_ip, snode.rpc_port, snode.rpc_username, snode.rpc_password)
|
89
|
+
rpc_client.bdev_lvol_set_leader(True, lvs_name=lvol.lvs_name)
|
90
|
+
logger.info("Creating Snapshot bdev")
|
91
|
+
ret = rpc_client.lvol_create_snapshot(f"{lvol.lvs_name}/{lvol.lvol_bdev}", snap_bdev_name)
|
92
|
+
if not ret:
|
93
|
+
return False, f"Failed to create snapshot on node: {snode.get_id()}"
|
94
|
+
|
95
|
+
snap_bdev = rpc_client.get_bdevs(f"{lvol.lvs_name}/{snap_bdev_name}")
|
96
|
+
if snap_bdev:
|
97
|
+
snap_uuid = snap_bdev[0]['uuid']
|
98
|
+
blobid = snap_bdev[0]['driver_specific']['lvol']['blobid']
|
99
|
+
cluster_size = cluster.distr_ndcs * cluster.page_size_in_blocks
|
100
|
+
num_allocated_clusters = snap_bdev[0]["driver_specific"]["lvol"]["num_allocated_clusters"]
|
101
|
+
used_size = int(num_allocated_clusters*cluster_size)
|
102
|
+
|
103
|
+
if snode.secondary_node_id and blobid:
|
104
|
+
sec_node = db_controller.get_storage_node_by_id(snode.secondary_node_id)
|
105
|
+
if sec_node.status == StorageNode.STATUS_ONLINE:
|
106
|
+
sec_rpc_client = RPCClient(sec_node.mgmt_ip, sec_node.rpc_port, sec_node.rpc_username, sec_node.rpc_password)
|
107
|
+
sec_rpc_client.bdev_lvol_set_leader(False, lvs_name=lvol.lvs_name)
|
108
|
+
ret = sec_rpc_client.bdev_lvol_snapshot_register(
|
109
|
+
f"{lvol.lvs_name}/{lvol.lvol_bdev}", snap_bdev_name, snap_uuid, blobid)
|
151
110
|
if not ret:
|
152
|
-
|
153
|
-
|
111
|
+
msg = f"Failed to register snapshot on node: {sec_node.get_id()}"
|
112
|
+
logger.error(msg)
|
113
|
+
logger.info(f"Removing snapshot from {snode.get_id()}")
|
114
|
+
ret = rpc_client.delete_lvol(f"{lvol.lvs_name}/{snap_bdev_name}")
|
115
|
+
if not ret:
|
116
|
+
logger.error(f"Failed to delete snap from node: {snode.get_id()}")
|
117
|
+
return False, msg
|
154
118
|
|
119
|
+
else:
|
120
|
+
sec_node = db_controller.get_storage_node_by_id(snode.secondary_node_id)
|
121
|
+
if not sec_node or sec_node.status != StorageNode.STATUS_ONLINE:
|
122
|
+
msg = f"Host nodes are not online"
|
123
|
+
logger.error(msg)
|
124
|
+
return False, msg
|
125
|
+
|
126
|
+
sec_rpc_client = RPCClient(sec_node.mgmt_ip, sec_node.rpc_port, sec_node.rpc_username, sec_node.rpc_password)
|
127
|
+
ret = sec_rpc_client.lvol_create_snapshot(f"{lvol.lvs_name}/{lvol.lvol_bdev}", snap_bdev_name)
|
128
|
+
if not ret:
|
129
|
+
return False, f"Failed to create snapshot on node: {sec_node.get_id()}"
|
130
|
+
|
131
|
+
snap_bdev = sec_rpc_client.get_bdevs(f"{lvol.lvs_name}/{snap_bdev_name}")
|
132
|
+
if snap_bdev:
|
133
|
+
snap_uuid = snap_bdev[0]['uuid']
|
134
|
+
blobid = snap_bdev[0]['driver_specific']['lvol']['blobid']
|
135
|
+
cluster_size = cluster.distr_ndcs * cluster.page_size_in_blocks
|
136
|
+
num_allocated_clusters = snap_bdev[0]["driver_specific"]["lvol"]["num_allocated_clusters"]
|
137
|
+
used_size = int(num_allocated_clusters * cluster_size)
|
155
138
|
|
156
139
|
snap = SnapShot()
|
157
140
|
snap.uuid = str(uuid.uuid4())
|
@@ -229,44 +212,59 @@ def delete(snapshot_uuid, force_delete=False):
|
|
229
212
|
|
230
213
|
logger.info(f"Removing snapshot: {snapshot_uuid}")
|
231
214
|
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
if not
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
if not
|
249
|
-
|
250
|
-
|
251
|
-
|
215
|
+
if snode.status == StorageNode.STATUS_ONLINE:
|
216
|
+
|
217
|
+
# creating RPCClient instance
|
218
|
+
rpc_client = RPCClient(
|
219
|
+
snode.mgmt_ip,
|
220
|
+
snode.rpc_port,
|
221
|
+
snode.rpc_username,
|
222
|
+
snode.rpc_password)
|
223
|
+
|
224
|
+
ret = rpc_client.bdev_lvol_set_leader(True, lvs_name=snap.lvol.lvs_name)
|
225
|
+
if not ret:
|
226
|
+
logger.error(f"Failed to set leader for primary node: {snode.get_id()}")
|
227
|
+
if not force_delete:
|
228
|
+
return False
|
229
|
+
|
230
|
+
ret = rpc_client.delete_lvol(snap.snap_bdev)
|
231
|
+
if not ret:
|
232
|
+
logger.error(f"Failed to delete snap from node: {snode.get_id()}")
|
233
|
+
if not force_delete:
|
234
|
+
return False
|
235
|
+
|
236
|
+
if snode.secondary_node_id:
|
237
|
+
sec_node = db_controller.get_storage_node_by_id(snode.secondary_node_id)
|
238
|
+
if sec_node.status == StorageNode.STATUS_ONLINE:
|
239
|
+
sec_rpc_client = RPCClient(
|
240
|
+
sec_node.mgmt_ip,
|
241
|
+
sec_node.rpc_port,
|
242
|
+
sec_node.rpc_username,
|
243
|
+
sec_node.rpc_password)
|
244
|
+
|
245
|
+
ret = sec_rpc_client.bdev_lvol_set_leader(False, lvs_name=snap.lvol.lvs_name)
|
246
|
+
if not ret:
|
247
|
+
logger.error(f"Failed to set leader for secondary node: {sec_node.get_id()}")
|
248
|
+
if not force_delete:
|
249
|
+
return False
|
250
|
+
ret = sec_rpc_client.delete_lvol(snap.snap_bdev)
|
251
|
+
if not ret:
|
252
|
+
logger.error(f"Failed to delete snap from node: {sec_node.get_id()}")
|
253
|
+
if not force_delete:
|
254
|
+
return False
|
255
|
+
else:
|
252
256
|
sec_node = db_controller.get_storage_node_by_id(snode.secondary_node_id)
|
253
|
-
if sec_node.status
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
return False
|
265
|
-
ret = sec_rpc_client.delete_lvol(snap.snap_bdev)
|
266
|
-
if not ret:
|
267
|
-
logger.error(f"Failed to delete snap from node: {sec_node.get_id()}")
|
268
|
-
if not force_delete:
|
269
|
-
return False
|
257
|
+
if not sec_node or sec_node.status != StorageNode.STATUS_ONLINE:
|
258
|
+
msg = f"Host nodes are not online"
|
259
|
+
logger.error(msg)
|
260
|
+
return False, msg
|
261
|
+
|
262
|
+
sec_rpc_client = RPCClient(sec_node.mgmt_ip, sec_node.rpc_port, sec_node.rpc_username, sec_node.rpc_password)
|
263
|
+
ret = sec_rpc_client.delete_lvol(snap.snap_bdev)
|
264
|
+
if not ret:
|
265
|
+
logger.error(f"Failed to delete snap from node: {sec_node.get_id()}")
|
266
|
+
if not force_delete:
|
267
|
+
return False
|
270
268
|
|
271
269
|
snap.remove(db_controller.kv_store)
|
272
270
|
|
@@ -303,10 +301,10 @@ def clone(snapshot_id, clone_name, new_size=0):
|
|
303
301
|
logger.error(msg)
|
304
302
|
return False, msg
|
305
303
|
|
306
|
-
if snode.status != snode.STATUS_ONLINE:
|
307
|
-
|
308
|
-
|
309
|
-
|
304
|
+
# if snode.status != snode.STATUS_ONLINE:
|
305
|
+
# msg = "Storage node in not Online"
|
306
|
+
# logger.error(msg)
|
307
|
+
# return False, msg
|
310
308
|
|
311
309
|
ref_count = snap.ref_count
|
312
310
|
if snap.snap_ref_id:
|
@@ -418,32 +416,48 @@ def clone(snapshot_id, clone_name, new_size=0):
|
|
418
416
|
|
419
417
|
lvol.write_to_db(db_controller.kv_store)
|
420
418
|
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
419
|
+
if snode.status == StorageNode.STATUS_ONLINE:
|
420
|
+
|
421
|
+
lvol_bdev, error = lvol_controller.add_lvol_on_node(lvol, snode)
|
422
|
+
if error:
|
423
|
+
return False, error
|
424
|
+
lvol.nodes = [snode.get_id()]
|
425
|
+
lvol.lvol_uuid = lvol_bdev['uuid']
|
426
|
+
lvol.blobid = lvol_bdev['driver_specific']['lvol']['blobid']
|
427
|
+
|
428
|
+
if snap.lvol.ha_type == "ha":
|
429
|
+
sec_node = db_controller.get_storage_node_by_id(snode.secondary_node_id)
|
430
|
+
if sec_node.status == StorageNode.STATUS_ONLINE:
|
431
|
+
ret, error = lvol_controller.add_lvol_on_node(lvol, sec_node, ha_inode_self=1)
|
432
|
+
if error:
|
433
|
+
logger.error(error)
|
434
|
+
logger.error(f"Failed to add clone on node: {sec_node.get_id()}")
|
435
|
+
logger.info(f"Removing clone from {snode.get_id()}")
|
436
|
+
lvol.status = LVol.STATUS_IN_DELETION
|
437
|
+
lvol.write_to_db(db_controller.kv_store)
|
438
|
+
ret = lvol_controller.delete_lvol_from_node(lvol.get_id(), snode.get_id())
|
439
|
+
if ret:
|
440
|
+
lvol.remove(db_controller.kv_store)
|
441
|
+
else:
|
442
|
+
logger.error(f"Failed to remove clone from node {snode.get_id()}, LVol status: {lvol.status}")
|
443
|
+
|
444
|
+
return False, error
|
445
|
+
|
446
|
+
lvol.nodes.append(snode.secondary_node_id)
|
427
447
|
|
428
|
-
|
448
|
+
else:
|
429
449
|
sec_node = db_controller.get_storage_node_by_id(snode.secondary_node_id)
|
430
|
-
if sec_node.status
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
else:
|
442
|
-
logger.error(f"Failed to remove clone from node {snode.get_id()}, LVol status: {lvol.status}")
|
443
|
-
|
444
|
-
return False, error
|
445
|
-
|
446
|
-
lvol.nodes.append(snode.secondary_node_id)
|
450
|
+
if not sec_node or sec_node.status != StorageNode.STATUS_ONLINE:
|
451
|
+
msg = f"Host nodes are not online"
|
452
|
+
logger.error(msg)
|
453
|
+
return False, msg
|
454
|
+
|
455
|
+
lvol_bdev, error = lvol_controller.add_lvol_on_node(lvol, sec_node)
|
456
|
+
if error:
|
457
|
+
return False, error
|
458
|
+
lvol.nodes = [snode.get_id(), sec_node.get_id()]
|
459
|
+
lvol.lvol_uuid = lvol_bdev['uuid']
|
460
|
+
lvol.blobid = lvol_bdev['driver_specific']['lvol']['blobid']
|
447
461
|
|
448
462
|
|
449
463
|
lvol.write_to_db(db_controller.kv_store)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
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_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/controllers/caching_node_controller.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
|
{sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2
RENAMED
File without changes
|
File without changes
|
{sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/clean_local_storage_deploy.sh
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/scripts/dashboards/node-exporter.json
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
|
{sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/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_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/cached_lvol_stat_collector.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/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
|
{sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/main_distr_event_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
|
{sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/simplyblock_core/services/tasks_runner_failed_migration.py
RENAMED
File without changes
|
File without changes
|
{sbcli_hmdi-0.0.8 → sbcli_hmdi-0.0.9}/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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|