Skip to content

Commit 7129208

Browse files
detach controller before attach remote devs
1 parent d9a0288 commit 7129208

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

env_var

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SIMPLY_BLOCK_COMMAND_NAME=sbcli-dev
2-
SIMPLY_BLOCK_VERSION=4.0.15
2+
SIMPLY_BLOCK_VERSION=4.0.16
33

44

55
SIMPLY_BLOCK_DOCKER_IMAGE=simplyblock/simplyblock:main-dev

simplyblock_core/cluster_ops.py

-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626

2727

2828
def _create_update_user(cluster_id, grafana_url, grafana_secret, user_secret, update_secret=False):
29-
if not grafana_url.startswith("https://"):
30-
if grafana_url.startswith("http://"):
31-
grafana_url = grafana_url.replace("http://", "https://", 1)
32-
else:
33-
grafana_url = "https://" + grafana_url
34-
3529
session = requests.session()
3630
session.auth = ("admin", grafana_secret)
3731
headers = {

simplyblock_core/services/main_distr_event_collector.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def process_device_event(event):
5050
if device.node_id != node_id:
5151
logger.info(f"Setting storage id: {storage_id} unavailable")
5252
distr_controller.send_dev_status_event(device, NVMeDevice.STATUS_UNAVAILABLE, node)
53-
if device.status == NVMeDevice.STATUS_ONLINE:
54-
device_controller.device_set_io_error(device_id, True)
55-
device_controller.device_set_unavailable(device_id)
53+
# if device.status == NVMeDevice.STATUS_ONLINE:
54+
# device_controller.device_set_io_error(device_id, True)
55+
# device_controller.device_set_unavailable(device_id)
5656

5757
else:
5858
if node.status not in [StorageNode.STATUS_ONLINE, StorageNode.STATUS_SUSPENDED]:

simplyblock_core/storage_node_ops.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,10 @@ def _connect_to_remote_jm_devs(this_node, jm_ids=[]):
829829
logger.debug(f"bdev found {bdev_name}")
830830
jm_dev.status = JMDevice.STATUS_ONLINE
831831
else:
832-
logger.info(f"Connecting {this_node.get_id()} to {name}")
832+
833+
logger.info(f"Connecting {name} to {this_node.get_id()}")
834+
ret = rpc_client.bdev_nvme_detach_controller(name)
835+
time.sleep(1)
833836
ret = rpc_client.bdev_nvme_attach_controller_tcp(
834837
name, jm_dev.nvmf_nqn, jm_dev.nvmf_ip, jm_dev.nvmf_port)
835838
if ret:
@@ -1704,8 +1707,11 @@ def restart_storage_node(
17041707

17051708
if snode.enable_ha_jm:
17061709
logger.info("Connecting to remote JMs")
1710+
snode.remote_jm_devices = []
17071711
snode.remote_jm_devices = _connect_to_remote_jm_devs(snode)
17081712

1713+
snode.write_to_db(db_controller.kv_store)
1714+
17091715
logger.info("Setting node status to Online")
17101716
set_node_status(node_id, StorageNode.STATUS_ONLINE)
17111717

0 commit comments

Comments
 (0)