openvswitch mech. driver does not report error in check_segment_for_agent

Bug #1404962 reported by George Shuklin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
yalei wang

Bug Description

When administrator misspells mappings for external flat networks, nova fails with obscure trace during instance creation:

 Traceback (most recent call last):
   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2231, in _build_resources
     yield resources
   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2101, in _build_and_run_instance
     block_device_info=block_device_info)
   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 2619, in spawn
     write_to_disk=True)
   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 4150, in _get_guest_xml
     context)
   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 3936, in _get_guest_config
     flavor, CONF.libvirt.virt_type)
   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/vif.py", line 352, in get_config
     _("Unexpected vif_type=%s") % vif_type)
 NovaException: Unexpected vif_type=binding_failed

The real problem lies in neutron/plugins/ml2/drivers/mech_openvswitch.py:

        network_type = segment[api.NETWORK_TYPE]
        if network_type == 'local':
            return True
        elif network_type in tunnel_types:
            return True
        elif network_type in ['flat', 'vlan']:
            return segment[api.PHYSICAL_NETWORK] in mappings
        else:
            return False

If network_type is 'flat' and segment[api.PHYSICAL_NETWORK] is not in mappings it returns False, this causes all other problems.

Proposal: add some kind of WARNING in this place to let the administrator know that no matching mappings found.

Tags: ovs
yalei wang (yalei-wang)
Changed in neutron:
assignee: nobody → yalei wang (yalei-wang)
tags: added: ovs
Changed in neutron:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/144257
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=a04fa671209343009887575fdda9c8a3a7d23ba0
Submitter: Jenkins
Branch: master

commit a04fa671209343009887575fdda9c8a3a7d23ba0
Author: Yalei Wang <email address hidden>
Date: Mon Dec 29 13:17:30 2014 +0800

    print error when no match mapping found in check_segment_for_agent

    error print when no match PHYSICAL_NETWORK mapping found in function
    check_segment_for_agent for OVS and linuxbridge mechanism driver.

    Change-Id: I58c43328f0512de25720871fc51c79f074493cdf
    Closes-Bug: #1404962

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-2 → 2015.1.0
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.