Skip to content

Commit

Permalink
CA-401068: if iSCSI device path is not found scan the bus
Browse files Browse the repository at this point in the history
It's possible that a new LUN has been exported since we created the
iSCSI session and we might not see it. Try to scan the iSCSI bus and
see if the expected device appears.

Signed-off-by: Mark Syms <[email protected]>
  • Loading branch information
MarkSymsCtx committed Nov 1, 2024
1 parent 3e4c041 commit 698dd99
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/BaseISCSI.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ def attach(self, sr_uuid):
if self.mpath == 'true':
self.mpathmodule.refresh(self.dconf['SCSIid'], 0)
dev_path = os.path.join("/dev/disk/by-scsid", self.dconf['SCSIid'])
if not os.path.exists(dev_path):
# LUN may have been added to the SAN since the session was created
iscsilib.refresh_luns(self.targetIQN, self.target)

if not os.path.exists(dev_path):
raise xs_errors.XenError('ConfigSCSIid')

Expand Down

0 comments on commit 698dd99

Please sign in to comment.