Skip to content

Commit c46cbc3

Browse files
committed
fix connection in case device node is online or down
1 parent 0ebb8fc commit c46cbc3

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎simplyblock_core/controllers/health_controller.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,9 @@ def _check_node_lvstore(
408408
if result['Kind'] == "Device":
409409
if result['Found Status']:
410410
dev = db_controller.get_storage_device_by_id(result['UUID'])
411-
if dev.status == NVMeDevice.STATUS_ONLINE:
411+
dev_node = db_controller.get_storage_node_by_id(dev.node_id)
412+
if dev.status == NVMeDevice.STATUS_ONLINE and dev_node.status in [
413+
StorageNode.STATUS_ONLINE, StorageNode.STATUS_DOWN]:
412414
try:
413415
remote_bdev = storage_node_ops.connect_device(
414416
f"remote_{dev.alceml_bdev}", dev, node,

‎simplyblock_core/services/health_check_service.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def check_node(snode, logger):
139139
for remote_device in snode.remote_devices:
140140
org_dev = db.get_storage_device_by_id(remote_device.get_id())
141141
org_node = db.get_storage_node_by_id(remote_device.node_id)
142-
if org_dev.status == NVMeDevice.STATUS_ONLINE and org_node.status == StorageNode.STATUS_ONLINE:
142+
if org_dev.status == NVMeDevice.STATUS_ONLINE and org_node.status in [StorageNode.STATUS_ONLINE, StorageNode.STATUS_DOWN]:
143143
if health_controller.check_bdev(remote_device.remote_bdev, bdev_names=node_bdev_names):
144144
connected_devices.append(remote_device.get_id())
145145
continue

0 commit comments

Comments
 (0)