sbcli-dev 10.3.2__tar.gz → 10.3.4__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/PKG-INFO +1 -1
  2. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/sbcli_dev.egg-info/PKG-INFO +1 -1
  3. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/env_var +1 -1
  4. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/rpc_client.py +1 -1
  5. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/lvol_stat_collector.py +1 -1
  6. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/storage_node_monitor.py +1 -1
  7. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/tasks_runner_failed_migration.py +15 -1
  8. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/tasks_runner_migration.py +14 -9
  9. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/tasks_runner_new_dev_migration.py +14 -9
  10. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/storage_node_ops.py +5 -5
  11. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/README.md +0 -0
  12. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/pyproject.toml +0 -0
  13. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/requirements.txt +0 -0
  14. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/sbcli_dev.egg-info/SOURCES.txt +0 -0
  15. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/sbcli_dev.egg-info/dependency_links.txt +0 -0
  16. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/sbcli_dev.egg-info/entry_points.txt +0 -0
  17. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/sbcli_dev.egg-info/requires.txt +0 -0
  18. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/sbcli_dev.egg-info/top_level.txt +0 -0
  19. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/setup.cfg +0 -0
  20. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/setup.py +0 -0
  21. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_cli/__init__.py +0 -0
  22. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_cli/cli.py +0 -0
  23. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_cli/main.py +0 -0
  24. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/__init__.py +0 -0
  25. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/cluster_ops.py +0 -0
  26. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/cnode_client.py +0 -0
  27. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/constants.py +0 -0
  28. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/__init__.py +0 -0
  29. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/caching_node_controller.py +0 -0
  30. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/cluster_events.py +0 -0
  31. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/device_controller.py +0 -0
  32. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/device_events.py +0 -0
  33. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/events_controller.py +0 -0
  34. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/health_controller.py +0 -0
  35. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/lvol_controller.py +0 -0
  36. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/lvol_events.py +0 -0
  37. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/mgmt_events.py +0 -0
  38. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/pool_controller.py +0 -0
  39. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/pool_events.py +0 -0
  40. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/snapshot_controller.py +0 -0
  41. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/snapshot_events.py +0 -0
  42. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/storage_events.py +0 -0
  43. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/tasks_controller.py +0 -0
  44. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/controllers/tasks_events.py +0 -0
  45. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/db_controller.py +0 -0
  46. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/distr_controller.py +0 -0
  47. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/mgmt_node_ops.py +0 -0
  48. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/__init__.py +0 -0
  49. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/base_model.py +0 -0
  50. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/caching_node.py +0 -0
  51. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/cluster.py +0 -0
  52. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/deployer.py +0 -0
  53. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/events.py +0 -0
  54. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/iface.py +0 -0
  55. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/job_schedule.py +0 -0
  56. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/lvol_model.py +0 -0
  57. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/mgmt_node.py +0 -0
  58. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/nvme_device.py +0 -0
  59. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/pool.py +0 -0
  60. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/port_stat.py +0 -0
  61. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/snapshot.py +0 -0
  62. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/stats.py +0 -0
  63. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/models/storage_node.py +0 -0
  64. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/pci_utils.py +0 -0
  65. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/__init__.py +0 -0
  66. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2 +0 -0
  67. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/alerting/alert_rules.yaml +0 -0
  68. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/clean_local_storage_deploy.sh +0 -0
  69. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/config_docker.sh +0 -0
  70. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/dashboard.yml +0 -0
  71. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/dashboards/cluster.json +0 -0
  72. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/dashboards/devices.json +0 -0
  73. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/dashboards/lvols.json +0 -0
  74. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/dashboards/node-exporter.json +0 -0
  75. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/dashboards/nodes.json +0 -0
  76. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/dashboards/pools.json +0 -0
  77. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/datasource.yml +0 -0
  78. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/db_config_double.sh +0 -0
  79. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/db_config_single.sh +0 -0
  80. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/deploy_fdb.sh +0 -0
  81. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/deploy_stack.sh +0 -0
  82. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml +0 -0
  83. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/docker-compose-swarm.yml +0 -0
  84. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/foundation.yml +0 -0
  85. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/haproxy.cfg +0 -0
  86. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/install_deps.sh +0 -0
  87. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/objstore.yml +0 -0
  88. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/prepare_fdb.sh +0 -0
  89. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/prometheus.yml +0 -0
  90. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/run_ssh.sh +0 -0
  91. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/set_db_config.sh +0 -0
  92. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/scripts/stack_deploy_wait.sh +0 -0
  93. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/__init__.py +0 -0
  94. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/cached_lvol_stat_collector.py +0 -0
  95. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/caching_node_monitor.py +0 -0
  96. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/cap_monitor.py +0 -0
  97. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/capacity_and_stats_collector.py +0 -0
  98. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/device_monitor.py +0 -0
  99. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/health_check_service.py +0 -0
  100. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/install_service.sh +0 -0
  101. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/log_agg_service.py +0 -0
  102. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/lvol_monitor.py +0 -0
  103. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/main_distr_event_collector.py +0 -0
  104. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/mgmt_node_monitor.py +0 -0
  105. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/new_device_discovery.py +0 -0
  106. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/port_stat_collector.py +0 -0
  107. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/remove_service.sh +0 -0
  108. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/service_template.service +0 -0
  109. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/spdk_http_proxy_server.py +0 -0
  110. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/tasks_runner_node_add.py +0 -0
  111. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/services/tasks_runner_restart.py +0 -0
  112. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/shell_utils.py +0 -0
  113. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/snode_client.py +0 -0
  114. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/utils.py +0 -0
  115. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_core/workers/cleanup_foundationdb.py +0 -0
  116. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/README.md +0 -0
  117. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/__init__.py +0 -0
  118. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/app.py +0 -0
  119. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/auth_middleware.py +0 -0
  120. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/__init__.py +0 -0
  121. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/caching_node_ops.py +0 -0
  122. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/caching_node_ops_k8s.py +0 -0
  123. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/node_api_basic.py +0 -0
  124. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/node_api_caching_docker.py +0 -0
  125. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/node_api_caching_ks.py +0 -0
  126. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/snode_ops.py +0 -0
  127. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/snode_ops_k8s.py +0 -0
  128. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/web_api_caching_node.py +0 -0
  129. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/web_api_cluster.py +0 -0
  130. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/web_api_deployer.py +0 -0
  131. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/web_api_device.py +0 -0
  132. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/web_api_lvol.py +0 -0
  133. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/web_api_mgmt_node.py +0 -0
  134. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/web_api_pool.py +0 -0
  135. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/web_api_snapshot.py +0 -0
  136. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/blueprints/web_api_storage_node.py +0 -0
  137. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/caching_node_app.py +0 -0
  138. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/caching_node_app_k8s.py +0 -0
  139. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/node_utils.py +0 -0
  140. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/node_webapp.py +0 -0
  141. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/requirements.txt +0 -0
  142. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/snode_app.py +0 -0
  143. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/snode_app_k8s.py +0 -0
  144. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/static/delete.py +0 -0
  145. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/static/deploy.py +0 -0
  146. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/static/deploy_cnode.yaml +0 -0
  147. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/static/deploy_spdk.yaml +0 -0
  148. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/static/is_up.py +0 -0
  149. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/static/list_deps.py +0 -0
  150. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/static/rpac.yaml +0 -0
  151. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/static/tst.py +0 -0
  152. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/templates/caching_deploy_spdk.yaml.j2 +0 -0
  153. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/templates/storage_deploy_spdk.yaml.j2 +0 -0
  154. {sbcli_dev-10.3.2 → sbcli_dev-10.3.4}/simplyblock_web/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sbcli-dev
