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

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

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] bug in scsiutil.py + patch
From: Alexandre Bezroutchko <abb@xxxxxxxxxxxx>
Date: Wed, 11 May 2011 03:21:12 +0200
Delivery-date: Tue, 10 May 2011 18:22:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10
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


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
<Prev in Thread] Current Thread [Next in Thread>