One of the problem with running a tape drive as an iscsi target is that there was no software I found that worked. I tried IETD, TGT, and of course TARGETCLI. After thinking and googling about this problem for about a day or so I decided to see if I could patch the python code on which targetcli runs. I am suprised I can still code!!! This tool me perhaps half an hour to figure, it has been a long time since i wrote any thing.
This file is ... rtslib/utils.py
-----------PATCH 1 of 2 --------------------------------------
1. In function convert_scsi_path_to_hctl
OLD:
try:
hctl = os.listdir("/sys/block/%s/device/scsi_device"
% devname)[0].split(':')
except:
return None
return [int(data) for data in hctl]
NEW:
try:
hctl = os.listdir("/sys/block/%s/device/scsi_device"
% devname)[0].split(':')
return [int(data) for data in hctl]
except OSError: pass
try:
hctl = os.listdir("/sys/class/scsi_tape/%s/device/scsi_device"
% devname)[0].split(':')
return [int(data) for data in hctl]
except OSError: pass
return None
-----------PATCH 2 of 2 --------------------------------------
In function convert_scsi_hctl_to_path
OLD:
for devname in os.listdir("/sys/block"):
path = "/dev/%s" % devname
hctl = [host, controller, target, lun]
if convert_scsi_path_to_hctl(path) == hctl:
return os.path.realpath(path)
NEW:
for devname in os.listdir("/sys/block"):
path = "/dev/%s" % devname
hctl = [host, controller, target, lun]
if convert_scsi_path_to_hctl(path) == hctl:
return os.path.realpath(path)
try:
for devname in os.listdir("/sys/class/scsi_tape"):
path = "/dev/%s" % devname
hctl = [host, controller, target, lun]
if convert_scsi_path_to_hctl(path) == hctl:
return os.path.realpath(path)
except OSError: pass
Subscribe to:
Post Comments (Atom)
Creating ipip tunnels in RedHat 8 that is compatible with LVS/TUN. Every few seasons I built a virtual LVS (Linux Virtual Server) mock up ju...
-
Occasionally we are troubled by failure alerts; since I have installed the check_crm nagios monitor plugin the alert seems more 'sensiti...
-
This is how to set up a dummy interface on RedHat/CentOS 8.x. I cannot make the old style of init scripts in /etc/sysconfig/network-scripts...
-
While testing pacemaker clustering with iscsi (on redhat 8 beta) I came upon this error: Pending Fencing Actions: * unfencing of rh-8beta...
No comments:
Post a Comment