3
- Version: 10.3.2
3
+ Version: 10.3.4
4
4
  Summary: CLI for managing SimplyBlock cluster
5
5
  Home-page: https://www.simplyblock.io/
6
6
  Author: Hamdy
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sbcli-dev
3
- Version: 10.3.2
3
+ Version: 10.3.4
4
4
  Summary: CLI for managing SimplyBlock cluster
5
5
  Home-page: https://www.simplyblock.io/
6
6
  Author: Hamdy
@@ -1,5 +1,5 @@
1
1
  SIMPLY_BLOCK_COMMAND_NAME=sbcli-dev
2
- SIMPLY_BLOCK_VERSION=10.3.2
2
+ SIMPLY_BLOCK_VERSION=10.3.4
3
3
 
4
4
  SIMPLY_BLOCK_DOCKER_IMAGE=simplyblock/simplyblock:main
5
5
  DOCKER_USER=hamdysimplyblock
@@ -27,7 +27,7 @@ class RPCClient:
27
27
  # ref: https://spdk.io/doc/jsonrpc.html
28
28
  DEFAULT_ALLOWED_METHODS = ["HEAD", "GET", "PUT", "DELETE", "OPTIONS", "TRACE", "POST"]
29
29
 
30
- def __init__(self, ip_address, port, username, password, timeout=60, retry=3):
30
+ def __init__(self, ip_address, port, username, password, timeout=180, retry=3):
31
31
  self.ip_address = ip_address
