ImportError: No module named xen.xend.XendClient

Seek and render assistance on all issues related to downloading, deploying and configuring ConVirt here.

ImportError: No module named xen.xend.XendClient

Postby Jis on Fri Jul 24, 2009 10:55 am

After installing ConVirt 1.1 and applying the two patches on Xubuntu 9.04 x64 Jaunty running as dom0 using a debian kernel, ConVirt gives the following error after being started:

Code: Select all
~$ sudo convirt
Valid, writable configuration found, using /etc/convirt.conf
/home/jiskefet/.mozilla/firefox/rn7ryetv.default/prefs.js
type is missing. Direct connection. None, None
guessed proxy setup  None None
Log file at /var/log/convirt/convirt.log


The logfile then shows this:
Code: Select all
{'platforms': {'kvm': {'directory': 'kvm', 'name': 'KVM'},
               'xen': {'directory': 'xen', 'name': 'Xen'}}}
{'kvm': {'directory': 'kvm', 'name': 'KVM'},
'xen': {'directory': 'xen', 'name': 'Xen'}}
{'kvm': {'config': {'platform_class': 'KVMPlatform',
                    'platform_module': 'convirt.core.platforms.kvm.KVMPlatform'},
         'ui_config': {'ui_helper_class': 'KVMUIHelper',
                       'ui_helper_module': 'convirt.client.KVMUI'}},
'xen': {'config': {'platform_class': 'XenPlatform',
                    'platform_module': 'convirt.core.platforms.xen.XenPlatform'},
         'ui_config': {'ui_helper_class': 'XenUIHelper',
                       'ui_helper_module': 'convirt.client.XenUI'}}}
from convirt.core.platforms.xen.XenPlatform import XenPlatform; platform = XenPlatform(plat, self.client_config)
from convirt.core.platforms.kvm.KVMPlatform import KVMPlatform; platform = KVMPlatform(plat, self.client_config)
PROMPT  None
Traceback (most recent call last):
  File "/usr/share/convirt/src/convirt/client/convirt_client.py", line 4975, in <module>
    factory = manager.getFactory(local_platform)
  File "/usr/share/convirt/src/convirt/core/model/GridManager.py", line 104, in getFactory
    factory =  self.registry.get_node_factory(platform)
  File "/usr/share/convirt/src/convirt/core/model/PlatformRegistry.py", line 113, in get_node_factory
    self.node_factories[platform] = p_obj.get_node_factory(self.store)
  File "/usr/share/convirt/src/convirt/core/platforms/xen/XenPlatform.py", line 71, in get_node_factory
    import XenNodeFactory
  File "/usr/share/convirt/src/convirt/core/platforms/xen/XenNodeFactory.py", line 25, in <module>
    from XenNode import XenNode
  File "/usr/share/convirt/src/convirt/core/platforms/xen/XenNode.py", line 33, in <module>
    from XenVMM import XenVMM
  File "/usr/share/convirt/src/convirt/core/platforms/xen/XenVMM.py", line 25, in <module>
    from XenServerProxy import ServerProxy, SSHTunnelTransport
  File "/usr/share/convirt/src/convirt/core/platforms/xen/XenServerProxy.py", line 29, in <module>
    import xen.xend.XendClient
ImportError: No module named xen.xend.XendClient


Some additional info on the system:
Hardware: AMD Phenom II X4 905e (AM3/2x2GB DDR3)
OS: Xubuntu 9.04 (jaunty)
Kernel: 2.6.26-2-xen-amd64 (modules, kernel)
Xen: 3.3.0-1ubuntu9.3 (installed by ubuntu-xen-desktop)
Filesystem: ext3 / on /dev/md0 (raid1)

After installing ubuntu-xen-desktop and the debian kernel, ConVirt 0.8.2-3 was installed as a dependency. This version didn't start either, but it would start after making the change mentioned in ubuntu bugreport 358241.

After that, ConVirt 1.1 was installed as described in the installation wiki page.

It looks like it is again a python 2.5 versus 2.6 issue, but I don't know what needs to be changed. Searching with google and searching this forum didn't provide any results, so I hope someone can tell what needs to be changed to get ConVirt 1.1 working.

I was able to start ConVirt 1.1 though on a fresh install of Xubuntu 9.04 with ConVirt 1.1 in Virtualbox on another PC. But when adding the server, the same message pops up: "No module named xen.xend.XendClient". So the problem only seems to occur in a xen-enabled environment and/or in a dom0 environment.
Jis
 
