nova-compute (icehouse) exits with a misleading error when libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver

Bug #1302796 reported by Lars Kellogg-Stedman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Lars Kellogg-Stedman

Bug Description

In Havana, this was a valid setting:

  libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver

The nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver class has been removed in Icehouse; if nova-compute is run with this setting in nova.conf, the resulting error is...

   2014-04-04 19:33:55.783 17413 TRACE nova.virt.driver ImportError: Class LibvirtDriver cannot be found (['Traceback (most recent call last):\n', ' File "/usr/lib/python2.6/site-packages/nova/openstack/common/importutils.py", line 29, in import_class\n return getattr(sys.modules[mod_str], class_str)\n', "AttributeError: 'module' object has no attribute 'LibvirtDriver'\n"])

...which is misleading, and will cause people to start looking at the setting of compute_driver. The error is caused by the libvirt driver attempting to import the vif class:

          vif_class = importutils.import_class(CONF.libvirt.vif_driver)

If this configuration option was valid in Havana, then:

(a) there should probably be a deprecation warning prior to it going away, and
(b) the error message in icehouse should point at the actual problem rather than throwing a misleading exception.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/85463

Revision history for this message
Lars Kellogg-Stedman (larsks) wrote :
Revision history for this message
Lars Kellogg-Stedman (larsks) wrote :

Ugh, sorry, that would be: https://review.openstack.org/#/c/85462/

Dan Smith (danms)
Changed in nova:
milestone: none → icehouse-rc2
importance: Undecided → Critical
importance: Critical → Medium
status: New → Confirmed
assignee: nobody → Lars Kellogg-Stedman (larsks)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/85462
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9f6070e194504cc2ca2b7f2a2aabbf91c6b81897
Submitter: Jenkins
Branch: master

commit 9f6070e194504cc2ca2b7f2a2aabbf91c6b81897
Author: Lars Kellogg-Stedman <email address hidden>
Date: Fri Apr 4 14:58:12 2014 -0400

    mark vif_driver as deprecated and log warning

    Several classes were dropped from nova.virt.libvirt.vif from havana ->
    icehouse, leading to invalid configurations if one of these classes was
    used in the libvirt_vif_driver setting in nova.conf. The error message
    produced by nova-compute in this situation is misleading.

    This patch introduces stubs for all of the classes that were removed.
    These stubs inherit from LibvirtGenericVIFDriver and log a deprecation
    warning in __init__.

    This patch also marks the vif_driver option as deprecated.

    Change-Id: I6d6cb9315ce6f3b33d17756bcdc77dccda26fefe
    Closed-bug: 1302796

Thierry Carrez (ttx)
Changed in nova:
status: Confirmed → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/85707

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

Reviewed: https://review.openstack.org/85707
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=fdffaab6171562487a404963dbf6b7f1f9469a65
Submitter: Jenkins
Branch: milestone-proposed

commit fdffaab6171562487a404963dbf6b7f1f9469a65
Author: Lars Kellogg-Stedman <email address hidden>
Date: Fri Apr 4 14:58:12 2014 -0400

    mark vif_driver as deprecated and log warning

    Several classes were dropped from nova.virt.libvirt.vif from havana ->
    icehouse, leading to invalid configurations if one of these classes was
    used in the libvirt_vif_driver setting in nova.conf. The error message
    produced by nova-compute in this situation is misleading.

    This patch introduces stubs for all of the classes that were removed.
    These stubs inherit from LibvirtGenericVIFDriver and log a deprecation
    warning in __init__.

    This patch also marks the vif_driver option as deprecated.

    Change-Id: I6d6cb9315ce6f3b33d17756bcdc77dccda26fefe
    Closed-bug: 1302796
    (cherry picked from commit 9f6070e194504cc2ca2b7f2a2aabbf91c6b81897)

Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-rc2 → 2014.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/109039

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/109265

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/109266

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/109267

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

Reviewed: https://review.openstack.org/109039
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=894fbae8ec4f22a71b3021c1b695dc0e4975aa96
Submitter: Jenkins
Branch: master

commit 894fbae8ec4f22a71b3021c1b695dc0e4975aa96
Author: Daniel P. Berrange <email address hidden>
Date: Wed Jul 23 17:47:37 2014 +0100

    libvirt: remove VIF driver classes deprecated in Icehouse

    In Icehouse the old VIF driver classes were set as deprecated
    to be removed in Juno. Now they can be finally deleted.

    Related-bug: #1302796
    Change-Id: I7be735062e6cc6aa54dec1bf43d3cce1ac544988

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/109265
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7a206bc58de104ed0fa1c4e960be8f9467082f05
Submitter: Jenkins
Branch: master

commit 7a206bc58de104ed0fa1c4e960be8f9467082f05
Author: Daniel P. Berrange <email address hidden>
Date: Thu Jul 24 12:27:46 2014 +0100

    libvirt: remove use of CONF.libvirt.virt_type in vif.py

    The vif.py class imports the CONF.libvirt.virt_type parameter
    from the main driver.py file. This sets up a circular dependency
    which prevents driver.py importing vif.py in the top of the file,
    since the CONF.libvirt.virt_type parameter won't have been
    registered yet.

    It is generally bad design practice to rely on global variables,
    which is effectively what the CONF.* parameters are, so change
    the VIF driver get_config() API to accept 'virt_type' as a
    parameter instead.

    Related-bug: #1302796
    Change-Id: I023851df96640eeeb54124add8cc5c725b8d13be

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/109266
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7561c8ded211d53e8745d1420a73b82bd0fc35cf
Submitter: Jenkins
Branch: master

commit 7561c8ded211d53e8745d1420a73b82bd0fc35cf
Author: Daniel P. Berrange <email address hidden>
Date: Thu Jul 24 11:53:47 2014 +0100

    libvirt: remove 'vif_driver' config parameter

    The 'vif_driver' config parameter was deprecated in the
    previous cycle, so can be deleted now.

    The two places in the test file which were overriding
    the 'vif_driver' config parameter were redundant as
    mocking already ensured the real VIF driver module
    was not exercised.

    The FakeVIFDriver class is thus no longer required, and
    the FakeIptablesFirewallDriver class was already not
    required, so both are deleted.

    DocImpact
    Related-bug: #1302796
    Change-Id: I75519266ffc65df92efd20badfeaf88ac0d66f8a

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/109267
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b5952b1ac90a7fc3692d80d412345a1a39b3aeb1
Submitter: Jenkins
Branch: master

commit b5952b1ac90a7fc3692d80d412345a1a39b3aeb1
Author: Daniel P. Berrange <email address hidden>
Date: Thu Jul 24 13:16:54 2014 +0100

    libvirt: remove pointless LibvirtBaseVIFDriver class

    There is only one single VIF driver class these days, so it is
    pointless having a LibvirtBaseVIFDriver base class to inherit
    from.

    Related-bug: #1302796
    Change-Id: Ie132135f9b6cf5337782ee9d1611c05bd56557fe

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.