32
32
  self.port = port
33
33
  self.url = 'http://%s:%s/' % (self.ip_address, self.port)
@@ -49,7 +49,7 @@ def add_lvol_stats(cluster, pool, lvol, stats_list, capacity_dict=None, connecte
49
49
  size_used = 0
50
50
  lvol_dict = capacity_dict[0]
51
51
  size_total = int(lvol_dict['num_blocks']*lvol_dict['block_size'])
52
- cluster_size = cluster.ndcs * cluster.page_size_in_blocks
52
+ cluster_size = cluster.distr_ndcs * cluster.page_size_in_blocks
53
53
  if "driver_specific" in lvol_dict and "lvol" in lvol_dict["driver_specific"]:
54
54
  num_allocated_clusters = lvol_dict["driver_specific"]["lvol"]["num_allocated_clusters"]
55
55
  size_used = int(num_allocated_clusters*cluster_size)
@@ -138,7 +138,7 @@ def update_cluster_status(cluster_id):
138
138
  break
139
139
 
140
140
  if node.online_since:
141
- diff = datetime.now() - datetime.fromisoformat(snode.online_since)
141
+ diff = datetime.now() - datetime.fromisoformat(node.online_since)
142
142
  if diff.total_seconds() < 60:
143
143
  can_activate = False
144
144
  break
@@ -2,7 +2,7 @@
2
2
  import logging
3
3
  import time
4
4
  import sys
5
-
5
+ from datetime import datetime
6
6
 
7
7
  from simplyblock_core import constants, db_controller, utils
8
8
  from simplyblock_core.controllers import tasks_events, tasks_controller, device_controller
@@ -33,6 +33,20 @@ def task_runner(task):
33
33
  return True
34
34
 
35
35
  if task.status in [JobSchedule.STATUS_NEW ,JobSchedule.STATUS_SUSPENDED]:
36
+ if task.status == JobSchedule.STATUS_NEW:
37
+ for node in db_controller.get_storage_nodes_by_cluster_id(task.cluster_id):
38
+ if node.online_since:
39
+ try:
40
+ diff = datetime.now() - datetime.fromisoformat(node.online_since)
41
+ if diff.total_seconds() < 60:
42
+ task.function_result = "node is online < 1 min, retrying"
43
+ task.status = JobSchedule.STATUS_SUSPENDED
44
+ task.retry += 1
45
+ task.write_to_db(db_controller.kv_store)
46
+ return False
47
+ except Exception as e:
48
+ logger.error(f"Failed to get online since: {e}")
49
+
36
50
  task.status = JobSchedule.STATUS_RUNNING
37
51
  task.write_to_db(db_controller.kv_store)
38
52
  tasks_events.task_updated(task)
@@ -30,6 +30,20 @@ def task_runner(task):
30
30
  return True
31
31
 
32
32
  if task.status in [JobSchedule.STATUS_NEW, JobSchedule.STATUS_SUSPENDED]:
33
+ if task.status == JobSchedule.STATUS_NEW:
34
+ for node in db_controller.get_storage_nodes_by_cluster_id(task.cluster_id):
35
+ if node.online_since:
36
+ try:
37
+ diff = datetime.now() - datetime.fromisoformat(node.online_since)
38
+ if diff.total_seconds() < 60:
39
+ task.function_result = "node is online < 1 min, retrying"
40
+ task.status = JobSchedule.STATUS_SUSPENDED
41
+ task.retry += 1
42
+ task.write_to_db(db_controller.kv_store)
43
+ return False
44
+ except Exception as e:
45
+ logger.error(f"Failed to get online since: {e}")
46
+
33
47
  task.status = JobSchedule.STATUS_RUNNING
34
48
  task.write_to_db(db_controller.kv_store)
35
49
  tasks_events.task_updated(task)
@@ -41,15 +55,6 @@ def task_runner(task):
41
55
  task.write_to_db(db_controller.kv_store)
42
56
  return False
43
57
 
44
- if snode.online_since:
45
- diff = datetime.now() - datetime.fromisoformat(snode.online_since)
46
- if diff.total_seconds() < 60:
47
- task.function_result = "node is online < 1 min, retrying"
48
- task.status = JobSchedule.STATUS_SUSPENDED
49
- task.retry += 1
50
- task.write_to_db(db_controller.kv_store)
51
- return False
52
-
53
58
  rpc_client = RPCClient(snode.mgmt_ip, snode.rpc_port, snode.rpc_username, snode.rpc_password,
54
59
  timeout=5, retry=2)
55
60
  if "migration" not in task.function_params:
@@ -33,6 +33,20 @@ def task_runner(task):
33
33
  return True
34
34
 
35
35
  if task.status in [JobSchedule.STATUS_NEW ,JobSchedule.STATUS_SUSPENDED]:
36
+ if task.status == JobSchedule.STATUS_NEW:
37
+ for node in db_controller.get_storage_nodes_by_cluster_id(task.cluster_id):
38
+ if node.online_since:
39
+ try:
40
+ diff = datetime.now() - datetime.fromisoformat(node.online_since)
41
+ if diff.total_seconds() < 60:
42
+ task.function_result = "node is online < 1 min, retrying"
43
+ task.status = JobSchedule.STATUS_SUSPENDED
44
+ task.retry += 1
45
+ task.write_to_db(db_controller.kv_store)
46
+ return False
47
+ except Exception as e:
48
+ logger.error(f"Failed to get online since: {e}")
49
+
36
50
  task.status = JobSchedule.STATUS_RUNNING
37
51
  task.write_to_db(db_controller.kv_store)
38
52
  tasks_events.task_updated(task)
@@ -44,15 +58,6 @@ def task_runner(task):
44
58
  task.write_to_db(db_controller.kv_store)
45
59
  return False
46
60
 
47
- if snode.online_since:
48
- diff = datetime.now() - datetime.fromisoformat(snode.online_since)
49
- if diff.total_seconds() < 60:
50
- task.function_result = "node is online < 1 min, retrying"
51
- task.status = JobSchedule.STATUS_SUSPENDED
52
- task.retry += 1
53
- task.write_to_db(db_controller.kv_store)
54
- return False
55
-
56
61
  rpc_client = RPCClient(snode.mgmt_ip, snode.rpc_port, snode.rpc_username, snode.rpc_password, timeout=5, retry=2)
57
62
  if "migration" not in task.function_params:
58
63
  all_devs_online = True
@@ -866,7 +866,7 @@ def _connect_to_remote_jm_devs(this_node, jm_ids=[]):
866
866
  continue
867
867
  if node.jm_device and node.jm_device.status == JMDevice.STATUS_ONLINE:
868
868
  remote_devices.append(node.jm_device)
869
- if len(remote_devices) >= 2 :
869
+ if len(remote_devices) >= 3 :
870
870
  break
871
871
 
872
872
  new_devs = []
@@ -2793,7 +2793,7 @@ def get_next_ha_jms(current_node):
2793
2793
  except :
2794
2794
  pass
2795
2795
  jm_count = dict(sorted(jm_count.items(), key=lambda x: x[1]))
2796
- return list(jm_count.keys())[:2]
2796
+ return list(jm_count.keys())[:3]
2797
2797
 
2798
2798
 
2799
2799
  def get_node_jm_names(current_node):
@@ -2805,7 +2805,7 @@ def get_node_jm_names(current_node):
2805
2805
  jm_list.append("JM_LOCAL")
2806
2806
 
2807
2807
  if current_node.enable_ha_jm:
2808
- for jm_dev in current_node.remote_jm_devices[:2]:
2808
+ for jm_dev in current_node.remote_jm_devices[:3]:
2809
2809
  jm_list.append(jm_dev.remote_bdev)
2810
2810
  return jm_list
2811
2811
 
@@ -2939,7 +2939,7 @@ def create_lvstore(snode, ndcs, npcs, distr_bs, distr_chunk_bs, page_size_in_blo
2939
2939
  return True
2940
2940
 
2941
2941
 
2942
- def _create_bdev_stack(snode, lvstore_stack=None, primary_node=False):
2942
+ def _create_bdev_stack(snode, lvstore_stack=None, primary_node=None):
2943
2943
  rpc_client = RPCClient(snode.mgmt_ip, snode.rpc_port, snode.rpc_username, snode.rpc_password)
2944
2944
 
2945
2945
  created_bdevs = []
@@ -2971,7 +2971,7 @@ def _create_bdev_stack(snode, lvstore_stack=None, primary_node=False):
2971
2971
  jm_list.append(bdev_name)
2972
2972
  else:
2973
2973
  jm_list.append("JM_LOCAL")
2974
- for jm_dev in primary_node.remote_jm_devices[:2]:
2974
+ for jm_dev in primary_node.remote_jm_devices[:3]:
2975
2975
  jm_list.append(jm_dev.remote_bdev)
2976
2976
  params['jm_names'] = jm_list
2977
2977
  else:
File without changes
File without changes
File without changes
File without changes
File without changes