Set default vnic_type in neutron.

Bug #1370077 reported by Baodong (Robert) Li on 2014-09-16
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
High
Sam Betts
neutron
Undecided
Sam Betts

Bug Description

https://review.openstack.org/#/c/72334/ introduced "binding:vnic_type" into the neutron port binding extension. Ml2 plugin has been updated to support the vnic_type, but others may not. Nova expects every port has a correct vnic_type. Therefore, neutron should make sure each port to have this attribute set correctly. By default, the vnic_type should be VNIC_TYPE_NORMAL

Changed in neutron:
status: New → Confirmed
Sam Betts (sambetts) on 2014-09-16
Changed in neutron:
assignee: nobody → Sam Betts (sambetts)

I think the reporter realized the nova commit http://git.openstack.org/cgit/openstack/nova/commit/?id=a8a5d44c8aca218f00649232c2b8a46aee59b77e pretty much broke all plugins which did not set VNIC_TYPE.

Is there any reason for *requiring* neutron sets VNIC_TYPE? Can't nova just default to VNIC_NORMAL if not specified?

Changed in neutron:
milestone: none → juno-rc1
importance: Undecided → High
Bob Melander (bob-melander) wrote :

Yes, either Nova has to be patched so that it assumes that value or Neutron port binding db mixing be patched so that if plugin does not set the attribute it gets the default value.

Related to this and more generally: What does it actually mean when a plugin supports an extension that introduces a bunch of attributes (like the 'bindings' extension)? Should one assume that the introduced attributes are not necessarily returned in get_<resource> requests?

Kyle Mestery (mestery) wrote :

I like Salvatore's approach of just setting this in nova if neutron doesn't specify the value.

Sam Betts (sambetts) on 2014-09-16
Changed in nova:
assignee: nobody → Sam Betts (sambetts)

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

Changed in nova:
status: New → In Progress
Dan Smith (danms) on 2014-09-17
Changed in nova:
importance: Undecided → High
milestone: none → juno-rc1

With patch https://review.openstack.org/121939 do we need to keep tracking this in Neutron, i.e. we'd still want plugins to set this port binding attribute?

Changed in neutron:
status: Confirmed → Opinion

If the issue in nova is fixed, neutron does not have to do anything.
Forcing all plugins to set VNIC_TYPE would actually be wrong I think.

Changed in neutron:
importance: High → Undecided
status: Opinion → Invalid
status: Invalid → Won't Fix
Baodong (Robert) Li (baoli) wrote :

The review https://review.openstack.org/121939 proposed a fix in nova. Should a separate bug be created to track it in Nova? But when I was doing that, it gave me back this bug. Is there anyway to change the project for a bug?

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

commit 354840aa4b1d0cf67c5cce37bac74c5526df74d5
Author: Sam Betts <email address hidden>
Date: Tue Sep 16 18:34:39 2014 +0100

    Assume VNIC_NORMAL if binding:vnic_type not set

    Nova was assuming that every port returned from neutron had a
    binding:vnic_type attribute, however this is not always the case.
    This fix ensures that in the cases when a port does not have the
    attribute nova assumes the default, VNIC_NORMAL. Unit tests added
    to prevent the regression of this change have also been addded.

    Change-Id: Ia92ffa8658c2e972fa5556e9e47ada8affb57053
    Closes-Bug: 1370077

Changed in nova:
status: In Progress → Fix Committed
Kyle Mestery (mestery) on 2014-09-23
Changed in neutron:
milestone: juno-rc1 → none

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

commit 6e35185396f8e7d7a69e587ffd25ceb5ae07260c
Author: Sam Betts <email address hidden>
Date: Thu Sep 18 16:36:53 2014 +0100

    Refactor test_get_port_vnic_info 2 and 3

    This patch addresses the comments left on review 121939 for
    nova/tests/network/test_neutronv2.py, it removes duplicated code from
    the added unit tests and corrects an identation issue.

    Change-Id: I02c004297d4ee78e5695c3ca265052020f2fcfa3
    Related-Bug: 1370077

Thierry Carrez (ttx) on 2014-10-01
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2014-10-16
Changed in nova:
milestone: juno-rc1 → 2014.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers