WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] bug in scsiutil.py + patch

To: Alexandre Bezroutchko <abb@xxxxxxxxxxxx>
Subject: Re: [Xen-users] bug in scsiutil.py + patch
From: David Markey <admin@xxxxxxxxxxx>
Date: Wed, 11 May 2011 09:22:46 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx, xen-api@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 11 May 2011 01:23:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DC9E488.20807@xxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <4DC9E488.20807@xxxxxxxxxxxx>
Reply-to: admin@xxxxxxxxxxx
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>