Ask Your Question
1

ImportError: No module named xenapi [closed]

asked 2013-12-16 21:27:33 -0500

abboy gravatar image

updated 2013-12-16 21:29:09 -0500

I have install Xenserver 6.2 as my compute node,and I install a pv vm with centos6.5 system and named nova.openstack.com,and follow the manual http://docs.openstack.org/havana/config-reference/content/introduction-to-xen.html .

first,install all toolstack.

yum -y install http://repos.fedorapeople.org/repos/openstack/openstack-havana/rdo-release-havana-7.noarch.rpm
yum install -y http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm
yum update -y
# disable selinux
yum install openstack-nova-compute
yum install mysql  MySQL-python

set /etc/nova/nova.conf

compute_driver=xenapi.XenAPIDriver
xenapi_connection_url=compute.openstack.com
xenapi_connection_username=root
xenapi_connection_password=computepwd

Of course, i have set up all need options,such as keystone authtoken, mysql connection, qpid rpc backend, glance host, api-paste.ini and so on, but when i start service openstack-nova-compute start , i got the error message come from /var/log/nova/compute.log

2013-12-17 10:38:09.058 2224 ERROR nova.virt.driver [-] Unable to load the virtualization driver
2013-12-17 10:38:09.058 2224 TRACE nova.virt.driver Traceback (most recent call last):
2013-12-17 10:38:09.058 2224 TRACE nova.virt.driver   File "/usr/lib/python2.6/site-packages/nova/virt/driver.py", line 1108, in load_compute_driver
2013-12-17 10:38:09.058 2224 TRACE nova.virt.driver     virtapi)
2013-12-17 10:38:09.058 2224 TRACE nova.virt.driver   File "/usr/lib/python2.6/site-packages/nova/openstack/common/importutils.py", line 54, in import_object_ns
2013-12-17 10:38:09.058 2224 TRACE nova.virt.driver     return import_class(import_str)(*args, **kwargs)
2013-12-17 10:38:09.058 2224 TRACE nova.virt.driver   File "/usr/lib/python2.6/site-packages/nova/openstack/common/importutils.py", line 30, in import_class
2013-12-17 10:38:09.058 2224 TRACE nova.virt.driver     __import__(mod_str)
2013-12-17 10:38:09.058 2224 TRACE nova.virt.driver ImportError: No module named xenapi

it said that i have not install xenapi module. but when i lanuch locate xenapi,i found that:

/usr/lib/python2.6/site-packages/nova/virt/xenapi
/usr/lib/python2.6/site-packages/nova/virt/xenapi/__init__.py
/usr/lib/python2.6/site-packages/nova/virt/xenapi/__init__.pyc
/usr/lib/python2.6/site-packages/nova/virt/xenapi/__init__.pyo
/usr/lib/python2.6/site-packages/nova/virt/xenapi/agent.py
/usr/lib/python2.6/site-packages/nova/virt/xenapi/agent.pyc
/usr/lib/python2.6/site-packages/nova/virt/xenapi/agent.pyo
/usr/lib/python2.6/site-packages/nova/virt/xenapi/driver.py
/usr/lib/python2.6/site-packages/nova/virt/xenapi/driver.pyc
/usr/lib/python2.6/site-packages/nova/virt/xenapi/driver.pyo
/usr/lib/python2.6/site-packages/nova/virt/xenapi/fake.py
-------------------- and so on

it isn't says the xenapi had installed in /usr/lib/python2.6/site-packages/nova/virt/xenapi/,but why i can't use it Correctly?

can some kind people tell me how to use the module Correctly?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by dheeru
close date 2013-12-16 23:44:06.121091

Comments

I have the same issue but even installing the xenapi, the module is not detected...

dnascimento gravatar imagednascimento ( 2014-01-08 12:46:45 -0500 )edit

1 answer

Sort by » oldest newest most voted
2

answered 2013-12-16 22:20:07 -0500

abboy gravatar image

ok , i have solved this problems,

pip install xenapi

early i have the launch the Command,but it return error message , but now it works well, i don't know why , but i am happy see that it works well now!

edit flag offensive delete link more

Comments

This is really cool. I looked at the code and it was clear issue not finding the xenapi. After executing the command it worked for you. I will go ahead and close this request.

dheeru gravatar imagedheeru ( 2013-12-16 23:43:58 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-12-16 21:27:33 -0500

Seen: 1,642 times

Last updated: Dec 16 '13