Skip to contentSkip to conversation

reports of xend not starting

PATCH Jim Fehlig 2 participants 3 messages Mar 4, 2010 – Mar 5, 2010

lore
Share & tools
lore

Jim Fehlig

author
#0 lore raw

Hi Kan,

I've received several reports of xend not starting with the following traceback

[2010-03-04 13:24:10 9096] ERROR (SrvDaemon:349) Exception starting xend ('044dde78-2896-cb88-2ada-3c03a73c35c1') Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvDaemon.py", line 341, in run
servers = SrvServer.create()
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvServer.py", line 261, in create
root.putChild('xend', SrvRoot())
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvRoot.py", line 40, in __init__
self.get(name)
File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 84, in get
val = val.getobj()
File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 52, in getobj
self.obj = klassobj()
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvNode.py", line 30, in __init__
self.xn = XendNode.instance()
File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 1187, in instance
inst = XendNode()
File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 161, in __init__

    self._init_PSCSIs()

File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 339, in _init_PSCSIs
saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
KeyError: '044dde78-2896-cb88-2ada-3c03a73c35c1'

All reported cases involve fresh installs of dom0, so /var/lib/xend/state/ is empty. I wasn't able to reproduce the issue myself but a reporter was kind enough to try a debug patch. I found that vscsi_util.get_all_scsi_devices() returns several records containing same scsi_id. With /var/lib/xend/state/pscsi.xml non-existent and identical scsi_id, we access an element of saved_pscsis that does not exist. In fact, the list is empty.

The attached patch catches the exception and allows xend to start but I'm not sure if this breaks other parts of the code. It looks safe to me but would like your review.

Regards,
Jim

tools/python/xen/xend/XendNode.py +4 -1
Index: xen-4.0.0-testing/tools/python/xen/xend/XendNode.py
===================================================================
@@ -336,7 +336,10 @@ class XendNode:
                     pscsi_uuid = uuid.createString()
                     saved_pscsi_table[scsi_id] = pscsi_uuid
                 else:
-                    saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
+                    try:
+                        saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
+                    except KeyError:
+                        pass
 
                 physical_host = int(pscsi_record['physical_HCTL'].split(':')[0])
                 if pscsi_HBA_table.has_key(physical_host):

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 46 lines · Jim Fehlig

Hi Kan,

I've received several reports of xend not starting with the following traceback

[2010-03-04 13:24:10 9096] ERROR (SrvDaemon:349) Exception starting xend ( '044dde78-2896-cb88-2ada-3c03a73c35c1')
Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvDaemon.py",
line 341, in run
servers = SrvServer.create()
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvServer.py",
line 261, in create
root.putChild('xend', SrvRoot())
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvRoot.py",
line 40, in __init__
self.get(name)
File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 84, in
get
val = val.getobj()
File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 52, in
getobj
self.obj = klassobj()
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvNode.py",
line 30, in __init__
self.xn = XendNode.instance()
File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 1187
, in instance
inst = XendNode()
File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 161,
in __init__
self._init_PSCSIs()
File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 339,
in _init_PSCSIs
saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
KeyError: '044dde78-2896-cb88-2ada-3c03a73c35c1'

All reported cases involve fresh installs of dom0, so /var/lib/xend/state/ is empty. I wasn't able to reproduce the issue myself but a reporter was kind enough to try a debug patch. I found that vscsi_util.get_all_scsi_devices() returns several records containing same scsi_id. With /var/lib/xend/state/pscsi.xml non-existent and identical scsi_id, we access an element of saved_pscsis that does not exist. In fact, the list is empty.

Quoted 4 lines

The attached patch catches the exception and allows xend to start but I'm not sure if this breaks other parts of the code. It looks safe to me but would like your review.

Hi Jim,

Thanks for your report and patch.

Are your SCSI devices multi-path configuration?
If so, the configuration isn't supported by pvSCSI of XenAPI yet.

I added a small fix to your patch. Could you send your Signed-off-by line?

Best regards,
Kan

tools/python/xen/xend/XendNode.py +5 -1
diff -r b8d2a4134a68 tools/python/xen/xend/XendNode.py
@@ -333,7 +333,11 @@
                     pscsi_uuid = uuid.createString()
                     saved_pscsi_table[scsi_id] = pscsi_uuid
                 else:
-                    saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
+                    try:
+                        saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
+                    except KeyError:
+                        log.warn("Multi-path SCSI devices are not supported for XenAPI")
+                        return
 
                 physical_host = int(pscsi_record['physical_HCTL'].split(':')[0])
                 if pscsi_HBA_table.has_key(physical_host):

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

author
#2 lore raw
Quoted 55 lines · Masaki Kanno
Quoted 46 lines · Jim Fehlig

Hi Kan,

I've received several reports of xend not starting with the following traceback

[2010-03-04 13:24:10 9096] ERROR (SrvDaemon:349) Exception starting xend ( '044dde78-2896-cb88-2ada-3c03a73c35c1')
Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvDaemon.py",
line 341, in run
servers = SrvServer.create()
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvServer.py",
line 261, in create
root.putChild('xend', SrvRoot())
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvRoot.py",
line 40, in __init__
self.get(name)
File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 84, in
get
val = val.getobj()
File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 52, in
getobj
self.obj = klassobj()
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvNode.py",
line 30, in __init__
self.xn = XendNode.instance()
File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 1187
, in instance
inst = XendNode()
File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 161,
in __init__
self._init_PSCSIs()
File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 339,
in _init_PSCSIs
saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
KeyError: '044dde78-2896-cb88-2ada-3c03a73c35c1'

All reported cases involve fresh installs of dom0, so /var/lib/xend/state/ is empty. I wasn't able to reproduce the issue myself but a reporter was kind enough to try a debug patch. I found that vscsi_util.get_all_scsi_devices() returns several records containing same scsi_id. With /var/lib/xend/state/pscsi.xml non-existent and identical scsi_id, we access an element of saved_pscsis that does not exist. In fact, the list is empty.

Quoted 5 lines

The attached patch catches the exception and allows xend to start but I'm not sure if this breaks other parts of the code. It looks safe to me but would like your review.

Quoted 6 lines

Hi Jim,

Thanks for your report and patch.

Are your SCSI devices multi-path configuration?

Yes, it appears all of the reports have multipath configured.

Quoted 5 lines

If so, the configuration isn't supported by pvSCSI of XenAPI yet.

I added a small fix to your patch. Could you send your Signed-off-by line?

Ok, thanks for the review and changes.

Cheers,
Jim

Quoted 6 lines

Best regards,
Kan