Posts: 2
Joined: Fri Jul 24, 2009 9:37 am

Re: ImportError: No module named xen.xend.XendClient

Postby jd_jedi on Fri Jul 24, 2009 11:28 am

Can you look for XendClient.py on your machine.
That might give some hints on where Xen is installed.
Which version of python is being used for ConVirt. (check path etc)
jd_jedi
 
Posts: 984
Joined: Mon Mar 09, 2009 6:22 pm

Re: ImportError: No module named xen.xend.XendClient

Postby Jis on Fri Jul 24, 2009 12:18 pm

I found two files with that name:
Code: Select all
~$ sudo find / -name XendClient.py
/usr/share/pyshared/xen/xend/XendClient.py
/usr/lib/python2.5/site-packages/xen/xend/XendClient.py


Both files hold this content:
Code: Select all
#!/usr/bin/env python2.5
<cut gpl...>
from xen.util.xmlrpcclient import ServerProxy
import os
import sys

XML_RPC_SOCKET = "/var/run/xend/xmlrpc.sock"
XEN_API_SOCKET = "/var/run/xend/xen-api.sock"

ERROR_INTERNAL = 1
ERROR_GENERIC = 2
ERROR_INVALID_DOMAIN = 3

uri = 'httpu:///var/run/xend/xmlrpc.sock'
if os.environ.has_key('XM_SERVER'):
    uri = os.environ['XM_SERVER']

try:
    server = ServerProxy(uri)
except ValueError, exn:
    print >>sys.stderr, exn
    sys.exit(1)

This code itself doesn't tell me much. But I found that /usr/bin/python links to /usr/bin/python2.6. There also is a file /usr/bin/python2.5.

The only thing I can think of is to add one of the two paths that holds the file "XendClient.py" (or both?) to /usr/share/convirt/src/convirt/client/convirt_client.py, by adding one or both of these lines to the existing ones:
sys.path.append('/usr/share/pyshared/xen/xend')
sys.path.append('/usr/lib/python2.5/site-packages/xen/xend')

Is that what should be done? Or should it be changed somewhere else?
Jis
 
Posts: 2
Joined: Fri Jul 24, 2009 9:37 am

Re: ImportError: No module named xen.xend.XendClient

Postby jd_jedi on Tue Jul 28, 2009 3:10 pm

Sorry.. for late response. missed it.
You need to usually give the base directory of the package space in python.
So try the following.

sys.path.append('/usr/share/pyshared/'')

Hope this helps. If not let us know and we can try to dig deeper.
/Jd
jd_jedi
 
Posts: 984
Joined: Mon Mar 09, 2009 6:22 pm

Re: ImportError: No module named xen.xend.XendClient

Postby cahlfors on Thu Oct 08, 2009 10:51 am

FWIW, I get the "No module named xen.xend.XendClient" error when adding my first managed servers. The above proposed solution works fine. I'd call this a bug?

Oh, and I'd like to clarify to any newbies (like myself) that this fix is done on the Convirt _client_ - not the managed servers.

I'm using the packaged version of Convirt 1.1 on Ubuntu Jaunty (on my client...).

Cheers,
/Chris
cahlfors
 
Posts: 21
Joined: Wed Apr 15, 2009 1:51 am

Re: ImportError: No module named xen.xend.XendClient

Postby jd_jedi on Thu Oct 08, 2009 4:35 pm

Hi Chris,
Thanks for pointing it out. We will fix it for future and publish a patch.
jd_jedi
 
Posts: 984
Joined: Mon Mar 09, 2009 6:22 pm

Re: ImportError: No module named xen.xend.XendClient

Postby esplinter on Thu Jul 22, 2010 8:49 am

Hi,

I also found this problem after installing convirt in Debian Lenny. In debian lenny the path to find the XendClient.py file is "/usr/lib/xen-3.2-1/lib/python/xen/xend/XendClient.py"

So I had to edit the file XenServerProxy.py in convirt code:
Code: Select all
vim $HOME/convirt/src/convirt/web/convirt/convirt/core/platforms/xen/XenServerProxy.py



and add this two lines at the beginning:
Code: Select all
import sys
sys.path.append('/usr/lib/xen-3.2-1/lib/python')


hope it helps.
esplinter
 
Posts: 1
Joined: Thu Jul 22, 2010 8:43 am


Return to Installation & Configuration Help

Who is online

Users browsing this forum: No registered users and 1 guest