Custom Search

Wednesday, October 14, 2015

OpenStack kilo opencontrail vif driver fix NovaException: vif_type parameter must be present for this vif_driver implementation

Fix
===========

1)
a)
#vim /etc/nova/nova.con
nova_contrail_vif.contrailvif.ContrailNetworkAPI

b)
Restart nova-compute
#service  nova-compute restar

c)
#nova boot ---

2) OR
 
JUNO/KILO release doesn't support libvirt_vif_driver configuration in nova.conf
vif_driver is set to LibvirtGenericVIFDriver. plug/unplug/get_config api from
this class doesn't support opencontrail. Till opencontrail vif_driver is
upstreamed, overwrite the vif_driver with VRouterVIFDriver


https://github.com/Juniper/contrail-nova-vif-driver/blob/88a1fb67919056818ecfff2d462120f3c4693831/nova_contrail_vif/contrailvif.py#L42

a)
$vim /usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py

##SM
from nova_contrail_vif.contrailvif import VRouterVIFDriver =====

class LibvirtDriver(driver.ComputeDriver):

    def __init__(self, virtapi, read_only=False):
        ##SM
        self.vif_driver = VRouterVIFDriver() =====
        #self.vif_driver = libvirt_vif.LibvirtGenericVIFDriver()

b)
$service  nova-compute restart
$tail -f /var/log/nova/nova-compute.log

Error
===========

$/var/log/nova/nova-compute.log

2015-06-10 19:44:05.482 7765 ERROR nova.compute.manager [req-820a22fd-b835-45e3-b654-805e68adbd2e 8029c48a21654b51bea88039dbd140a8 ada49dd0f0a8429ca2b91cc120b8437c - - -] [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b] Instance failed to spawn
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b] Traceback (most recent call last):
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2461, in _build_resources
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     yield resources
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2333, in _build_and_run_instance
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     block_device_info=block_device_info)
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 2382, in spawn
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     write_to_disk=True)
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 4183, in _get_guest_xml
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     context)
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 4054, in _get_guest_config
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     flavor, virt_type)
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/vif.py", line 368, in get_config
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]     _("vif_type parameter must be present "
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b] NovaException: vif_type parameter must be present for this vif_driver implementation
2015-06-10 19:44:05.482 7765 TRACE nova.compute.manager [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b]
2015-06-10 19:44:05.486 7765 INFO nova.compute.manager [req-820a22fd-b835-45e3-b654-805e68adbd2e 8029c48a21654b51bea88039dbd140a8 ada49dd0f0a8429ca2b91cc120b8437c - - -] [instance: 675c279e-3380-47d4-9050-a24d8b0ff59b] Terminating instance

No comments:

Post a Comment