Skip to content

Commit b2d2382

Browse files
committed
Merge branch 'ZSTAC-64980@@3' into '5.1.0'
<fix>[bm-instance-agent]: add detach volume for expon volume See merge request zstackio/zstack-utility!4713
2 parents 98063a7 + 9ab64d1 commit b2d2382

File tree

1 file changed

+12
-15
lines changed
  • bm-instance-agent/bm_instance_agent/systems/linux

1 file changed

+12
-15
lines changed

bm-instance-agent/bm_instance_agent/systems/linux/driver.py

+12-15
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@
3131
rr_weight priorities
3232
no_path_retry fail
3333
}
34+
device {
35+
vendor "ET"
36+
product "ET_WDS"
37+
hardware_handler "0"
38+
path_grouping_policy "multibus"
39+
path_selector "queue-length 0"
40+
failback immediate
41+
path_checker tur
42+
prio const
43+
no_path_retry fail
44+
fast_io_fail_tmo 120
45+
}
3446
}
3547
"""
3648

@@ -100,18 +112,6 @@ def rescan_sids_target_name(target_name):
100112
LOG.info("iscsiadm -m session -r %s --rescan fail, because %s" % (session_id, stderr))
101113

102114

103-
def rescan_for_detach(volume_obj):
104-
volume_iqn = volume_obj.iscsi_path.replace('iscsi://', '').split("/")[1].strip()
105-
if volume_iqn:
106-
LOG.info("skip rescan for detach")
107-
return
108-
109-
stdout, stderr = processutils.trycmd("timeout 30 iscsiadm -m session -R", shell=True)
110-
if stderr:
111-
LOG.info("timeout 30 iscsiadm -m session -R failed, because %s" % stderr)
112-
return
113-
114-
115115
class LinuxDriver(base.SystemDriverBase):
116116
driver_name = 'linux'
117117

@@ -255,14 +255,11 @@ def detach_volume(self, instance_obj, volume_obj, volume_access_path_gateway_ips
255255
"""
256256
for volume_access_path_gateway_ip in volume_access_path_gateway_ips:
257257
self.detach_volume_for_target_ip(instance_obj, volume_obj, volume_access_path_gateway_ip)
258-
rescan_for_detach(volume_obj)
259258

260259
def detach_volume_for_target_ip(self, instance_obj, volume_obj, target_ip):
261260
# Get the session id
262261
sid = None
263262
volume_iqn = volume_obj.iscsi_path.replace('iscsi://', '').split("/")[1]
264-
if not volume_iqn:
265-
return
266263
if instance_obj.custom_iqn:
267264
iqn = instance_obj.custom_iqn
268265
elif volume_iqn:

0 commit comments

Comments
 (0)