[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-users] bug in scsiutil.py + patch
Yea i've seen this before.
An alternative is for udev to create symlinks that scsiutil.py can consume for this particular device.
On 11 May 2011 02:21, Alexandre Bezroutchko <abb@xxxxxxxxxxxx> wrote:
Hi,
There appears to be a bug in iSCSI helper script in Xenserver 5.6 FP1. I had problems configuring iSCSI SR on my XenServer -- it kept complaining about SR backend failure when I tried to enumerate LUNs from XenCenter. The following errors appeared in /var/log/xensource.log:
[20110511T00:36:48.881Z|debug|bruxenprd2|1357|sm_exec D:60211d883f03|dispatcher] Raised at hashtbl.ml:93.19-28 -> debug.ml:100.36-65
[20110511T00:36:48.881Z|debug|bruxenprd2|1357|sm_exec D:60211d883f03|backtrace] Raised at hashtbl.ml:93.19-28 -> debug.ml:100.36-65
[20110511T00:36:48.881Z|debug|bruxenprd2|1357|sm_exec D:60211d883f03|xapi] Raised at server_helpers.ml:92.14-15 -> pervasiveext.ml:22.2-9
[20110511T00:36:48.881Z|debug|bruxenprd2|1357|sm_exec D:60211d883f03|xapi] Raised at pervasiveext.ml:26.22-25 -> pervasiveext.ml:22.2-9
[20110511T00:36:48.881Z|debug|bruxenprd2|1357|Async.SR.create R:0cf1e544324a|backtrace] Raised at xapi_sr.ml:310.10-11 -> rbac.ml:230.16-23
[20110511T00:36:48.882Z|debug|bruxenprd2|1357|Async.SR.create R:0cf1e544324a|backtrace] Raised at hashtbl.ml:93.19-28 -> debug.ml:100.36-65
[20110511T00:36:48.882Z|debug|bruxenprd2|1357|Async.SR.create R:0cf1e544324a|dispatcher] Server_helpers.exec exception_handler: Got exception SR_BACKEND_FAILURE: [ non-zero exit; ; Traceback (most recent call last):
File "/opt/xensource/sm/LVMoISCSISR", line 378, in ?
SRCommand.run(LVHDoISCSISR, DRIVER_INFO)
File "/opt/xensource/sm/SRCommand.py", line 244, in run
sr = driver(cmd, cmd.sr_uuid)
File "/opt/xensource/sm/SR.py", line 128, in __init__
self.load(sr_uuid)
File "/opt/xensource/sm/LVMoISCSISR", line 75, in load
iscsi = driver(self.original_srcmd, sr_uuid)
File "/opt/xensource/sm/SR.py", line 128, in __init__
self.load(sr_uuid)
File "/opt/xensource/sm/util.py", line 1155, in transform
return func(inst, *args, **kwargs)
File "/opt/xensource/sm/ISCSISR.py", line 167, in load
self._initPaths()
File "/opt/xensource/sm/ISCSISR.py", line 170, in _initPaths
self._init_adapters()
File "/opt/xensource/sm/ISCSISR.py", line 236, in _init_adapters
self.devs = scsiutil.cacheSCSIidentifiers()
File "/opt/xensource/sm/scsiutil.py", line 129, in cacheSCSIidentifiers
line = "NONE %s %s %s %s 0 %s" % \
IndexError: list index out of range
]
It turned out that scsiutil.py module fails to parse some SCSI device names in the system. On my server I have:
[root@bruxenprd2 log]# ls -l /dev/disk/by-scsibus/
total 0
lrwxrwxrwx 1 root root 9 May 11 02:53 14f504e46494c450046564a6477552d627939582d436b7431-12:0:0:0 -> ../../sdc
drwxr-xr-x 2 root root 60 May 11 02:32 1JMicron_USB_to_ATA
lrwxrwxrwx 1 root root 9 May 11 02:32 36782bcb028c58b00154215b0077d0c9b-0:2:0:0 -> ../../sda
and "1JMicron_USB_to_ATA" entry breaks things. The following patch has helped me:
---------------------------------------------------------------------------------------------------------------
diff -u /opt/xensource/sm/scsiutil.py- /opt/xensource/sm/scsiutil.py
--- /opt/xensource/sm/scsiutil.py- 2011-05-11 02:49:17.000000000 +0200
+++ /opt/xensource/sm/scsiutil.py 2011-05-11 02:51:54.000000000 +0200
@@ -126,6 +126,8 @@
for node in glob.glob(SYS_PATH):
dev = os.path.realpath(node)
HBTL = os.path.basename(node).split("-")[-1].split(":")
+ if len(HBTL) != 4:
+ continue
line = "NONE %s %s %s %s 0 %s" % \
(HBTL[0],HBTL[1],HBTL[2],HBTL[3],dev)
ids = line.split()
---------------------------------------------------------------------------------------------------------------
It works ok, but I wonder if this is a correct solution.
Best regards,
Alex
www.gremwell.com
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
|