Ask Your Question

XenServer - ImportError: No module named os_xenapi.client

asked 2017-08-31 17:10:50 -0600

ooh-wee gravatar image

updated 2017-09-04 17:59:42 -0600

I'm trying to set up OpenStack Ocata on 2 XenServer hosts and ran into some problems regarding the XenAPI plugins. Following the official documentation for (OpenStack/XenServer integration), there seemed to be big disrepancies in the installation guide, particularly in steps 2 and 3 of manually installing OpenStack XAPI plugins onto the host:

Step 2 - Get the source from the archives. The example assumes the master branch is used, and the XenServer host is accessible as xenserver. Match those parameters to your setup.

$ wget -qO "$NOVA_TARBALL" "$NOVA_URL"
$ tar xvf "$NOVA_TARBALL" -d "$NOVA_SOURCES"

Step 3 - Copy the plug-ins to the hypervisor:

$ PLUGINPATH=$(find $NOVA_SOURCES -path '*/xapi.d/plugins' -type d -print)
$ tar -czf - -C "$PLUGINPATH" ./ |
> ssh root@xenserver tar -xozf - -C /etc/xapi.d/plugins

The first problem was that the nova-master.tar.gz tarball actually did not contain any paths to the XAPI plugins, making the PLUGINPATH in step 3 return empty.

Nonetheless, searching through the manually, I found another tarball os-xenapi-master.tar.gz which actually had the plugins, and followed the rest of the steps described in the documentation (with minor corrections).

After changing all the required configs in nova.conf and taking care of other required steps for XenServer listed on the docs, I tried starting Nova on the compute node, however, it failed with the following results in the /var/log/nova/nova-compute.log:

2017-08-04 17:54:05.657 2957 INFO nova.virt.driver [req-9a05d390-d7ce-43a4----] Loading compute driver 'xenapi.XenAPIDriver'
2017-08-04 17:54:05.657 2957 INFO nova.virt.driver [req-9a05d390-d7ce-43a4----] Unable to load the virtualization driver
2017-08-04 17:55:05.720 2957 ERROR nova.virt.driver    from os_xenapi.client import session
2017-08-04 17:54:05.720 2957 ERROR nova.virt.driver    ImportError: No module named os_xenapi.client

Checking if Nova works at all, I reverted to using basic QEMU, which was successful since running openstack hypervisor list on the controller node then listed the compute node being up with QEMU as hypervisor, meaning, the problem lies somewhere with XAPI plugins. Both controller and compute node are located on the same host, and both running CentOS 7.

Does anyone know any possible solutions to get OpenStack working with XenServer, or is there something I am doing wrong? All help is greatly appreciated!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-09-05 02:24:38 -0600

adhi gravatar image

try using

pip install xenapi os-xenapi

if pip doesn't exist on your system, installed first via

yum install python-pip

upgrade pip

pip install pip --upgrade
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-08-31 17:10:50 -0600

Seen: 284 times

Last updated: Sep 05 '17