nova-compute fails to start on XenServer

Bug #1029501 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Critical
Dan Prince

Bug Description

Post Git commit 2578945be71f2e1b757e184b00eaf76220555889:

Nova-compute fails to startup on XenServer.

2012-07-26 14:52:10 INFO nova.compute.manager [-] Loading compute driver 'xenapi.XenAPIDriver'
2012-07-26 14:52:10 ERROR nova.compute.manager [-] Unable to load the virtualization driver: Class XenAPIDriver cannot be found (['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/site-packages/nova/openstack/common/importutils.py", line 30, in import_class\n __import__(mod_str)\n', 'ImportError: No module named xenapi\n'])

The issue appears to be that we now import libvirt classes in the virt/disk/api. This API is used cross hypervisor so we should avoid initializing modules (libvirt) which may not be installed.

Dan Prince (dan-prince)
Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
importance: Undecided → Critical
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/10347

Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

It appears to be caused by an import loop:

>>> import nova.virt.xenapi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "nova/virt/xenapi/__init__.py", line 21, in <module>
    from nova.virt.xenapi.driver import XenAPIDriver
  File "nova/virt/xenapi/driver.py", line 55, in <module>
    from nova.virt.xenapi import host
  File "nova/virt/xenapi/host.py", line 31, in <module>
    from nova.virt.xenapi import vm_utils
  File "nova/virt/xenapi/vm_utils.py", line 49, in <module>
    from nova.virt.disk import api as disk
  File "nova/virt/disk/api.py", line 42, in <module>
    from nova.virt.libvirt import utils as libvirt_utils
  File "nova/virt/libvirt/__init__.py", line 17, in <module>
    from nova.virt.libvirt.driver import LibvirtDriver
  File "nova/virt/libvirt/driver.py", line 73, in <module>
    from nova.virt.disk import api as disk
ImportError: cannot import name api

nova.virt.disk.api imports libvirt_utils and nova.virt.libvirt.driver imports nova.virt.disk.api.

The fix is still the same :)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/10347
Committed: http://github.com/openstack/nova/commit/f6f293ea44c73c59e651817a9315778ab5aa0e5e
Submitter: Jenkins
Branch: master

commit f6f293ea44c73c59e651817a9315778ab5aa0e5e
Author: Dan Prince <email address hidden>
Date: Thu Jul 26 11:23:13 2012 -0400

    Don't import libvirt_utils in disk api.

    Updates the virt/disk/api so that we no longer import libvirt_utils.

    This fixes issues when using Nova compute with compute drivers other
    than libvirt. (xenapi, etc.)

    Fixes LP Bug #1029501.

    Change-Id: I46ece309480ce0a0941a96371a51d77712c41eb6

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.